Index: ui/views/view.h |
diff --git a/ui/views/view.h b/ui/views/view.h |
index d6158534bfde399184b68eb10278b4aba6af363e..f27216bdaedd9d0c3198ad65640a1893acab5948 100644 |
--- a/ui/views/view.h |
+++ b/ui/views/view.h |
@@ -970,6 +970,16 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
virtual int GetLineScrollIncrement(ScrollView* scroll_view, |
bool is_horizontal, bool is_positive); |
+ // Specifies the source of the region used in a hit test. |
+ // HIT_TEST_SOURCE_MOUSE indicates the hit test is being performed with a |
+ // single point and HIT_TEST_SOURCE_TOUCH indicates the hit test is being |
+ // performed with a rect larger than a single point. This value can be used, |
+ // for example, to add extra padding or change the shape of the hit test mask. |
+ enum HitTestSource { |
tdanderson
2013/10/24 20:56:24
Is there a better place for this enum? I needed to
sky
2013/10/24 22:13:38
I think this is the best place, but move it above
tdanderson
2013/10/25 00:10:52
Done. And yes, as far as I know this is all we nee
|
+ HIT_TEST_SOURCE_MOUSE, |
+ HIT_TEST_SOURCE_TOUCH |
+ }; |
+ |
protected: |
// Used to track a drag. RootView passes this into |
// ProcessMousePressed/Dragged. |
@@ -1126,7 +1136,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
// 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; |
+ virtual void GetHitTestMask(gfx::Path* mask, |
+ HitTestSource source = HIT_TEST_SOURCE_MOUSE) const; |
virtual DragInfo* GetDragInfo(); |