diff options
Diffstat (limited to 'chrome/browser/views')
| -rw-r--r-- | chrome/browser/views/tabs/tab.cc | 11 | ||||
| -rw-r--r-- | chrome/browser/views/tabs/tab.h | 4 | ||||
| -rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 12 |
3 files changed, 12 insertions, 15 deletions
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index bf5dc89..ec2ec29 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -126,11 +126,12 @@ bool Tab::IsSelected() const { /////////////////////////////////////////////////////////////////////////////// // Tab, ChromeViews::View overrides: -bool Tab::HitTest(const CPoint &l) const { - gfx::Path path; - MakePathForTab(&path); - ScopedHRGN rgn(path.CreateHRGN()); - return !!PtInRegion(rgn, l.x, l.y); +bool Tab::HasHitTestMask() const { + return true; +} + +void Tab::GetHitTestMask(gfx::Path* mask) const { + MakePathForTab(mask); } bool Tab::OnMousePressed(const ChromeViews::MouseEvent& event) { diff --git a/chrome/browser/views/tabs/tab.h b/chrome/browser/views/tabs/tab.h index 753e1a9..369a39d 100644 --- a/chrome/browser/views/tabs/tab.h +++ b/chrome/browser/views/tabs/tab.h @@ -84,10 +84,10 @@ class Tab : public TabRenderer, // TabRenderer overrides: virtual bool IsSelected() const; - // ChromeViews::View overrides: - virtual bool HitTest(const CPoint &l) const; private: // ChromeViews::View overrides: + virtual bool HasHitTestMask() const; + virtual void GetHitTestMask(gfx::Path* mask) const; virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); virtual void OnMouseReleased(const ChromeViews::MouseEvent& event, diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 748b9e7..6182e9b 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -67,15 +67,10 @@ class NewTabButton : public ChromeViews::Button { protected: // Overridden from ChromeViews::View: - virtual bool HitTest(const CPoint &l) const { - gfx::Path path; - MakePathForButton(&path); - ScopedHRGN rgn(path.CreateHRGN()); - return !!PtInRegion(rgn, l.x, l.y); + virtual bool HasHitTestMask() const { + return true; } - - private: - void MakePathForButton(gfx::Path* path) const { + virtual void GetHitTestMask(gfx::Path* path) const { DCHECK(path); SkScalar h = SkIntToScalar(GetHeight()); @@ -95,6 +90,7 @@ class NewTabButton : public ChromeViews::Button { path->close(); } + private: DISALLOW_COPY_AND_ASSIGN(NewTabButton); }; |
