| Index: content/browser/renderer_host/input/input_router_config_helper.cc
|
| diff --git a/content/browser/renderer_host/input/input_router_config_helper.cc b/content/browser/renderer_host/input/input_router_config_helper.cc
|
| index d3b229639d4caea9b67d13d6a56e45ff79a8ca30..24a4354a60f2a2cc1208e448f63433e964c6e6d7 100644
|
| --- a/content/browser/renderer_host/input/input_router_config_helper.cc
|
| +++ b/content/browser/renderer_host/input/input_router_config_helper.cc
|
| @@ -6,21 +6,36 @@
|
|
|
| #include "base/command_line.h"
|
| #include "content/public/common/content_switches.h"
|
| -#include "ui/events/gesture_detection/gesture_detector.h"
|
| -
|
| -#if defined(USE_AURA)
|
| #include "ui/events/gesture_detection/gesture_configuration.h"
|
| -#elif defined(OS_ANDROID)
|
| -#include "ui/gfx/android/view_configuration.h"
|
| -#include "ui/gfx/screen.h"
|
| -#endif
|
| +#include "ui/events/gesture_detection/gesture_detector.h"
|
|
|
| namespace content {
|
| namespace {
|
|
|
| -#if defined(USE_AURA)
|
| -// TODO(jdduke): Consolidate router configuration paths using
|
| -// ui::GestureConfiguration.
|
| +// Default time allowance for the touch ack delay before the touch sequence is
|
| +// cancelled, depending on whether the site has a mobile-friendly viewport.
|
| +// Note that these constants are effective only when the timeout is supported.
|
| +const int kDesktopTouchAckTimeoutDelayMs = 200;
|
| +const int kMobileTouchAckTimeoutDelayMs = 1000;
|
| +
|
| +TouchEventQueue::Config GetTouchEventQueueConfig() {
|
| + TouchEventQueue::Config config;
|
| +
|
| + config.desktop_touch_ack_timeout_delay =
|
| + base::TimeDelta::FromMilliseconds(kDesktopTouchAckTimeoutDelayMs);
|
| + config.mobile_touch_ack_timeout_delay =
|
| + base::TimeDelta::FromMilliseconds(kMobileTouchAckTimeoutDelayMs);
|
| +
|
| +#if defined(OS_ANDROID)
|
| + // For historical reasons only Android enables the touch ack timeout.
|
| + config.touch_ack_timeout_supported = true;
|
| +#else
|
| + config.touch_ack_timeout_supported = false;
|
| +#endif
|
| +
|
| + return config;
|
| +}
|
| +
|
| GestureEventQueue::Config GetGestureEventQueueConfig() {
|
| GestureEventQueue::Config config;
|
| ui::GestureConfiguration* gesture_config =
|
| @@ -28,20 +43,20 @@ GestureEventQueue::Config GetGestureEventQueueConfig() {
|
| config.debounce_interval = base::TimeDelta::FromMilliseconds(
|
| gesture_config->scroll_debounce_interval_in_ms());
|
|
|
| - config.touchscreen_tap_suppression_config.enabled = true;
|
| + config.touchscreen_tap_suppression_config.enabled =
|
| + gesture_config->fling_touchscreen_tap_suppression_enabled();
|
| config.touchscreen_tap_suppression_config.max_cancel_to_down_time =
|
| base::TimeDelta::FromMilliseconds(
|
| gesture_config->fling_max_cancel_to_down_time_in_ms());
|
| -
|
| config.touchscreen_tap_suppression_config.max_tap_gap_time =
|
| base::TimeDelta::FromMilliseconds(
|
| - gesture_config->semi_long_press_time_in_ms());
|
| + gesture_config->long_press_time_in_ms());
|
|
|
| - config.touchpad_tap_suppression_config.enabled = true;
|
| + config.touchpad_tap_suppression_config.enabled =
|
| + gesture_config->fling_touchpad_tap_suppression_enabled();
|
| config.touchpad_tap_suppression_config.max_cancel_to_down_time =
|
| base::TimeDelta::FromMilliseconds(
|
| gesture_config->fling_max_cancel_to_down_time_in_ms());
|
| -
|
| config.touchpad_tap_suppression_config.max_tap_gap_time =
|
| base::TimeDelta::FromMilliseconds(
|
| gesture_config->fling_max_tap_gap_time_in_ms());
|
| @@ -49,55 +64,6 @@ GestureEventQueue::Config GetGestureEventQueueConfig() {
|
| return config;
|
| }
|
|
|
| -TouchEventQueue::Config GetTouchEventQueueConfig() {
|
| - return TouchEventQueue::Config();
|
| -}
|
| -
|
| -#elif defined(OS_ANDROID)
|
| -
|
| -// Default time allowance for the touch ack delay before the touch sequence is
|
| -// cancelled, depending on whether the site has a mobile-friendly viewport.
|
| -const int kDesktopTouchAckTimeoutDelayMs = 200;
|
| -const int kMobileTouchAckTimeoutDelayMs = 1000;
|
| -
|
| -GestureEventQueue::Config GetGestureEventQueueConfig() {
|
| - GestureEventQueue::Config config;
|
| -
|
| - config.touchscreen_tap_suppression_config.enabled = true;
|
| - config.touchscreen_tap_suppression_config.max_cancel_to_down_time =
|
| - base::TimeDelta::FromMilliseconds(
|
| - gfx::ViewConfiguration::GetTapTimeoutInMs());
|
| - config.touchscreen_tap_suppression_config.max_tap_gap_time =
|
| - base::TimeDelta::FromMilliseconds(
|
| - gfx::ViewConfiguration::GetLongPressTimeoutInMs());
|
| -
|
| - return config;
|
| -}
|
| -
|
| -TouchEventQueue::Config GetTouchEventQueueConfig() {
|
| - TouchEventQueue::Config config;
|
| -
|
| - config.desktop_touch_ack_timeout_delay =
|
| - base::TimeDelta::FromMilliseconds(kDesktopTouchAckTimeoutDelayMs);
|
| - config.mobile_touch_ack_timeout_delay =
|
| - base::TimeDelta::FromMilliseconds(kMobileTouchAckTimeoutDelayMs);
|
| - config.touch_ack_timeout_supported = true;
|
| -
|
| - return config;
|
| -}
|
| -
|
| -#else
|
| -
|
| -GestureEventQueue::Config GetGestureEventQueueConfig() {
|
| - return GestureEventQueue::Config();
|
| -}
|
| -
|
| -TouchEventQueue::Config GetTouchEventQueueConfig() {
|
| - return TouchEventQueue::Config();
|
| -}
|
| -
|
| -#endif
|
| -
|
| } // namespace
|
|
|
| InputRouterImpl::Config GetInputRouterConfigForPlatform() {
|
|
|