| 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);
|
|
|