OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/input_router_config_helper.h" | 5 #include "content/browser/renderer_host/input/input_router_config_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
9 #include "ui/events/gesture_detection/gesture_detector.h" | 9 #include "ui/events/gesture_detection/gesture_detector.h" |
10 | 10 |
11 #if defined(USE_AURA) | 11 #if defined(USE_AURA) |
12 #include "ui/events/gestures/gesture_configuration.h" | 12 #include "ui/events/gestures/gesture_configuration.h" |
13 #elif defined(OS_ANDROID) | 13 #elif defined(OS_ANDROID) |
14 #include "ui/gfx/android/view_configuration.h" | 14 #include "ui/gfx/android/view_configuration.h" |
15 #include "ui/gfx/screen.h" | 15 #include "ui/gfx/screen.h" |
16 #endif | 16 #endif |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 namespace { | 19 namespace { |
20 | 20 |
21 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
22 | 22 |
23 GestureEventQueue::Config GetGestureEventQueueConfig() { | 23 GestureEventQueue::Config GetGestureEventQueueConfig() { |
24 GestureEventQueue::Config config; | 24 GestureEventQueue::Config config; |
25 | 25 |
26 #if defined(OS_CHROMEOS) | 26 config.debounce_interval = base::TimeDelta::FromMilliseconds( |
27 // Default debouncing interval duration on ChromeOS: if a scroll is in | 27 ui::GestureConfiguration::scroll_debounce_interval_in_ms()); |
28 // progress, non-scroll events during this interval are deferred to either its | |
29 // end or discarded on receipt of another GestureScrollUpdate. | |
30 // TODO(jdduke): Disable and remove entirely when issues with spurious | |
31 // scroll end detection on the Pixel are resolved, crbug.com/353702. | |
32 const int kDebouncingIntervalTimeMs = 30; | |
33 config.debounce_interval = | |
34 base::TimeDelta::FromMilliseconds(kDebouncingIntervalTimeMs); | |
35 #endif | |
36 | 28 |
37 config.touchscreen_tap_suppression_config.enabled = true; | 29 config.touchscreen_tap_suppression_config.enabled = true; |
38 config.touchscreen_tap_suppression_config.max_cancel_to_down_time = | 30 config.touchscreen_tap_suppression_config.max_cancel_to_down_time = |
39 base::TimeDelta::FromMilliseconds( | 31 base::TimeDelta::FromMilliseconds( |
40 ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms()); | 32 ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms()); |
41 | 33 |
42 config.touchscreen_tap_suppression_config.max_tap_gap_time = | 34 config.touchscreen_tap_suppression_config.max_tap_gap_time = |
43 base::TimeDelta::FromMilliseconds(static_cast<int>( | 35 base::TimeDelta::FromMilliseconds(static_cast<int>( |
44 ui::GestureConfiguration::semi_long_press_time_in_seconds() * 1000)); | 36 ui::GestureConfiguration::semi_long_press_time_in_seconds() * 1000)); |
45 | 37 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 129 |
138 InputRouterImpl::Config GetInputRouterConfigForPlatform() { | 130 InputRouterImpl::Config GetInputRouterConfigForPlatform() { |
139 InputRouterImpl::Config config; | 131 InputRouterImpl::Config config; |
140 config.gesture_config = GetGestureEventQueueConfig(); | 132 config.gesture_config = GetGestureEventQueueConfig(); |
141 config.touch_config = GetTouchEventQueueConfig(); | 133 config.touch_config = GetTouchEventQueueConfig(); |
142 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); | 134 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); |
143 return config; | 135 return config; |
144 } | 136 } |
145 | 137 |
146 } // namespace content | 138 } // namespace content |
OLD | NEW |