Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc

Issue 235003005: Consolidate all touch/gesture related constants in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compilation fixes Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
diff --git a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
index 7f024b3e3694fd8bbbcd8f82791a45eb9a090d42..872cfb05b6b914c66e95362dec9aa8d593e8c420 100644
--- a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
+++ b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc
@@ -5,39 +5,33 @@
#include "content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h"
#include "content/browser/renderer_host/input/gesture_event_queue.h"
-#include "content/browser/renderer_host/input/tap_suppression_controller.h"
-#include "ui/events/gestures/gesture_configuration.h"
-
-#if defined(OS_ANDROID)
-#include "ui/gfx/android/view_configuration.h"
-#endif
using blink::WebInputEvent;
namespace content {
TouchscreenTapSuppressionController::TouchscreenTapSuppressionController(
- GestureEventQueue* geq)
- : gesture_event_queue_(geq),
- controller_(new TapSuppressionController(this)) {
+ GestureEventQueue* geq,
+ const TapSuppressionController::Config& config)
+ : gesture_event_queue_(geq), controller_(this, config) {
}
TouchscreenTapSuppressionController::~TouchscreenTapSuppressionController() {}
void TouchscreenTapSuppressionController::GestureFlingCancel() {
- controller_->GestureFlingCancel();
+ controller_.GestureFlingCancel();
}
void TouchscreenTapSuppressionController::GestureFlingCancelAck(
bool processed) {
- controller_->GestureFlingCancelAck(processed);
+ controller_.GestureFlingCancelAck(processed);
}
bool TouchscreenTapSuppressionController::FilterTapEvent(
const GestureEventWithLatencyInfo& event) {
switch (event.event.type) {
case WebInputEvent::GestureTapDown:
- if (!controller_->ShouldDeferTapDown())
+ if (!controller_.ShouldDeferTapDown())
return false;
stashed_tap_down_.reset(new GestureEventWithLatencyInfo(event));
return true;
@@ -54,7 +48,7 @@ bool TouchscreenTapSuppressionController::FilterTapEvent(
case WebInputEvent::GestureTapCancel:
case WebInputEvent::GestureTap:
case WebInputEvent::GestureDoubleTap:
- return controller_->ShouldSuppressTapEnd();
+ return controller_.ShouldSuppressTapEnd();
default:
break;
@@ -62,27 +56,6 @@ bool TouchscreenTapSuppressionController::FilterTapEvent(
return false;
}
-#if defined(OS_ANDROID)
-// TODO(jdduke): Enable ui::GestureConfiguration on Android and initialize
-// with parameters from ViewConfiguration.
-int TouchscreenTapSuppressionController::MaxCancelToDownTimeInMs() {
- return gfx::ViewConfiguration::GetTapTimeoutInMs();
-}
-
-int TouchscreenTapSuppressionController::MaxTapGapTimeInMs() {
- return gfx::ViewConfiguration::GetLongPressTimeoutInMs();
-}
-#else
-int TouchscreenTapSuppressionController::MaxCancelToDownTimeInMs() {
- return ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms();
-}
-
-int TouchscreenTapSuppressionController::MaxTapGapTimeInMs() {
- return static_cast<int>(
- ui::GestureConfiguration::semi_long_press_time_in_seconds() * 1000);
-}
-#endif
-
void TouchscreenTapSuppressionController::DropStashedTapDown() {
stashed_tap_down_.reset();
stashed_show_press_.reset();

Powered by Google App Engine
This is Rietveld 408576698