| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro
ller.h" | 5 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro
ller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/renderer_host/input/gesture_event_queue.h" | 9 #include "content/browser/renderer_host/input/gesture_event_queue.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 controller_.GestureFlingCancel(); | 24 controller_.GestureFlingCancel(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void TouchscreenTapSuppressionController::GestureFlingCancelAck( | 27 void TouchscreenTapSuppressionController::GestureFlingCancelAck( |
| 28 bool processed) { | 28 bool processed) { |
| 29 controller_.GestureFlingCancelAck(processed); | 29 controller_.GestureFlingCancelAck(processed); |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool TouchscreenTapSuppressionController::FilterTapEvent( | 32 bool TouchscreenTapSuppressionController::FilterTapEvent( |
| 33 const GestureEventWithLatencyInfo& event) { | 33 const GestureEventWithLatencyInfo& event) { |
| 34 switch (event.event.type) { | 34 switch (event.event.type()) { |
| 35 case WebInputEvent::GestureTapDown: | 35 case WebInputEvent::GestureTapDown: |
| 36 if (!controller_.ShouldDeferTapDown()) | 36 if (!controller_.ShouldDeferTapDown()) |
| 37 return false; | 37 return false; |
| 38 stashed_tap_down_.reset(new GestureEventWithLatencyInfo(event)); | 38 stashed_tap_down_.reset(new GestureEventWithLatencyInfo(event)); |
| 39 return true; | 39 return true; |
| 40 | 40 |
| 41 case WebInputEvent::GestureShowPress: | 41 case WebInputEvent::GestureShowPress: |
| 42 if (!stashed_tap_down_) | 42 if (!stashed_tap_down_) |
| 43 return false; | 43 return false; |
| 44 stashed_show_press_.reset(new GestureEventWithLatencyInfo(event)); | 44 stashed_show_press_.reset(new GestureEventWithLatencyInfo(event)); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 void TouchscreenTapSuppressionController::ForwardStashedTapDown() { | 91 void TouchscreenTapSuppressionController::ForwardStashedTapDown() { |
| 92 DCHECK(stashed_tap_down_); | 92 DCHECK(stashed_tap_down_); |
| 93 ScopedGestureEvent tap_down = std::move(stashed_tap_down_); | 93 ScopedGestureEvent tap_down = std::move(stashed_tap_down_); |
| 94 gesture_event_queue_->ForwardGestureEvent(*tap_down); | 94 gesture_event_queue_->ForwardGestureEvent(*tap_down); |
| 95 stashed_show_press_.reset(); | 95 stashed_show_press_.reset(); |
| 96 stashed_long_press_.reset(); | 96 stashed_long_press_.reset(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace content | 99 } // namespace content |
| OLD | NEW |