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

Unified Diff: ash/test/ui_controls_factory_ash.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 | « no previous file | ui/aura/test/ui_controls_factory_aurawin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ui_controls_factory_ash.cc
diff --git a/ash/test/ui_controls_factory_ash.cc b/ash/test/ui_controls_factory_ash.cc
index b8393e56f98c846148e77fff2b9862e873bc4706..ef39464ca9d4e1614277b0d3560dacea281a04d0 100644
--- a/ash/test/ui_controls_factory_ash.cc
+++ b/ash/test/ui_controls_factory_ash.cc
@@ -42,20 +42,10 @@ UIControlsAura* GetUIControlsForRootWindow(aura::Window* root_window) {
return native_ui_control;
}
-// Returns the UIControls object for the RootWindow at the |point_in_screen|
-// in virtual screen coordinates, and updates the |point| relative to the
-// UIControlsAura's root window. NULL if there is no RootWindow under
-// the |point_in_screen|.
-UIControlsAura* GetUIControlsAt(gfx::Point* point_in_screen) {
+// Returns the UIControls object for the RootWindow at |point_in_screen|.
+UIControlsAura* GetUIControlsAt(const gfx::Point& point_in_screen) {
// TODO(mazda): Support the case passive grab is taken.
- aura::Window* root = ash::wm::GetRootWindowAt(*point_in_screen);
-
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(root);
- if (screen_position_client)
- screen_position_client->ConvertPointFromScreen(root, point_in_screen);
-
- return GetUIControlsForRootWindow(root);
+ return GetUIControlsForRootWindow(ash::wm::GetRootWindowAt(point_in_screen));
}
} // namespace
@@ -95,7 +85,7 @@ class UIControlsAsh : public UIControlsAura {
virtual bool SendMouseMove(long x, long y) OVERRIDE {
gfx::Point p(x, y);
- UIControlsAura* ui_controls = GetUIControlsAt(&p);
+ UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseMove(p.x(), p.y());
}
@@ -104,28 +94,28 @@ class UIControlsAsh : public UIControlsAura {
long y,
const base::Closure& closure) OVERRIDE {
gfx::Point p(x, y);
- UIControlsAura* ui_controls = GetUIControlsAt(&p);
+ UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls &&
ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure);
}
virtual bool SendMouseEvents(MouseButton type, int state) OVERRIDE {
gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
- UIControlsAura* ui_controls = GetUIControlsAt(&p);
+ UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseEvents(type, state);
}
virtual bool SendMouseEventsNotifyWhenDone(
MouseButton type, int state, const base::Closure& closure) OVERRIDE {
gfx::Point p(aura::Env::GetInstance()->last_mouse_location());
- UIControlsAura* ui_controls = GetUIControlsAt(&p);
+ UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone(
type, state, closure);
}
virtual bool SendMouseClick(MouseButton type) OVERRIDE {
gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
- UIControlsAura* ui_controls = GetUIControlsAt(&p);
+ UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseClick(type);
}
« no previous file with comments | « no previous file | ui/aura/test/ui_controls_factory_aurawin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698