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 7552733ec06fe34345e50c09ff3d449e2bd6759b..cbf5921ffaed3ef7e550f0bba16c6ee57ee298df 100644 |
--- a/ui/events/gesture_detection/gesture_detector.h |
+++ b/ui/events/gesture_detection/gesture_detector.h |
@@ -69,7 +69,7 @@ class GestureDetector { |
virtual ~GestureListener() {} |
virtual bool OnDown(const MotionEvent& e) = 0; |
virtual void OnShowPress(const MotionEvent& e) = 0; |
- virtual bool OnSingleTapUp(const MotionEvent& e) = 0; |
+ virtual bool OnSingleTapUp(const MotionEvent& e, int tap_count) = 0; |
virtual bool OnLongPress(const MotionEvent& e) = 0; |
virtual bool OnScroll(const MotionEvent& e1, |
const MotionEvent& e2, |
@@ -91,7 +91,7 @@ class GestureDetector { |
class DoubleTapListener { |
public: |
virtual ~DoubleTapListener() {} |
- virtual bool OnSingleTapConfirmed(const MotionEvent& e) = 0; |
+ virtual bool OnSingleTapConfirmed(const MotionEvent& e, int tap_count) = 0; |
virtual bool OnDoubleTap(const MotionEvent& e) = 0; |
virtual bool OnDoubleTapEvent(const MotionEvent& e) = 0; |
}; |
@@ -106,7 +106,7 @@ class GestureDetector { |
// GestureListener implementation. |
virtual bool OnDown(const MotionEvent& e) OVERRIDE; |
virtual void OnShowPress(const MotionEvent& e) OVERRIDE; |
- virtual bool OnSingleTapUp(const MotionEvent& e) OVERRIDE; |
+ virtual bool OnSingleTapUp(const MotionEvent& e, int tap_count) OVERRIDE; |
virtual bool OnLongPress(const MotionEvent& e) OVERRIDE; |
virtual bool OnScroll(const MotionEvent& e1, |
const MotionEvent& e2, |
@@ -124,7 +124,8 @@ class GestureDetector { |
const MotionEvent& e2) OVERRIDE; |
// DoubleTapListener implementation. |
- virtual bool OnSingleTapConfirmed(const MotionEvent& e) OVERRIDE; |
+ virtual bool OnSingleTapConfirmed(const MotionEvent& e, |
+ int tap_count) OVERRIDE; |
virtual bool OnDoubleTap(const MotionEvent& e) OVERRIDE; |
virtual bool OnDoubleTapEvent(const MotionEvent& e) OVERRIDE; |
}; |
@@ -182,6 +183,7 @@ class GestureDetector { |
bool two_finger_tap_allowed_for_gesture_; |
scoped_ptr<MotionEvent> current_down_event_; |
+ scoped_ptr<MotionEvent> previous_down_event_; |
scoped_ptr<MotionEvent> previous_up_event_; |
scoped_ptr<MotionEvent> secondary_pointer_down_event_; |
@@ -198,6 +200,10 @@ class GestureDetector { |
bool swipe_enabled_; |
bool two_finger_tap_enabled_; |
+ // If the double tap gesture is disabled, this counts the number of successive |
+ // taps which occured within the double tap window. The current maximum is 3. |
+ int tap_count_; |
+ |
// Determines speed during touch scrolling. |
VelocityTrackerState velocity_tracker_; |