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

Unified Diff: ui/views/view.h

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revised patch with tests added Created 8 years, 4 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
« no previous file with comments | « ui/views/controls/link.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 9482cefa86b0b5b57bc7dc12250bbc8602425846..0d73640931a4c7bf73fb78d48d26a68ea58cc4bf 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -509,8 +509,12 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// the cursor is a shared resource.
virtual gfx::NativeCursor GetCursor(const MouseEvent& event);
- // Convenience to test whether a point is within this view's bounds
- virtual bool HitTest(const gfx::Point& l) const;
+ // A convenience function which calls HitTestRect with a rect of size
sky 2012/08/09 00:33:52 Use () when referring to methods, eg HitTestRect()
tdanderson 2012/08/09 16:16:46 Done.
+ // 1x1 and an origin of |point|.
+ bool HitTestPoint(const gfx::Point& point) const;
+
+ // Tests whether |rect| intersects this view's bounds.
+ virtual bool HitTestRect(const gfx::Rect& rect) const;
// This method is invoked when the user clicks on this view.
// The provided event is in the receiver's coordinate system.
@@ -1028,14 +1032,14 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Input ---------------------------------------------------------------------
- // 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.
+ // Called by HitTestRect 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.
+ // Called by HitTestRect to retrieve a mask for hit-testing against.
+ // Subclasses override to provide custom shaped hit test regions.
virtual void GetHitTestMask(gfx::Path* mask) const;
// Focus ---------------------------------------------------------------------
« no previous file with comments | « ui/views/controls/link.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698