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

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

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm Created 3 years, 8 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/touch_emulator.cc
diff --git a/content/browser/renderer_host/input/touch_emulator.cc b/content/browser/renderer_host/input/touch_emulator.cc
index 2991879d50ac1c798c0a295b4666fb641fb1b769..a64c7db95cc2a8d88be0a6be907267e9b48d8085 100644
--- a/content/browser/renderer_host/input/touch_emulator.cc
+++ b/content/browser/renderer_host/input/touch_emulator.cc
@@ -159,7 +159,8 @@ bool TouchEmulator::HandleMouseEvent(const WebMouseEvent& mouse_event) {
if (mouse_event.button == WebMouseEvent::Button::Right &&
mouse_event.type() == WebInputEvent::MouseDown) {
- client_->ShowContextMenuAtPoint(gfx::Point(mouse_event.x, mouse_event.y));
+ client_->ShowContextMenuAtPoint(gfx::Point(
+ mouse_event.positionInWidget().x, mouse_event.positionInWidget().y));
}
if (mouse_event.button != WebMouseEvent::Button::Left)
@@ -463,10 +464,10 @@ void TouchEmulator::FillTouchEventAndPoint(const WebMouseEvent& mouse_event) {
point.radiusY = 0.5f * cursor_size_.height();
point.force = eventType == WebInputEvent::TouchEnd ? 0.f : 1.f;
point.rotationAngle = 0.f;
- point.position.x = mouse_event.x;
- point.screenPosition.x = mouse_event.globalX;
- point.position.y = mouse_event.y;
- point.screenPosition.y = mouse_event.globalY;
+ point.position.x = mouse_event.positionInWidget().x;
+ point.screenPosition.x = mouse_event.positionInScreen().x;
+ point.position.y = mouse_event.positionInWidget().y;
+ point.screenPosition.y = mouse_event.positionInScreen().y;
point.tiltX = 0;
point.tiltY = 0;
point.pointerType = blink::WebPointerProperties::PointerType::Touch;

Powered by Google App Engine
This is Rietveld 408576698