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

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

Issue 712133003: Track whether a scroll sequence has been partially prevented (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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 b485da4ee1739f58845ce7269acd42c3890c9cbe..27812c54db614f0bdf1dfcb45f5cff8973ad9224 100644
--- a/content/common/input/gesture_event_stream_validator.cc
+++ b/content/common/input/gesture_event_stream_validator.cc
@@ -5,6 +5,8 @@
#include "content/common/input/gesture_event_stream_validator.h"
#include "base/logging.h"
+#include "base/strings/stringprintf.h"
+#include "content/common/input/web_input_event_traits.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
using blink::WebInputEvent;
@@ -22,6 +24,10 @@ bool GestureEventStreamValidator::Validate(const blink::WebGestureEvent& event,
std::string* error_msg) {
DCHECK(error_msg);
error_msg->clear();
+ if (!WebInputEvent::isGestureEventType(event.type)) {
+ error_msg->append(base::StringPrintf(
+ "Invalid gesture type: %s", WebInputEventTraits::GetName(event.type)));
+ }
switch (event.type) {
case WebInputEvent::GestureScrollBegin:
if (scrolling_)

Powered by Google App Engine
This is Rietveld 408576698