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

Unified Diff: ui/base/test/ui_controls_internal_win.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.h ('k') | ui/views/test/ui_controls_factory_desktop_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/ui_controls_internal_win.cc
diff --git a/ui/base/test/ui_controls_internal_win.cc b/ui/base/test/ui_controls_internal_win.cc
index 45b8f45c18d3eac46589c495237125598ed3007f..ebf4a6de943238f2765130cb1f9ddf2f6f2a78a6 100644
--- a/ui/base/test/ui_controls_internal_win.cc
+++ b/ui/base/test/ui_controls_internal_win.cc
@@ -255,11 +255,13 @@ bool SendKeyPressImpl(HWND window,
return true;
}
-bool SendMouseMoveImpl(long x, long y, const base::Closure& task) {
+bool SendMouseMoveImpl(long screen_x,
+ long screen_y,
+ const base::Closure& task) {
// First check if the mouse is already there.
POINT current_pos;
::GetCursorPos(&current_pos);
- if (x == current_pos.x && y == current_pos.y) {
+ if (screen_x == current_pos.x && screen_y == current_pos.y) {
if (!task.is_null())
base::MessageLoop::current()->PostTask(FROM_HERE, task);
return true;
@@ -269,8 +271,8 @@ bool SendMouseMoveImpl(long x, long y, const base::Closure& task) {
int screen_width = ::GetSystemMetrics(SM_CXSCREEN) - 1;
int screen_height = ::GetSystemMetrics(SM_CYSCREEN) - 1;
- LONG pixel_x = static_cast<LONG>(x * (65535.0f / screen_width));
- LONG pixel_y = static_cast<LONG>(y * (65535.0f / screen_height));
+ LONG pixel_x = static_cast<LONG>(screen_x * (65535.0f / screen_width));
+ LONG pixel_y = static_cast<LONG>(screen_y * (65535.0f / screen_height));
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
« no previous file with comments | « ui/base/test/ui_controls_internal_win.h ('k') | ui/views/test/ui_controls_factory_desktop_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698