Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Side by Side Diff: content/browser/renderer_host/input/input_router_config_helper.cc

Issue 628763003: Support InputRouter recycling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698