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

Unified Diff: content/public/test/browser_test_utils.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/common/input/synthetic_web_input_event_builders.cc ('k') | content/public/test/render_view_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index ccbe0d5df163b7db2a0ec6da081bc9689eb9949f..66b591ce634632f4bebd68b9a5b36c285cecef51 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -537,12 +537,11 @@ void SimulateMouseClickAt(WebContents* web_contents,
blink::WebInputEvent::MouseDown, modifiers,
ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
mouse_event.button = button;
- mouse_event.x = point.x();
- mouse_event.y = point.y();
- // Mac needs globalX/globalY for events to plugins.
+ mouse_event.setPositionInWidget(point.x(), point.y());
+ // Mac needs positionInScreen for events to plugins.
gfx::Rect offset = web_contents->GetContainerBounds();
- mouse_event.globalX = point.x() + offset.x();
- mouse_event.globalY = point.y() + offset.y();
+ mouse_event.setPositionInScreen(point.x() + offset.x(),
+ point.y() + offset.y());
mouse_event.clickCount = 1;
web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(
mouse_event);
@@ -557,8 +556,7 @@ void SimulateMouseEvent(WebContents* web_contents,
blink::WebMouseEvent mouse_event(
type, blink::WebInputEvent::NoModifiers,
ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
- mouse_event.x = point.x();
- mouse_event.y = point.y();
+ mouse_event.setPositionInWidget(point.x(), point.y());
web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(
mouse_event);
}
@@ -570,8 +568,7 @@ void SimulateMouseWheelEvent(WebContents* web_contents,
blink::WebInputEvent::MouseWheel, blink::WebInputEvent::NoModifiers,
ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
- wheel_event.x = point.x();
- wheel_event.y = point.y();
+ wheel_event.setPositionInWidget(point.x(), point.y());
wheel_event.deltaX = delta.x();
wheel_event.deltaY = delta.y();
RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From(
« no previous file with comments | « content/common/input/synthetic_web_input_event_builders.cc ('k') | content/public/test/render_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698