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 #include "ui/events/gestures/unified_gesture_detector_enabled.h" |
13 #elif defined(OS_ANDROID) | 14 #elif defined(OS_ANDROID) |
14 #include "ui/gfx/android/view_configuration.h" | 15 #include "ui/gfx/android/view_configuration.h" |
15 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
16 #endif | 17 #endif |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 namespace { | 20 namespace { |
20 | 21 |
21 #if defined(USE_AURA) | 22 #if defined(USE_AURA) |
22 | 23 |
(...skipping 22 matching lines...) Expand all Loading... |
45 ui::GestureConfiguration::fling_max_tap_gap_time_in_ms() * 1000)); | 46 ui::GestureConfiguration::fling_max_tap_gap_time_in_ms() * 1000)); |
46 | 47 |
47 return config; | 48 return config; |
48 } | 49 } |
49 | 50 |
50 TouchEventQueue::Config GetTouchEventQueueConfig() { | 51 TouchEventQueue::Config GetTouchEventQueueConfig() { |
51 TouchEventQueue::Config config; | 52 TouchEventQueue::Config config; |
52 | 53 |
53 config.touchmove_slop_suppression_length_dips = | 54 config.touchmove_slop_suppression_length_dips = |
54 ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); | 55 ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); |
55 // TODO(jdduke): Remove when unified GR enabled, crbug.com/332418. | 56 |
56 config.touchmove_slop_suppression_region_includes_boundary = false; | 57 config.touchmove_slop_suppression_region_includes_boundary = |
| 58 ui::IsUnifiedGestureDetectorEnabled(); |
57 | 59 |
58 return config; | 60 return config; |
59 } | 61 } |
60 | 62 |
61 #elif defined(OS_ANDROID) | 63 #elif defined(OS_ANDROID) |
62 | 64 |
63 // Default time allowance for the touch ack delay before the touch sequence is | 65 // Default time allowance for the touch ack delay before the touch sequence is |
64 // cancelled. | 66 // cancelled. |
65 const int kTouchAckTimeoutDelayMs = 200; | 67 const int kTouchAckTimeoutDelayMs = 200; |
66 | 68 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 131 |
130 InputRouterImpl::Config GetInputRouterConfigForPlatform() { | 132 InputRouterImpl::Config GetInputRouterConfigForPlatform() { |
131 InputRouterImpl::Config config; | 133 InputRouterImpl::Config config; |
132 config.gesture_config = GetGestureEventQueueConfig(); | 134 config.gesture_config = GetGestureEventQueueConfig(); |
133 config.touch_config = GetTouchEventQueueConfig(); | 135 config.touch_config = GetTouchEventQueueConfig(); |
134 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); | 136 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); |
135 return config; | 137 return config; |
136 } | 138 } |
137 | 139 |
138 } // namespace content | 140 } // namespace content |
OLD | NEW |