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

Unified Diff: content/renderer/pepper/event_conversion.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 | « content/renderer/input/render_widget_input_handler.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/event_conversion.cc
diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc
index 2cbd7e9d6c0e6652efdac7abd27268901aefaa05..0e175298289f89f1654abe87d29f8bddee36ed98 100644
--- a/content/renderer/pepper/event_conversion.cc
+++ b/content/renderer/pepper/event_conversion.cc
@@ -213,8 +213,8 @@ void AppendMouseEvent(const WebInputEvent& event,
result.mouse_button =
static_cast<PP_InputEvent_MouseButton>(mouse_event.button);
}
- result.mouse_position.x = mouse_event.x;
- result.mouse_position.y = mouse_event.y;
+ result.mouse_position.x = mouse_event.positionInWidget().x;
+ result.mouse_position.y = mouse_event.positionInWidget().y;
result.mouse_click_count = mouse_event.clickCount;
result.mouse_movement.x = mouse_event.movementX;
result.mouse_movement.y = mouse_event.movementY;
@@ -466,8 +466,8 @@ WebMouseEvent* BuildMouseEvent(const InputEventData& event) {
else if (mouse_event->modifiers() & WebInputEvent::RightButtonDown)
mouse_event->button = WebMouseEvent::Button::Right;
}
- mouse_event->x = event.mouse_position.x;
- mouse_event->y = event.mouse_position.y;
+ mouse_event->setPositionInWidget(event.mouse_position.x,
+ event.mouse_position.y);
mouse_event->clickCount = event.mouse_click_count;
mouse_event->movementX = event.mouse_movement.x;
mouse_event->movementY = event.mouse_movement.y;
@@ -675,8 +675,7 @@ std::vector<std::unique_ptr<WebInputEvent>> CreateSimulatedWebInputEvents(
case PP_INPUTEVENT_TYPE_WHEEL: {
WebMouseWheelEvent* web_mouse_wheel_event =
static_cast<WebMouseWheelEvent*>(original_event.get());
- web_mouse_wheel_event->x = plugin_x;
- web_mouse_wheel_event->y = plugin_y;
+ web_mouse_wheel_event->setPositionInWidget(plugin_x, plugin_y);
events.push_back(std::move(original_event));
break;
}
« no previous file with comments | « content/renderer/input/render_widget_input_handler.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698