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

Unified Diff: ui/events/blink/web_input_event.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
« no previous file with comments | « ui/events/blink/input_handler_proxy_unittest.cc ('k') | ui/events/blink/web_input_event_builders_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/web_input_event.cc
diff --git a/ui/events/blink/web_input_event.cc b/ui/events/blink/web_input_event.cc
index 06357f8e02423d655eac23243ecc6f4abc38ca38..c5263239e337d155ff25b1f08cd96009f984363a 100644
--- a/ui/events/blink/web_input_event.cc
+++ b/ui/events/blink/web_input_event.cc
@@ -235,8 +235,7 @@ blink::WebMouseEvent MakeWebMouseEvent(
#endif
// Replace the event's coordinate fields with translated position data from
// |event|.
- webkit_event.x = event.x();
- webkit_event.y = event.y();
+ webkit_event.setPositionInWidget(event.x(), event.y());
#if defined(OS_WIN)
if (event.native_event().message)
@@ -245,8 +244,7 @@ blink::WebMouseEvent MakeWebMouseEvent(
const gfx::Point screen_point =
GetScreenLocationFromEvent(event, screen_location_callback);
- webkit_event.globalX = screen_point.x();
- webkit_event.globalY = screen_point.y();
+ webkit_event.setPositionInScreen(screen_point.x(), screen_point.y());
return webkit_event;
}
@@ -271,13 +269,11 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEvent(
// Replace the event's coordinate fields with translated position data from
// |event|.
- webkit_event.x = event.x();
- webkit_event.y = event.y();
+ webkit_event.setPositionInWidget(event.x(), event.y());
const gfx::Point screen_point =
GetScreenLocationFromEvent(event, screen_location_callback);
- webkit_event.globalX = screen_point.x();
- webkit_event.globalY = screen_point.y();
+ webkit_event.setPositionInScreen(screen_point.x(), screen_point.y());
return webkit_event;
}
@@ -302,13 +298,11 @@ blink::WebMouseWheelEvent MakeWebMouseWheelEvent(
// Replace the event's coordinate fields with translated position data from
// |event|.
- webkit_event.x = event.x();
- webkit_event.y = event.y();
+ webkit_event.setPositionInWidget(event.x(), event.y());
const gfx::Point screen_point =
GetScreenLocationFromEvent(event, screen_location_callback);
- webkit_event.globalX = screen_point.x();
- webkit_event.globalY = screen_point.y();
+ webkit_event.setPositionInScreen(screen_point.x(), screen_point.y());
return webkit_event;
}
« no previous file with comments | « ui/events/blink/input_handler_proxy_unittest.cc ('k') | ui/events/blink/web_input_event_builders_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698