Chromium Code Reviews| Index: ui/events/gesture_detection/gesture_detector.h |
| diff --git a/ui/events/gesture_detection/gesture_detector.h b/ui/events/gesture_detection/gesture_detector.h |
| index db665f8cbcd84a1b95ceed6b93bba050ecaf16ed..ac077c4067d326fcb63977f21c695380deeaa16a 100644 |
| --- a/ui/events/gesture_detection/gesture_detector.h |
| +++ b/ui/events/gesture_detection/gesture_detector.h |
| @@ -72,8 +72,11 @@ class GestureDetector { |
| public: |
| virtual ~GestureListener() {} |
| virtual bool OnDown(const MotionEvent& e) = 0; |
| - virtual void OnShowPress(const MotionEvent& e) = 0; |
| - virtual bool OnSingleTapUp(const MotionEvent& e) = 0; |
| + virtual void OnShowPress(const MotionEvent& e, float max_radius) = 0; |
| + virtual bool OnSingleTapUp(const MotionEvent& e, |
|
jdduke (slow)
2014/09/04 15:01:25
These callbacks variations are rather unfortunate,
|
| + float x, |
| + float y, |
| + float max_radius) = 0; |
| virtual void OnLongPress(const MotionEvent& e) = 0; |
| virtual bool OnScroll(const MotionEvent& e1, |
| const MotionEvent& e2, |
| @@ -95,7 +98,10 @@ class GestureDetector { |
| class DoubleTapListener { |
| public: |
| virtual ~DoubleTapListener() {} |
| - virtual bool OnSingleTapConfirmed(const MotionEvent& e) = 0; |
| + virtual bool OnSingleTapConfirmed(const MotionEvent& e, |
| + float x, |
| + float y, |
| + float max_radius) = 0; |
| virtual bool OnDoubleTap(const MotionEvent& e) = 0; |
| virtual bool OnDoubleTapEvent(const MotionEvent& e) = 0; |
| }; |
| @@ -109,8 +115,11 @@ class GestureDetector { |
| public: |
| // GestureListener implementation. |
| virtual bool OnDown(const MotionEvent& e) OVERRIDE; |
| - virtual void OnShowPress(const MotionEvent& e) OVERRIDE; |
| - virtual bool OnSingleTapUp(const MotionEvent& e) OVERRIDE; |
| + virtual void OnShowPress(const MotionEvent& e, float max_radius) OVERRIDE; |
| + virtual bool OnSingleTapUp(const MotionEvent& e, |
| + float x, |
| + float y, |
| + float max_radius) OVERRIDE; |
| virtual void OnLongPress(const MotionEvent& e) OVERRIDE; |
| virtual bool OnScroll(const MotionEvent& e1, |
| const MotionEvent& e2, |
| @@ -128,7 +137,10 @@ class GestureDetector { |
| const MotionEvent& e2) OVERRIDE; |
| // DoubleTapListener implementation. |
| - virtual bool OnSingleTapConfirmed(const MotionEvent& e) OVERRIDE; |
| + virtual bool OnSingleTapConfirmed(const MotionEvent& e, |
| + float x, |
| + float y, |
| + float max_radius) OVERRIDE; |
| virtual bool OnDoubleTap(const MotionEvent& e) OVERRIDE; |
| virtual bool OnDoubleTapEvent(const MotionEvent& e) OVERRIDE; |
| }; |
| @@ -190,6 +202,10 @@ class GestureDetector { |
| scoped_ptr<MotionEvent> previous_up_event_; |
| scoped_ptr<MotionEvent> secondary_pointer_down_event_; |
| + // The maximum diameter of the finger touches before show press gesture is |
| + // sent. |
|
tdresser
2014/09/04 13:54:00
Perhaps:
// The maximum touch diameter before the
lanwei
2014/09/05 20:40:36
Done.
|
| + float max_touch_diameter_; |
|
tdresser
2014/09/04 13:54:00
Perhaps |max_diameter_before_show_press_|.
It's a
lanwei
2014/09/05 20:40:36
Done.
|
| + |
| // True when the user is still touching for the second tap (down, move, and |
| // up events). Can only be true if there is a double tap listener attached. |
| bool is_double_tapping_; |