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

Unified Diff: content/shell/test_runner/event_sender.cc

Issue 2925883003: [Touch Adjustment] Pass primary_pointer_type to WebGestureEvent and disable adjustment for stylus (Closed)
Patch Set: jochen and dtapuska's comments: Add default value Created 3 years, 6 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/shell/test_runner/event_sender.cc
diff --git a/content/shell/test_runner/event_sender.cc b/content/shell/test_runner/event_sender.cc
index 02ece2fb7ec769e0b7677631844de2ee87fdb573..1df04e477be68b1e7ce4d5ac770c6e321f039b5c 100644
--- a/content/shell/test_runner/event_sender.cc
+++ b/content/shell/test_runner/event_sender.cc
@@ -82,7 +82,7 @@ const char* const kPointerTypeStringEraser = "eraser";
// Assigns |pointerType| from the provided |args|. Returns false if there was
// any error.
-bool getPointerType(gin::Arguments* args,
+bool GetPointerType(gin::Arguments* args,
bool isOnlyMouseAndPenAllowed,
WebPointerProperties::PointerType& pointerType) {
if (args->PeekNext().IsEmpty())
@@ -132,7 +132,7 @@ bool getMousePenPointerProperties(
tiltY = 0;
// Only allow pen or mouse through this API.
- if (!getPointerType(args, false, pointerType))
+ if (!GetPointerType(args, false, pointerType))
return false;
if (!args->PeekNext().IsEmpty()) {
if (!args->GetNext(&rawPointerId)) {
@@ -1023,7 +1023,7 @@ void EventSenderBindings::MouseLeave(gin::Arguments* args) {
int pointerId = kRawMousePointerId;
// Only allow pen or mouse through this API.
- if (!getPointerType(args, false, pointerType))
+ if (!GetPointerType(args, false, pointerType))
return;
if (!args->PeekNext().IsEmpty()) {
if (!args->GetNext(&pointerId)) {
@@ -2525,6 +2525,8 @@ void EventSender::GestureEvent(WebInputEvent::Type type, gin::Arguments* args) {
}
event.unique_touch_event_id = GetUniqueTouchEventId(args);
+ if (!GetPointerType(args, false, event.primary_pointer_type))
+ return;
event.global_x = event.x;
event.global_y = event.y;
@@ -2674,7 +2676,7 @@ void EventSender::InitPointerProperties(gin::Arguments* args,
e->tilt_y = tiltY;
}
- if (!getPointerType(args, false, e->pointer_type))
+ if (!GetPointerType(args, false, e->pointer_type))
return;
}

Powered by Google App Engine
This is Rietveld 408576698