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

Unified Diff: ash/screen_ash.cc

Issue 10533041: Remove root window from screen_ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « ash/screen_ash.h ('k') | ash/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/screen_ash.cc
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc
index ed83c46d4501f1e2746cafe4d47d7bcd8e9f7612..c7d9cb94187e2fa0ade73b2f86f9204588cf84ac 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() {
« no previous file with comments | « ash/screen_ash.h ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698