| 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 |
| 7 namespace content { | 13 namespace content { |
| 8 | 14 |
| 9 TouchpadTapSuppressionController::TouchpadTapSuppressionController( | 15 TouchpadTapSuppressionController::TouchpadTapSuppressionController( |
| 10 TouchpadTapSuppressionControllerClient* client, | 16 TouchpadTapSuppressionControllerClient* /* client */) |
| 11 const TapSuppressionController::Config& config) | 17 : client_(NULL) {} |
| 12 : client_(client), controller_(this, config) {} | |
| 13 | 18 |
| 14 TouchpadTapSuppressionController::~TouchpadTapSuppressionController() {} | 19 TouchpadTapSuppressionController::~TouchpadTapSuppressionController() {} |
| 15 | 20 |
| 16 void TouchpadTapSuppressionController::GestureFlingCancel() { | 21 void TouchpadTapSuppressionController::GestureFlingCancel() {} |
| 17 controller_.GestureFlingCancel(); | |
| 18 } | |
| 19 | 22 |
| 20 void TouchpadTapSuppressionController::GestureFlingCancelAck(bool processed) { | 23 void TouchpadTapSuppressionController::GestureFlingCancelAck( |
| 21 controller_.GestureFlingCancelAck(processed); | 24 bool /*processed*/) { |
| 22 } | 25 } |
| 23 | 26 |
| 24 bool TouchpadTapSuppressionController::ShouldDeferMouseDown( | 27 bool TouchpadTapSuppressionController::ShouldDeferMouseDown( |
| 25 const MouseEventWithLatencyInfo& event) { | 28 const MouseEventWithLatencyInfo& /*event*/) { |
| 26 bool should_defer = controller_.ShouldDeferTapDown(); | 29 return false; |
| 27 if (should_defer) | |
| 28 stashed_mouse_down_ = event; | |
| 29 return should_defer; | |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() { | 32 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() { return false; } |
| 33 return controller_.ShouldSuppressTapEnd(); | 33 |
| 34 int TouchpadTapSuppressionController::MaxCancelToDownTimeInMs() { |
| 35 return 0; |
| 36 } |
| 37 |
| 38 int TouchpadTapSuppressionController::MaxTapGapTimeInMs() { |
| 39 return 0; |
| 34 } | 40 } |
| 35 | 41 |
| 36 void TouchpadTapSuppressionController::DropStashedTapDown() { | 42 void TouchpadTapSuppressionController::DropStashedTapDown() { |
| 37 } | 43 } |
| 38 | 44 |
| 39 void TouchpadTapSuppressionController::ForwardStashedTapDown() { | 45 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_); | |
| 43 } | 46 } |
| 44 | 47 |
| 45 } // namespace content | 48 } // namespace content |
| OLD | NEW |