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

Unified Diff: content/browser/renderer_host/input/synthetic_mouse_driver.cc

Issue 2633233002: Add the pointer type of pen to the synthetic WebMousEvent (Closed)
Patch Set: Make disallow copy private 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/browser/renderer_host/input/synthetic_mouse_driver.cc
diff --git a/content/browser/renderer_host/input/synthetic_mouse_driver.cc b/content/browser/renderer_host/input/synthetic_mouse_driver.cc
index bc3537afc8b8dea677f3e3a4f9b438ac4327d64d..ed388a72a8a6d0a14dc9f7ce85497232f5437542 100644
--- a/content/browser/renderer_host/input/synthetic_mouse_driver.cc
+++ b/content/browser/renderer_host/input/synthetic_mouse_driver.cc
@@ -8,7 +8,9 @@
namespace content {
-SyntheticMouseDriver::SyntheticMouseDriver() : last_modifiers_(0) {}
+SyntheticMouseDriver::SyntheticMouseDriver() : last_modifiers_(0) {
+ mouse_event_.pointerType = blink::WebPointerProperties::PointerType::Mouse;
+}
SyntheticMouseDriver::~SyntheticMouseDriver() {}
@@ -26,7 +28,8 @@ void SyntheticMouseDriver::Press(float x,
int modifiers =
SyntheticPointerActionParams::GetWebMouseEventModifier(button);
mouse_event_ = SyntheticWebMouseEventBuilder::Build(
- blink::WebInputEvent::MouseDown, x, y, modifiers | last_modifiers_);
+ blink::WebInputEvent::MouseDown, x, y, modifiers | last_modifiers_,
+ mouse_event_.pointerType);
mouse_event_.clickCount = 1;
mouse_event_.button =
SyntheticPointerActionParams::GetWebMouseEventButton(button);
@@ -38,7 +41,8 @@ void SyntheticMouseDriver::Move(float x, float y, int index) {
blink::WebMouseEvent::Button button = mouse_event_.button;
int click_count = mouse_event_.clickCount;
mouse_event_ = SyntheticWebMouseEventBuilder::Build(
- blink::WebInputEvent::MouseMove, x, y, last_modifiers_);
+ blink::WebInputEvent::MouseMove, x, y, last_modifiers_,
+ mouse_event_.pointerType);
mouse_event_.button = button;
mouse_event_.clickCount = click_count;
}
@@ -49,7 +53,7 @@ void SyntheticMouseDriver::Release(
DCHECK_EQ(index, 0);
mouse_event_ = SyntheticWebMouseEventBuilder::Build(
blink::WebInputEvent::MouseUp, mouse_event_.x, mouse_event_.y,
- last_modifiers_);
+ last_modifiers_, mouse_event_.pointerType);
mouse_event_.clickCount = 1;
mouse_event_.button =
SyntheticPointerActionParams::GetWebMouseEventButton(button);

Powered by Google App Engine
This is Rietveld 408576698