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

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

Issue 2633233002: Add the pointer type of pen to the synthetic WebMousEvent (Closed)
Patch Set: pen type Created 3 years, 11 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/synthetic_web_input_event_builders.cc
diff --git a/content/common/input/synthetic_web_input_event_builders.cc b/content/common/input/synthetic_web_input_event_builders.cc
index e7c5f6da90adde6b5751b78181bea1a49e857603..f168dceba1e45486a4c22856b513ff7b78d1dccc 100644
--- a/content/common/input/synthetic_web_input_event_builders.cc
+++ b/content/common/input/synthetic_web_input_event_builders.cc
@@ -29,8 +29,11 @@ WebMouseEvent SyntheticWebMouseEventBuilder::Build(
blink::WebInputEvent::Type type,
int window_x,
int window_y,
- int modifiers) {
+ int modifiers,
+ blink::WebPointerProperties::PointerType pointer_type) {
DCHECK(WebInputEvent::isMouseEventType(type));
+ DCHECK(pointer_type == blink::WebPointerProperties::PointerType::Mouse ||
+ pointer_type == blink::WebPointerProperties::PointerType::Pen);
WebMouseEvent result(type, modifiers,
ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
result.x = window_x;
@@ -38,7 +41,7 @@ WebMouseEvent SyntheticWebMouseEventBuilder::Build(
result.windowX = window_x;
result.windowY = window_y;
result.setModifiers(modifiers);
- result.pointerType = blink::WebPointerProperties::PointerType::Mouse;
+ result.pointerType = pointer_type;
return result;
}

Powered by Google App Engine
This is Rietveld 408576698