| 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/touchpad_tap_suppression_controlle
r.h" | 5 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle
r.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/input/tap_suppression_controller.h" | |
| 8 #include "content/browser/renderer_host/input/tap_suppression_controller_client.
h" | |
| 9 | |
| 10 // The default implementation of the TouchpadTapSuppressionController does not | |
| 11 // suppress taps. Touchpad tap suppression is needed only on CrOS. | |
| 12 | |
| 13 namespace content { | 7 namespace content { |
| 14 | 8 |
| 15 TouchpadTapSuppressionController::TouchpadTapSuppressionController( | 9 TouchpadTapSuppressionController::TouchpadTapSuppressionController( |
| 16 TouchpadTapSuppressionControllerClient* /* client */) | 10 TouchpadTapSuppressionControllerClient* client, |
| 17 : client_(NULL) {} | 11 const TapSuppressionController::Config& config) |
| 12 : client_(client), controller_(this, config) {} |
| 18 | 13 |
| 19 TouchpadTapSuppressionController::~TouchpadTapSuppressionController() {} | 14 TouchpadTapSuppressionController::~TouchpadTapSuppressionController() {} |
| 20 | 15 |
| 21 void TouchpadTapSuppressionController::GestureFlingCancel() {} | 16 void TouchpadTapSuppressionController::GestureFlingCancel() { |
| 17 controller_.GestureFlingCancel(); |
| 18 } |
| 22 | 19 |
| 23 void TouchpadTapSuppressionController::GestureFlingCancelAck( | 20 void TouchpadTapSuppressionController::GestureFlingCancelAck(bool processed) { |
| 24 bool /*processed*/) { | 21 controller_.GestureFlingCancelAck(processed); |
| 25 } | 22 } |
| 26 | 23 |
| 27 bool TouchpadTapSuppressionController::ShouldDeferMouseDown( | 24 bool TouchpadTapSuppressionController::ShouldDeferMouseDown( |
| 28 const MouseEventWithLatencyInfo& /*event*/) { | 25 const MouseEventWithLatencyInfo& event) { |
| 29 return false; | 26 bool should_defer = controller_.ShouldDeferTapDown(); |
| 27 if (should_defer) |
| 28 stashed_mouse_down_ = event; |
| 29 return should_defer; |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() { return false; } | 32 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() { |
| 33 | 33 return controller_.ShouldSuppressTapEnd(); |
| 34 int TouchpadTapSuppressionController::MaxCancelToDownTimeInMs() { | |
| 35 return 0; | |
| 36 } | |
| 37 | |
| 38 int TouchpadTapSuppressionController::MaxTapGapTimeInMs() { | |
| 39 return 0; | |
| 40 } | 34 } |
| 41 | 35 |
| 42 void TouchpadTapSuppressionController::DropStashedTapDown() { | 36 void TouchpadTapSuppressionController::DropStashedTapDown() { |
| 43 } | 37 } |
| 44 | 38 |
| 45 void TouchpadTapSuppressionController::ForwardStashedTapDown() { | 39 void TouchpadTapSuppressionController::ForwardStashedTapDown() { |
| 40 // Mouse downs are not handled by gesture event filter; so, they are |
| 41 // immediately forwarded to the renderer. |
| 42 client_->SendMouseEventImmediately(stashed_mouse_down_); |
| 46 } | 43 } |
| 47 | 44 |
| 48 } // namespace content | 45 } // namespace content |
| OLD | NEW |