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

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: Add missing sourceDevice initialization in EventSender. 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..b110bf2e6f8ee08536960a871ae6eac34a65a796 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -500,7 +500,6 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollEnd(
InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureFlingStart(
const WebGestureEvent& gesture_event) {
cc::InputHandler::ScrollStatus scroll_status;
-
if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) {
tdresser 2015/10/14 15:14:20 This might read a bit better as a switch statement
wjmaclean 2015/10/14 15:55:09 Done.
if (gesture_event.data.flingStart.targetViewport) {
scroll_status = input_handler_->RootScrollBegin(
@@ -510,11 +509,14 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureFlingStart(
gfx::Point(gesture_event.x, gesture_event.y),
cc::InputHandler::NON_BUBBLING_GESTURE);
}
- } else {
+ } else if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchscreen) {
if (!gesture_scroll_on_impl_thread_)
scroll_status = cc::InputHandler::SCROLL_ON_MAIN_THREAD;
else
scroll_status = input_handler_->FlingScrollBegin();
+ } else { // sourceDevice == blink::WebGestureDeviceUninitialazed.
+ NOTREACHED();
+ return DID_NOT_HANDLE;
}
#ifndef NDEBUG
@@ -1012,6 +1014,9 @@ bool InputHandlerProxy::scrollBy(const WebFloatSize& increment,
bool did_scroll = false;
switch (fling_parameters_.sourceDevice) {
+ case blink::WebGestureDeviceUninitialized:
+ NOTREACHED();
+ break;
tdresser 2015/10/14 15:14:20 We generally put exceptional cases at the end of s
wjmaclean 2015/10/14 15:55:09 Done.
case blink::WebGestureDeviceTouchpad:
did_scroll = TouchpadFlingScroll(clipped_increment);
break;

Powered by Google App Engine
This is Rietveld 408576698