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

Unified Diff: content/renderer/input/input_handler_proxy.cc

Issue 1403893003: Plumb gesture source value through Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments: never use uninitialized, track fling source device. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/input_handler_proxy.cc
diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc
index b5dcb181261f6f8b19f7d1a13c7dfc73caa41b4b..282b002c7ce5b56cd7f21ad66a686506d05efef0 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -500,8 +500,8 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd(
InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureFlingStart(
const WebGestureEvent& gesture_event) {
cc::InputHandler::ScrollStatus scroll_status;
-
- if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) {
+ switch (gesture_event.sourceDevice) {
+ case blink::WebGestureDeviceTouchpad:
if (gesture_event.data.flingStart.targetViewport) {
scroll_status = input_handler_->RootScrollBegin(
cc::InputHandler::NON_BUBBLING_GESTURE);
@@ -510,11 +510,16 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureFlingStart(
gfx::Point(gesture_event.x, gesture_event.y),
cc::InputHandler::NON_BUBBLING_GESTURE);
}
- } else {
+ break;
+ case blink::WebGestureDeviceTouchscreen:
if (!gesture_scroll_on_impl_thread_)
scroll_status = cc::InputHandler::SCROLL_ON_MAIN_THREAD;
else
scroll_status = input_handler_->FlingScrollBegin();
+ break;
+ case blink::WebGestureDeviceUninitialized:
+ NOTREACHED();
+ return DID_NOT_HANDLE;
}
#ifndef NDEBUG
@@ -1022,6 +1027,8 @@ bool InputHandlerProxy::scrollBy(const WebFloatSize& increment,
HandleOverscroll(fling_parameters_.point, scroll_result);
did_scroll = scroll_result.did_scroll;
} break;
+ case blink::WebGestureDeviceUninitialized:
+ NOTREACHED();
tdresser 2015/10/14 17:18:56 Should we have an early return here?
wjmaclean 2015/10/14 18:03:28 Done.
}
if (did_scroll) {

Powered by Google App Engine
This is Rietveld 408576698