| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/touchpad_tap_suppression_controller.h" | 5 #include "content/browser/renderer_host/touchpad_tap_suppression_controller.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 8 #include "content/browser/renderer_host/tap_suppression_controller.h" | 8 #include "content/browser/renderer_host/tap_suppression_controller.h" |
| 9 #include "content/browser/renderer_host/tap_suppression_controller_client.h" | 9 #include "content/browser/renderer_host/tap_suppression_controller_client.h" |
| 10 #include "ui/base/gestures/gesture_configuration.h" | 10 #include "ui/base/gestures/gesture_configuration.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 void TouchpadTapSuppressionController::GestureFlingCancel() { | 22 void TouchpadTapSuppressionController::GestureFlingCancel() { |
| 23 controller_->GestureFlingCancel(); | 23 controller_->GestureFlingCancel(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void TouchpadTapSuppressionController::GestureFlingCancelAck(bool processed) { | 26 void TouchpadTapSuppressionController::GestureFlingCancelAck(bool processed) { |
| 27 controller_->GestureFlingCancelAck(processed); | 27 controller_->GestureFlingCancelAck(processed); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool TouchpadTapSuppressionController::ShouldDeferMouseDown( | 30 bool TouchpadTapSuppressionController::ShouldDeferMouseDown( |
| 31 const WebKit::WebMouseEvent& event) { | 31 const WebKit::WebMouseEvent& event, |
| 32 const cc::LatencyInfo& latency_info) { |
| 32 bool should_defer = controller_->ShouldDeferTapDown(); | 33 bool should_defer = controller_->ShouldDeferTapDown(); |
| 33 if (should_defer) | 34 if (should_defer) { |
| 34 stashed_mouse_down_ = event; | 35 stashed_mouse_down_ = event; |
| 36 stashed_latency_info_ = latency_info; |
| 37 } |
| 35 return should_defer; | 38 return should_defer; |
| 36 } | 39 } |
| 37 | 40 |
| 38 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() { | 41 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() { |
| 39 return controller_->ShouldSuppressTapUp(); | 42 return controller_->ShouldSuppressTapUp(); |
| 40 } | 43 } |
| 41 | 44 |
| 42 int TouchpadTapSuppressionController::MaxCancelToDownTimeInMs() { | 45 int TouchpadTapSuppressionController::MaxCancelToDownTimeInMs() { |
| 43 return ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms(); | 46 return ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms(); |
| 44 } | 47 } |
| 45 | 48 |
| 46 int TouchpadTapSuppressionController::MaxTapGapTimeInMs() { | 49 int TouchpadTapSuppressionController::MaxTapGapTimeInMs() { |
| 47 return ui::GestureConfiguration::fling_max_tap_gap_time_in_ms(); | 50 return ui::GestureConfiguration::fling_max_tap_gap_time_in_ms(); |
| 48 } | 51 } |
| 49 | 52 |
| 50 void TouchpadTapSuppressionController::DropStashedTapDown() { | 53 void TouchpadTapSuppressionController::DropStashedTapDown() { |
| 51 } | 54 } |
| 52 | 55 |
| 53 void TouchpadTapSuppressionController::ForwardStashedTapDownForDeferral() { | 56 void TouchpadTapSuppressionController::ForwardStashedTapDownForDeferral() { |
| 54 // Mouse downs are not handled by gesture event filter; so, they are | 57 // Mouse downs are not handled by gesture event filter; so, they are |
| 55 // immediately forwarded to the renderer. | 58 // immediately forwarded to the renderer. |
| 56 render_widget_host_->ForwardMouseEventImmediately(stashed_mouse_down_); | 59 render_widget_host_->ForwardMouseEventImmediately(stashed_mouse_down_, |
| 60 stashed_latency_info_); |
| 57 } | 61 } |
| 58 | 62 |
| 59 void TouchpadTapSuppressionController::ForwardStashedTapDownSkipDeferral() { | 63 void TouchpadTapSuppressionController::ForwardStashedTapDownSkipDeferral() { |
| 60 // Mouse downs are not handled by gesture event filter; so, they are | 64 // Mouse downs are not handled by gesture event filter; so, they are |
| 61 // immediately forwarded to the renderer. | 65 // immediately forwarded to the renderer. |
| 62 render_widget_host_->ForwardMouseEventImmediately(stashed_mouse_down_); | 66 render_widget_host_->ForwardMouseEventImmediately(stashed_mouse_down_, |
| 67 stashed_latency_info_); |
| 63 } | 68 } |
| 64 | 69 |
| 65 } // namespace content | 70 } // namespace content |
| OLD | NEW |