diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-10 18:23:02 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-10 18:23:02 +0000 |
commit | 01ba68876697c812af59ae26503db7fe72b52677 (patch) | |
tree | a601fdb4391ccd3d03d72d8af30e891dfcddfb86 /ash/ui_controls_ash.cc | |
parent | 4a007aac63e4f16a6d473b5a17903d66258e30d2 (diff) | |
download | chromium_src-01ba68876697c812af59ae26503db7fe72b52677.zip chromium_src-01ba68876697c812af59ae26503db7fe72b52677.tar.gz chromium_src-01ba68876697c812af59ae26503db7fe72b52677.tar.bz2 |
Revert r14457 "Cancel drag if display configuration changes."
This reverts commit 116e78b0600dd591d2b54390e290e95b8ea0355b.
link error in win_aura
TBR=oshima@chromium.org
BUG=14457
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10913174
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ui_controls_ash.cc')
-rw-r--r-- | ash/ui_controls_ash.cc | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/ash/ui_controls_ash.cc b/ash/ui_controls_ash.cc index f2aba71..7463a53 100644 --- a/ash/ui_controls_ash.cc +++ b/ash/ui_controls_ash.cc @@ -7,7 +7,6 @@ #include "ash/wm/coordinate_conversion.h" #include "ash/wm/window_properties.h" #include "ui/aura/client/capture_client.h" -#include "ui/aura/client/screen_position_client.h" #include "ui/aura/root_window.h" #include "ui/aura/ui_controls_aura.h" #include "ui/gfx/screen.h" @@ -33,25 +32,18 @@ ui_controls::UIControlsAura* GetUIControlsForRootWindow( } // Returns the UIControls object for the RootWindow at the |point| in -// virtual screen coordinates, and updates the |point| relative to the -// UIControlsAura's root window. NULL if there is no RootWindow under -// the |point|. -ui_controls::UIControlsAura* GetUIControlsAt(gfx::Point* point) { +// absolute screen coordinates. NULL if there is no RootWindow under the +// |point|. +ui_controls::UIControlsAura* GetUIControlsAt(const gfx::Point& point) { // If there is a capture events must be relative to it. aura::client::CaptureClient* capture_client = GetCaptureClient(ash::Shell::GetInstance()->GetPrimaryRootWindow()); - aura::RootWindow* root = NULL; - if (capture_client && capture_client->GetCaptureWindow()) - root = capture_client->GetCaptureWindow()->GetRootWindow(); - else - root = wm::GetRootWindowAt(*point); - - aura::client::ScreenPositionClient* screen_position_client = - aura::client::GetScreenPositionClient(root); - if (screen_position_client) - screen_position_client->ConvertPointFromScreen(root, point); - - return GetUIControlsForRootWindow(root); + if (capture_client && capture_client->GetCaptureWindow()) { + return GetUIControlsForRootWindow( + capture_client->GetCaptureWindow()->GetRootWindow()); + } + aura::RootWindow* root = wm::GetRootWindowAt(point); + return root ? GetUIControlsForRootWindow(root) : NULL; } } // namespace @@ -90,25 +82,25 @@ class UIControlsAsh : public ui_controls::UIControlsAura { } virtual bool SendMouseMove(long x, long y) OVERRIDE { - gfx::Point p(x, y); - ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); - return ui_controls && ui_controls->SendMouseMove(p.x(), p.y()); + ui_controls::UIControlsAura* ui_controls = + GetUIControlsAt(gfx::Point(x, y)); + return ui_controls && ui_controls->SendMouseMove(x, y); } virtual bool SendMouseMoveNotifyWhenDone( long x, long y, const base::Closure& closure) OVERRIDE { - gfx::Point p(x, y); - ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); + ui_controls::UIControlsAura* ui_controls = + GetUIControlsAt(gfx::Point(x, y)); return ui_controls && - ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure); + ui_controls->SendMouseMoveNotifyWhenDone(x, y, closure); } virtual bool SendMouseEvents(ui_controls::MouseButton type, int state) OVERRIDE { - gfx::Point p(gfx::Screen::GetCursorScreenPoint()); - ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); + ui_controls::UIControlsAura* ui_controls = + GetUIControlsAt(gfx::Screen::GetCursorScreenPoint()); return ui_controls && ui_controls->SendMouseEvents(type, state); } @@ -116,15 +108,15 @@ class UIControlsAsh : public ui_controls::UIControlsAura { ui_controls::MouseButton type, int state, const base::Closure& closure) OVERRIDE { - gfx::Point p(gfx::Screen::GetCursorScreenPoint()); - ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); + ui_controls::UIControlsAura* ui_controls = + GetUIControlsAt(gfx::Screen::GetCursorScreenPoint()); return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone( type, state, closure); } virtual bool SendMouseClick(ui_controls::MouseButton type) OVERRIDE { - gfx::Point p(gfx::Screen::GetCursorScreenPoint()); - ui_controls::UIControlsAura* ui_controls = GetUIControlsAt(&p); + ui_controls::UIControlsAura* ui_controls = + GetUIControlsAt(gfx::Screen::GetCursorScreenPoint()); return ui_controls && ui_controls->SendMouseClick(type); } |