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