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

Unified Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 166923002: Add touch scrolling modes experimental flags (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix out of order initializer error. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/input_router_impl.cc
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index 3b68845ec3d2fe71ffea81f202a36ec10f4cb352..b303acdb94cb21899d3042796cce2fe0c561ca98 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -85,6 +85,19 @@ double GetTouchMoveSlopSuppressionLengthDips() {
}
#endif
+TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() {
+ std::string modeString = CommandLine::ForCurrentProcess()->
+ GetSwitchValueASCII(switches::kTouchScrollingMode);
+ if (modeString == switches::kTouchScrollingModeSyncTouchmove)
+ return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE;
+ if (modeString == switches::kTouchScrollingModeAbsorbTouchmove)
+ return TouchEventQueue::TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE;
+ if (modeString != "" &&
+ modeString != switches::kTouchScrollingModeTouchcancel)
+ LOG(ERROR) << "Invalid --touch-scrolling-mode option: " << modeString;
+ return TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT;
+}
+
GestureEventWithLatencyInfo MakeGestureEvent(WebInputEvent::Type type,
double timestamp_seconds,
int x,
@@ -136,8 +149,8 @@ InputRouterImpl::InputRouterImpl(IPC::Sender* sender,
DCHECK(sender);
DCHECK(client);
DCHECK(ack_handler);
- touch_event_queue_.reset(
- new TouchEventQueue(this, GetTouchMoveSlopSuppressionLengthDips()));
+ touch_event_queue_.reset(new TouchEventQueue(
+ this, GetTouchScrollingMode(), GetTouchMoveSlopSuppressionLengthDips()));
touch_ack_timeout_enabled_ =
GetTouchAckTimeoutDelayMs(&touch_ack_timeout_delay_ms_);
touch_event_queue_->SetAckTimeoutEnabled(touch_ack_timeout_enabled_,
@@ -328,6 +341,7 @@ void InputRouterImpl::OnTouchEventAck(const TouchEventWithLatencyInfo& event,
void InputRouterImpl::OnGestureEventAck(
const GestureEventWithLatencyInfo& event,
InputEventAckState ack_result) {
+ touch_event_queue_->OnGestureEventAck(event, ack_result);
ProcessAckForOverscroll(event.event, ack_result);
ack_handler_->OnGestureEventAck(event, ack_result);
}
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698