| Index: content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
|
| diff --git a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
|
| index a5ffc019ad91b39128190cafc9384d7c20fce670..45d52128ee86a6db2ecc9bedf03ba0428c3680e0 100644
|
| --- a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
|
| +++ b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
|
| @@ -44,12 +44,24 @@ bool TouchscreenTapSuppressionController::FilterTapEvent(
|
| stashed_show_press_.reset(new GestureEventWithLatencyInfo(event));
|
| return true;
|
|
|
| + case WebInputEvent::GestureLongPress:
|
| + // It is possible that a GestureLongPress arrives after tapDownTimer
|
| + // expiration, in this case it should still get filtered if the
|
| + // controller suppresses the tap end events.
|
| + if (!stashed_tap_down_)
|
| + return controller_.ShouldSuppressTapEnd();
|
| +
|
| + stashed_long_press_.reset(new GestureEventWithLatencyInfo(event));
|
| + return true;
|
| +
|
| case WebInputEvent::GestureTapUnconfirmed:
|
| return !!stashed_tap_down_;
|
|
|
| case WebInputEvent::GestureTapCancel:
|
| case WebInputEvent::GestureTap:
|
| case WebInputEvent::GestureDoubleTap:
|
| + case WebInputEvent::GestureLongTap:
|
| + case WebInputEvent::GestureTwoFingerTap:
|
| return controller_.ShouldSuppressTapEnd();
|
|
|
| default:
|
| @@ -61,15 +73,27 @@ bool TouchscreenTapSuppressionController::FilterTapEvent(
|
| void TouchscreenTapSuppressionController::DropStashedTapDown() {
|
| stashed_tap_down_.reset();
|
| stashed_show_press_.reset();
|
| + stashed_long_press_.reset();
|
| }
|
|
|
| -void TouchscreenTapSuppressionController::ForwardStashedTapDown() {
|
| +void TouchscreenTapSuppressionController::ForwardStashedGestureEvents() {
|
| DCHECK(stashed_tap_down_);
|
| ScopedGestureEvent tap_down = std::move(stashed_tap_down_);
|
| ScopedGestureEvent show_press = std::move(stashed_show_press_);
|
| + ScopedGestureEvent long_press = std::move(stashed_long_press_);
|
| gesture_event_queue_->ForwardGestureEvent(*tap_down);
|
| if (show_press)
|
| gesture_event_queue_->ForwardGestureEvent(*show_press);
|
| + if (long_press)
|
| + gesture_event_queue_->ForwardGestureEvent(*long_press);
|
| +}
|
| +
|
| +void TouchscreenTapSuppressionController::ForwardStashedTapDown() {
|
| + DCHECK(stashed_tap_down_);
|
| + ScopedGestureEvent tap_down = std::move(stashed_tap_down_);
|
| + gesture_event_queue_->ForwardGestureEvent(*tap_down);
|
| + stashed_show_press_.reset();
|
| + stashed_long_press_.reset();
|
| }
|
|
|
| } // namespace content
|
|
|