Index: content/browser/renderer_host/input/touch_action_filter.cc |
diff --git a/content/browser/renderer_host/input/touch_action_filter.cc b/content/browser/renderer_host/input/touch_action_filter.cc |
index 14e84229faf57abec6ef384a58fad69c162fef1e..eea8082cf90a8e9357d79ed71d983fd5d08256c1 100644 |
--- a/content/browser/renderer_host/input/touch_action_filter.cc |
+++ b/content/browser/renderer_host/input/touch_action_filter.cc |
@@ -17,6 +17,7 @@ namespace content { |
TouchActionFilter::TouchActionFilter() : |
drop_scroll_gesture_events_(false), |
drop_pinch_gesture_events_(false), |
+ drop_current_tap_ending_event_(false), |
allowed_touch_action_(TOUCH_ACTION_AUTO) { |
} |
@@ -80,6 +81,33 @@ bool TouchActionFilter::FilterGestureEvent(WebGestureEvent* gesture_event) { |
DCHECK(!drop_scroll_gesture_events_); |
break; |
+ // The double tap gesture is a tap ending event. If a double tap gesture is |
+ // filtered out, replace it with a tap cancel. |
+ case WebInputEvent::GestureDoubleTap: |
+ if (allowed_touch_action_ != TOUCH_ACTION_AUTO) |
+ gesture_event->type = WebInputEvent::GestureTapCancel; |
+ break; |
+ |
+ // If double tap is disabled, there's no reason for the tap delay. |
+ case WebInputEvent::GestureTapUnconfirmed: |
+ if (allowed_touch_action_ != TOUCH_ACTION_AUTO) { |
+ gesture_event->type = WebInputEvent::GestureTap; |
+ drop_current_tap_ending_event_ = true; |
+ } |
+ break; |
+ |
+ case WebInputEvent::GestureTap: |
+ case WebInputEvent::GestureTapCancel: |
+ if (drop_current_tap_ending_event_) { |
+ drop_current_tap_ending_event_ = false; |
+ return true; |
+ } |
+ break; |
+ |
+ case WebInputEvent::GestureTapDown: |
+ DCHECK(!drop_current_tap_ending_event_); |
+ break; |
+ |
default: |
// Gesture events unrelated to touch actions (panning/zooming) are left |
// alone. |