| 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 e5c19d3cbf28da09f90500a71b639cc4809c02e8..cdc12e619863751fff2f8aa784591b18db180144 100644
|
| --- a/chrome/browser/ui/views/tabs/tab.cc
|
| +++ b/chrome/browser/ui/views/tabs/tab.cc
|
| @@ -245,21 +245,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.
|
| @@ -330,6 +315,25 @@ 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);
|
|
|