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

Unified Diff: ui/views/test/ui_controls_factory_desktop_aurax11.cc

Issue 162943004: [Refactor] Always pass in screen coordinates to UIControlsAura::SendMouseMove() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/base/test/ui_controls_internal_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/ui_controls_factory_desktop_aurax11.cc
diff --git a/ui/views/test/ui_controls_factory_desktop_aurax11.cc b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
index e5ea7f365568fa3294ea28f7181c94c5062be6c8..db6ff96389a81d25dbd955212307847e804dd111 100644
--- a/ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -158,30 +158,27 @@ class UIControlsDesktopX11 : public UIControlsAura {
return true;
}
- // Simulate a mouse move. (x,y) are absolute screen coordinates.
- virtual bool SendMouseMove(long x, long y) OVERRIDE {
- return SendMouseMoveNotifyWhenDone(x, y, base::Closure());
+ virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE {
+ return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure());
}
virtual bool SendMouseMoveNotifyWhenDone(
- long x,
- long y,
+ long screen_x,
+ long screen_y,
const base::Closure& closure) OVERRIDE {
- gfx::Point screen_point(x, y);
- gfx::Point window_point = screen_point;
+ gfx::Point screen_point(screen_x, screen_y);
+ gfx::Point root_point = screen_point;
aura::Window* root_window = RootWindowForPoint(screen_point);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root_window);
- if (screen_position_client) {
- screen_position_client->ConvertPointFromScreen(root_window,
- &window_point);
- }
+ if (screen_position_client)
+ screen_position_client->ConvertPointFromScreen(root_window, &root_point);
XEvent xevent = {0};
XMotionEvent* xmotion = &xevent.xmotion;
xmotion->type = MotionNotify;
- xmotion->x = window_point.x();
- xmotion->y = window_point.y();
+ xmotion->x = root_point.x();
+ xmotion->y = root_point.y();
xmotion->state = button_down_mask;
xmotion->same_screen = True;
// RootWindow will take care of other necessary fields.
« no previous file with comments | « ui/base/test/ui_controls_internal_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698