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

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 403963002: Remove remaining overrides of View::GetEventHandlerForRect() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 06ee2367bc10843510ababf34335ccaacb42d472..dfcab19a603df8d4abd3cbc382da954580f6f883 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -252,21 +252,6 @@ class Tab::TabCloseButton : public views::ImageButton,
virtual ~TabCloseButton() {}
// views::View:
- virtual View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE {
- if (!views::UsePointBasedTargeting(rect))
- return View::GetEventHandlerForRect(rect);
-
- // Ignore the padding set on the button.
- gfx::Rect contents_bounds = GetContentsBounds();
- contents_bounds.set_x(GetMirroredXForRect(contents_bounds));
-
- // Include the padding in hit-test for touch events.
- if (aura::Env::GetInstance()->is_touch_down())
- contents_bounds = GetLocalBounds();
-
- return contents_bounds.Intersects(rect) ? this : parent();
- }
-
virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE {
// Tab close button has no children, so tooltip handler should be the same
// as the event handler.
@@ -337,6 +322,24 @@ class Tab::TabCloseButton : public views::ImageButton,
return button_bounds;
}
+ // views::ViewTargeterDelegate:
+ virtual View* TargetForRect(View* root, const gfx::Rect& rect) OVERRIDE {
+ CHECK_EQ(root, this);
+
+ if (!views::UsePointBasedTargeting(rect))
+ return ViewTargeterDelegate::TargetForRect(root, rect);
+
+ // Ignore the padding set on the button.
+ gfx::Rect contents_bounds = GetContentsBounds();
+ contents_bounds.set_x(GetMirroredXForRect(contents_bounds));
+
+ // Include the padding in hit-test for touch events.
+ if (aura::Env::GetInstance()->is_touch_down())
+ contents_bounds = GetLocalBounds();
+
+ return contents_bounds.Intersects(rect) ? this : parent();
+ }
+
// views:MaskedTargeterDelegate:
virtual bool GetHitTestMask(gfx::Path* mask) const OVERRIDE {
DCHECK(mask);
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698