diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-16 00:37:56 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-16 00:37:56 +0000 |
commit | 82739cfe200335e53c66b36e6b467c32294f7ef0 (patch) | |
tree | 32436525bb71a6ac93124da4e1dcc4b8c0bc48ed /chrome/views/view.h | |
parent | 0ae7d14ea97bdb4170948521144de57059eb4eeb (diff) | |
download | chromium_src-82739cfe200335e53c66b36e6b467c32294f7ef0.zip chromium_src-82739cfe200335e53c66b36e6b467c32294f7ef0.tar.gz chromium_src-82739cfe200335e53c66b36e6b467c32294f7ef0.tar.bz2 |
Allow Views to support an optional hit-test mask. Make hittest use this.
Make GetViewForPoint call HitTest instead of rolling its own crude hit testing.
Update custom-shaped views to use this framework instead of overriding hittest themselves.
B=2273
Review URL: http://codereview.chromium.org/3051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/view.h')
-rw-r--r-- | chrome/views/view.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/views/view.h b/chrome/views/view.h index c758418..a4ae692 100644 --- a/chrome/views/view.h +++ b/chrome/views/view.h @@ -19,6 +19,7 @@ namespace gfx { class Insets; +class Path; } class AccessibleWrapper; @@ -973,6 +974,7 @@ class View : public AcceleratorTarget { bool is_horizontal, bool is_positive); protected: + // TODO(beng): these members should NOT be protected per style guide. // This View's bounds in the parent coordinate system. CRect bounds_; @@ -989,6 +991,16 @@ class View : public AcceleratorTarget { virtual bool IsProcessingPaint() const; #endif + // Called by HitTest to see if this View has a custom hit test mask. If the + // return value is true, GetHitTestMask will be called to obtain the mask. + // Default value is false, in which case the View will hit-test against its + // bounds. + virtual bool HasHitTestMask() const; + + // Called by HitTest to retrieve a mask for hit-testing against. Subclasses + // override to provide custom shaped hit test regions. + virtual void GetHitTestMask(gfx::Path* mask) const; + // This method is invoked when the tree changes. // // When a view is removed, it is invoked for all children and grand |