This source file includes following definitions.
- controller_
- GestureFlingCancel
- GestureFlingCancelAck
- ShouldDeferMouseDown
- ShouldSuppressMouseUp
- MaxCancelToDownTimeInMs
- MaxTapGapTimeInMs
- DropStashedTapDown
- ForwardStashedTapDown
#include "content/browser/renderer_host/input/touchpad_tap_suppression_controller.h"
#include "content/browser/renderer_host/input/tap_suppression_controller.h"
#include "content/browser/renderer_host/input/tap_suppression_controller_client.h"
#include "ui/events/gestures/gesture_configuration.h"
namespace content {
TouchpadTapSuppressionController::TouchpadTapSuppressionController(
TouchpadTapSuppressionControllerClient* client)
: client_(client),
controller_(new TapSuppressionController(this)) {
}
TouchpadTapSuppressionController::~TouchpadTapSuppressionController() {}
void TouchpadTapSuppressionController::GestureFlingCancel() {
controller_->GestureFlingCancel();
}
void TouchpadTapSuppressionController::GestureFlingCancelAck(bool processed) {
controller_->GestureFlingCancelAck(processed);
}
bool TouchpadTapSuppressionController::ShouldDeferMouseDown(
const MouseEventWithLatencyInfo& event) {
bool should_defer = controller_->ShouldDeferTapDown();
if (should_defer)
stashed_mouse_down_ = event;
return should_defer;
}
bool TouchpadTapSuppressionController::ShouldSuppressMouseUp() {
return controller_->ShouldSuppressTapEnd();
}
int TouchpadTapSuppressionController::MaxCancelToDownTimeInMs() {
return ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms();
}
int TouchpadTapSuppressionController::MaxTapGapTimeInMs() {
return ui::GestureConfiguration::fling_max_tap_gap_time_in_ms();
}
void TouchpadTapSuppressionController::DropStashedTapDown() {
}
void TouchpadTapSuppressionController::ForwardStashedTapDown() {
client_->SendMouseEventImmediately(stashed_mouse_down_);
}
}