0

views: Override Label::HitTest with the default View::HitTest for Link.

BUG='Remove' link in the bookmark bubble doesn't work
TEST=manually

Review URL: http://codereview.chromium.org/7248064

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91475 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
sadrul@chromium.org
2011-07-04 20:22:59 +00:00
parent 159deea34f
commit 491860f8a0
2 changed files with 7 additions and 0 deletions
views/controls

@ -108,6 +108,12 @@ gfx::NativeCursor Link::GetCursor(const MouseEvent& event) {
#endif
}
bool Link::HitTest(const gfx::Point& l) const {
// We need to allow clicks on the link. So we override the implementation in
// Label and use the default implementation of View.
return View::HitTest(l);
}
bool Link::OnMousePressed(const MouseEvent& event) {
if (!IsEnabled() ||
(!event.IsLeftMouseButton() && !event.IsMiddleMouseButton()))

@ -35,6 +35,7 @@ class Link : public Label {
virtual void OnEnabledChanged() OVERRIDE;
virtual std::string GetClassName() const OVERRIDE;
virtual gfx::NativeCursor GetCursor(const MouseEvent& event) OVERRIDE;
virtual bool HitTest(const gfx::Point& l) const OVERRIDE;
virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE;
virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE;
virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE;