Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / renderer_host / input / touchpad_tap_suppression_controller.cc
blobd3097420d1676d1c5137f2642aef754487278efc
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
3 // found in the LICENSE file.
5 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controller.h"
7 namespace content {
9 TouchpadTapSuppressionController::TouchpadTapSuppressionController(
10 TouchpadTapSuppressionControllerClient* client,
11 const TapSuppressionController::Config& config)
12 : client_(client), controller_(this, config) {
15 TouchpadTapSuppressionController::~TouchpadTapSuppressionController() {}
17 void TouchpadTapSuppressionController::GestureFlingCancel() {
18 controller_.GestureFlingCancel();
21 void TouchpadTapSuppressionController::GestureFlingCancelAck(bool processed) {
22 controller_.GestureFlingCancelAck(processed);
25 bool TouchpadTapSuppressionController::ShouldDeferMouseDown(
26 const MouseEventWithLatencyInfo& event) {
27 bool should_defer = controller_.ShouldDeferTapDown();
28 if (should_defer)
29 stashed_mouse_down_ = event;
30 return should_defer;
33 bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() {
34 return controller_.ShouldSuppressTapEnd();
37 void TouchpadTapSuppressionController::DropStashedTapDown() {
40 void TouchpadTapSuppressionController::ForwardStashedTapDown() {
41 // Mouse downs are not handled by gesture event filter; so, they are
42 // immediately forwarded to the renderer.
43 client_->SendMouseEventImmediately(stashed_mouse_down_);
46 } // namespace content