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..971d003edf0b8927f24a9493ede554530716cd63 100644 |
--- a/content/browser/renderer_host/input/input_router_impl.cc |
+++ b/content/browser/renderer_host/input/input_router_impl.cc |
@@ -115,6 +115,20 @@ const char* GetEventAckName(InputEventAckState ack_result) { |
return ""; |
} |
+TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() |
+{ |
jdduke (slow)
2014/02/14 21:18:00
Nit: Move brace up a line. Also could you move th
tdresser
2014/02/14 21:24:40
Done.
|
+ 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; |
+} |
+ |
} // namespace |
InputRouterImpl::InputRouterImpl(IPC::Sender* sender, |
@@ -136,8 +150,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 +342,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); |
} |