diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 05:37:06 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 05:37:06 +0000 |
commit | af5e62c35a97eec03b64701aa31024b8c139b836 (patch) | |
tree | 85512a3a2d9431f974cd19599ecc49caca7a94b1 /ash/screen_ash.cc | |
parent | 17a4590ac157a558caa64bce6e309da103e93133 (diff) | |
download | chromium_src-af5e62c35a97eec03b64701aa31024b8c139b836.zip chromium_src-af5e62c35a97eec03b64701aa31024b8c139b836.tar.gz chromium_src-af5e62c35a97eec03b64701aa31024b8c139b836.tar.bz2 |
Remove root window from screen_ash
BUG=123160
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10533041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141176 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/screen_ash.cc')
-rw-r--r-- | ash/screen_ash.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc index ed83c46..c7d9cb9 100644 --- a/ash/screen_ash.cc +++ b/ash/screen_ash.cc @@ -21,8 +21,7 @@ aura::MonitorManager* GetMonitorManager() { } } // namespace -ScreenAsh::ScreenAsh(aura::RootWindow* root_window) - : root_window_(root_window) { +ScreenAsh::ScreenAsh() { } ScreenAsh::~ScreenAsh() { @@ -30,21 +29,29 @@ ScreenAsh::~ScreenAsh() { // static gfx::Rect ScreenAsh::GetMaximizedWindowBounds(aura::Window* window) { - return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); + if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) + return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); + else + return gfx::Screen::GetMonitorNearestWindow(window).bounds(); } // static gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBounds(aura::Window* window) { - return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); + if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) + return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); + else + return gfx::Screen::GetMonitorNearestWindow(window).work_area(); } gfx::Point ScreenAsh::GetCursorScreenPoint() { - return root_window_->last_mouse_location(); + // TODO(oshima): Support multiple root window. + return Shell::GetPrimaryRootWindow()->last_mouse_location(); } gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); - return root_window_->GetTopWindowContainingPoint(point); + // TODO(oshima): convert point to relateive to the root window. + return Shell::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); } int ScreenAsh::GetNumMonitors() { |