Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: ui/views/controls/link.cc

Issue 287193002: Remove overrides of HitTestRect() which just return false (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/link.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/link.cc
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index 84ff1de5eebdbb317658fb15fd62b16ba14b6c00..891ad38e4ae4f418377f80eb74ad0ad65a01fc03 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -51,12 +51,6 @@ gfx::NativeCursor Link::GetCursor(const ui::MouseEvent& event) {
return GetNativeHandCursor();
}
-bool Link::HitTestRect(const gfx::Rect& rect) 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::HitTestRect(rect);
-}
-
bool Link::OnMousePressed(const ui::MouseEvent& event) {
if (!enabled() ||
(!event.IsLeftMouseButton() && !event.IsMiddleMouseButton()))
@@ -172,6 +166,12 @@ void Link::SetEnabledColor(SkColor color) {
Label::SetEnabledColor(requested_enabled_color_);
}
+bool Link::CanAcceptEvent(const ui::Event& event) {
+ // Links need to be able to accept events (e.g., clicking) even though
+ // in general Labels do not.
+ return true;
sadrul 2014/05/21 15:44:59 I think this should return View::CanAcceptEvent(ev
tdanderson 2014/05/21 21:03:26 Done.
+}
+
void Link::SetPressedColor(SkColor color) {
requested_pressed_color_ = color;
if (pressed_)
« no previous file with comments | « ui/views/controls/link.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698