Chromium Code Reviews| 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..75253060ea00e101bc61152f489770c8f5c26144 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,37 @@ bool TouchActionFilter::FilterGestureEvent(WebGestureEvent* gesture_event) { |
| DCHECK(!drop_scroll_gesture_events_); |
| 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: |
| + if (drop_current_tap_ending_event_) { |
| + drop_current_tap_ending_event_ = false; |
| + return true; |
| + } |
| + break; |
| + |
| + case WebInputEvent::GestureTapCancel: |
|
Rick Byers
2014/02/18 20:40:16
maybe combine this case with the above into a sing
tdresser
2014/02/18 21:27:15
Done.
|
| + 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; |
| + |
| + case WebInputEvent::GestureDoubleTap: |
| + if (allowed_touch_action_ != TOUCH_ACTION_AUTO) |
| + return true; |
| + break; |
| + |
| default: |
| // Gesture events unrelated to touch actions (panning/zooming) are left |
| // alone. |