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

Unified Diff: content/common/input/gesture_event_stream_validator.cc

Issue 1403893003: Plumb gesture source value through Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GestureEventStreamValidator source device compatibility check. 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/common/input/gesture_event_stream_validator.cc
diff --git a/content/common/input/gesture_event_stream_validator.cc b/content/common/input/gesture_event_stream_validator.cc
index 6ea29de25ac8536fd054b45af307ee58dc5cdebe..0633bd385f83923e75d8b5b5d5e5e5ecdfd2bde6 100644
--- a/content/common/input/gesture_event_stream_validator.cc
+++ b/content/common/input/gesture_event_stream_validator.cc
@@ -100,6 +100,15 @@ bool GestureEventStreamValidator::Validate(const blink::WebGestureEvent& event,
default:
break;
}
+ // TODO(wjmaclean): At some future point we may wish to consider adding a
+ // 'continuity check', requiring that all events between an initial tap-down
+ // and whatever terminates the sequence to have the same source device type.
+ if (event.sourceDevice == blink::WebGestureDeviceTouchpad &&
+ !WebInputEvent::isGestureScrollEventType(event.type)) {
+ error_msg->append(
jdduke (slow) 2015/10/19 18:15:38 Hmm, I was thinking something even more basic, lik
wjmaclean 2015/10/19 18:58:49 Done.
+ "Touchpad device should only be used for scroll events.\n");
+ }
+
return error_msg->empty();
}

Powered by Google App Engine
This is Rietveld 408576698