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 "base/logging.h" |
8 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
9 #include "ui/events/gesture_detection/gesture_detector.h" | 10 #include "ui/events/gesture_detection/gesture_detector.h" |
10 | 11 |
11 #if defined(USE_AURA) | 12 #if defined(USE_AURA) |
12 #include "ui/events/gestures/gesture_configuration.h" | 13 #include "ui/events/gestures/gesture_configuration.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 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return TouchEventQueue::TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE; | 117 return TouchEventQueue::TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE; |
117 if (modeString == switches::kTouchScrollingModeSyncTouchmove) | 118 if (modeString == switches::kTouchScrollingModeSyncTouchmove) |
118 return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE; | 119 return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE; |
119 if (modeString == switches::kTouchScrollingModeTouchcancel) | 120 if (modeString == switches::kTouchScrollingModeTouchcancel) |
120 return TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL; | 121 return TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL; |
121 if (modeString != "") | 122 if (modeString != "") |
122 LOG(ERROR) << "Invalid --touch-scrolling-mode option: " << modeString; | 123 LOG(ERROR) << "Invalid --touch-scrolling-mode option: " << modeString; |
123 return TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT; | 124 return TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT; |
124 } | 125 } |
125 | 126 |
| 127 bool GetValidateEventStream() { |
| 128 #if defined(DCHECK_IS_ON) |
| 129 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 130 switches::kValidateInputEventStream); |
| 131 #endif |
| 132 return false; |
| 133 } |
| 134 |
126 } // namespace | 135 } // namespace |
127 | 136 |
128 InputRouterImpl::Config GetInputRouterConfigForPlatform() { | 137 InputRouterImpl::Config GetInputRouterConfigForPlatform() { |
129 InputRouterImpl::Config config; | 138 InputRouterImpl::Config config; |
130 config.gesture_config = GetGestureEventQueueConfig(); | 139 config.gesture_config = GetGestureEventQueueConfig(); |
131 config.touch_config = GetTouchEventQueueConfig(); | 140 config.touch_config = GetTouchEventQueueConfig(); |
132 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); | 141 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); |
| 142 config.validate_event_stream = GetValidateEventStream(); |
133 return config; | 143 return config; |
134 } | 144 } |
135 | 145 |
136 } // namespace content | 146 } // namespace content |
OLD | NEW |