diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-19 00:37:34 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-19 00:37:34 +0000 |
commit | b73f34d5bc93d353bb53324f0ddfc76afd523f9f (patch) | |
tree | 37ca8f3da677c8b1e6b18881cefc61f81ab961b6 /ash/test | |
parent | 69237e3cb460abfa29629c36035677c0132aff18 (diff) | |
download | chromium_src-b73f34d5bc93d353bb53324f0ddfc76afd523f9f.zip chromium_src-b73f34d5bc93d353bb53324f0ddfc76afd523f9f.tar.gz chromium_src-b73f34d5bc93d353bb53324f0ddfc76afd523f9f.tar.bz2 |
[Refactor] Always pass in screen coordinates to UIControlsAura::SendMouseMove()
BUG=None
TEST=None
Review URL: https://codereview.chromium.org/162943004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/ui_controls_factory_ash.cc | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/ash/test/ui_controls_factory_ash.cc b/ash/test/ui_controls_factory_ash.cc index b8393e5..ef39464 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); } |