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

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.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/browser/devtools/protocol/input_handler.cc ('k') | content/browser/pointer_lock_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index a02b055c3c6f5019ebe96fed2e2447306d522814..0f049d7d6bfba09322bdfcd0b7653d97fa00a218 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -184,9 +184,8 @@ void RenderWidgetHostViewGuest::ProcessMouseEvent(
// click. Sends a synthetic event for the focusing side effect.
// TODO(wjmaclean): When we remove BrowserPlugin, delete this code.
// http://crbug.com/533069
- MaybeSendSyntheticTapGesture(
- blink::WebFloatPoint(event.x, event.y),
- blink::WebFloatPoint(event.globalX, event.globalY));
+ MaybeSendSyntheticTapGesture(event.positionInWidget(),
+ event.positionInScreen());
}
host_->ForwardMouseEventWithLatencyInfo(event, latency);
}
@@ -564,8 +563,9 @@ void RenderWidgetHostViewGuest::OnHandleInputEvent(
event->type() == blink::WebInputEvent::MouseWheel) {
blink::WebMouseWheelEvent rescaled_event =
*static_cast<const blink::WebMouseWheelEvent*>(event);
- rescaled_event.x /= current_device_scale_factor();
- rescaled_event.y /= current_device_scale_factor();
+ rescaled_event.setPositionInWidget(
+ rescaled_event.positionInWidget().x / current_device_scale_factor(),
+ rescaled_event.positionInWidget().y / current_device_scale_factor());
rescaled_event.deltaX /= current_device_scale_factor();
rescaled_event.deltaY /= current_device_scale_factor();
rescaled_event.wheelTicksX /= current_device_scale_factor();
@@ -592,8 +592,8 @@ void RenderWidgetHostViewGuest::OnHandleInputEvent(
if (guest_ && mouse_event.type() == blink::WebInputEvent::MouseDown &&
mouse_event.button == blink::WebPointerProperties::Button::Right)
guest_->SetContextMenuPosition(
- gfx::Point(mouse_event.globalX - GetViewBounds().x(),
- mouse_event.globalY - GetViewBounds().y()));
+ gfx::Point(mouse_event.positionInScreen().x - GetViewBounds().x(),
+ mouse_event.positionInScreen().y - GetViewBounds().y()));
host_->ForwardMouseEvent(mouse_event);
return;
}
« no previous file with comments | « content/browser/devtools/protocol/input_handler.cc ('k') | content/browser/pointer_lock_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698