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

Unified Diff: ash/wm/workspace/workspace_manager.cc

Issue 9699013: MonitorManager to manage multiple monitors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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
Index: ash/wm/workspace/workspace_manager.cc
diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc
index 1aaa8d0008cf1133752b00fb3e192045cd943a45..a9093fb81d538b620b9a9185688de25f4e0ca889 100644
--- a/ash/wm/workspace/workspace_manager.cc
+++ b/ash/wm/workspace/workspace_manager.cc
@@ -18,8 +18,11 @@
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/stl_util.h"
+#include "ui/aura/env.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/compositor/layer.h"
@@ -157,7 +160,7 @@ void WorkspaceManager::SetWorkspaceSize(const gfx::Size& workspace_size) {
SetWorkspaceBounds();
}
-void WorkspaceManager::OnScreenWorkAreaInsetsChanged() {
+void WorkspaceManager::OnMonitorWorkAreaInsetsChanged() {
SetWorkspaceBounds();
}
@@ -286,9 +289,13 @@ void WorkspaceManager::SetActiveWorkspace(Workspace* workspace) {
is_overview_ = false;
}
-gfx::Rect WorkspaceManager::GetWorkAreaBounds() {
+gfx::Rect WorkspaceManager::GetWorkAreaBounds() const {
gfx::Rect bounds(workspace_size_);
- bounds.Inset(Shell::GetInstance()->screen()->work_area_insets());
+ const aura::MonitorManager* monitor_manager =
+ aura::Env::GetInstance()->monitor_manager();
+ const aura::Monitor* monitor =
+ monitor_manager->GetMonitorNearestWindow(contents_view_);
+ bounds.Inset(monitor->work_area_insets());
return bounds;
}

Powered by Google App Engine
This is Rietveld 408576698