| 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 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 GestureEventQueue::Config GetGestureEventQueueConfig() { | 88 GestureEventQueue::Config GetGestureEventQueueConfig() { |
| 89 return GestureEventQueue::Config(); | 89 return GestureEventQueue::Config(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 TouchEventQueue::Config GetTouchEventQueueConfig() { | 92 TouchEventQueue::Config GetTouchEventQueueConfig() { |
| 93 return TouchEventQueue::Config(); | 93 return TouchEventQueue::Config(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 #endif | 96 #endif |
| 97 | 97 |
| 98 TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() { | |
| 99 std::string modeString = | |
| 100 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | |
| 101 switches::kTouchScrollingMode); | |
| 102 if (modeString == switches::kTouchScrollingModeAsyncTouchmove) | |
| 103 return TouchEventQueue::TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE; | |
| 104 if (modeString == switches::kTouchScrollingModeSyncTouchmove) | |
| 105 return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE; | |
| 106 if (modeString == switches::kTouchScrollingModeTouchcancel) | |
| 107 return TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL; | |
| 108 if (!modeString.empty()) | |
| 109 LOG(ERROR) << "Invalid --touch-scrolling-mode option: " << modeString; | |
| 110 return TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT; | |
| 111 } | |
| 112 | |
| 113 } // namespace | 98 } // namespace |
| 114 | 99 |
| 115 InputRouterImpl::Config GetInputRouterConfigForPlatform() { | 100 InputRouterImpl::Config GetInputRouterConfigForPlatform() { |
| 116 InputRouterImpl::Config config; | 101 InputRouterImpl::Config config; |
| 117 config.gesture_config = GetGestureEventQueueConfig(); | 102 config.gesture_config = GetGestureEventQueueConfig(); |
| 118 config.touch_config = GetTouchEventQueueConfig(); | 103 config.touch_config = GetTouchEventQueueConfig(); |
| 119 config.touch_config.touch_scrolling_mode = GetTouchScrollingMode(); | |
| 120 return config; | 104 return config; |
| 121 } | 105 } |
| 122 | 106 |
| 123 } // namespace content | 107 } // namespace content |
| OLD | NEW |