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

Unified Diff: ash/shell.cc

Issue 9689027: MonitorManager to manage multiple monitors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync 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
« no previous file with comments | « ash/shell.h ('k') | ash/shell_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index ad8f835c7ec6319f924cd0e2da9d30dc5028c5af..39ade22bb1987568fcd769c59d57dce6b4eeb59a 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -57,12 +57,14 @@
#include "base/command_line.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
-#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
#include "ui/views/widget/native_widget_aura.h"
#include "ui/views/widget/widget.h"
@@ -318,6 +320,8 @@ Shell::Shell(ShellDelegate* delegate)
desktop_background_mode_(BACKGROUND_IMAGE),
root_window_layout_(NULL),
status_widget_(NULL) {
+ aura::Env::GetInstance()->SetMonitorManager(
+ aura::CreateSingleMonitorManager(root_window_.get()));
gfx::Screen::SetInstance(screen_);
}
@@ -600,12 +604,15 @@ void Shell::RotateFocus(Direction direction) {
internal::FocusCycler::BACKWARD);
}
-void Shell::SetScreenWorkAreaInsets(const gfx::Insets& insets) {
- if (screen_->work_area_insets() == insets)
+void Shell::SetMonitorWorkAreaInsets(Window* contains,
+ const gfx::Insets& insets) {
+ aura::Monitor* monitor = aura::Env::GetInstance()->monitor_manager()->
+ GetMonitorNearestWindow(contains);
+ if (monitor->work_area_insets() == insets)
return;
- screen_->set_work_area_insets(insets);
+ monitor->set_work_area_insets(insets);
FOR_EACH_OBSERVER(ShellObserver, observers_,
- OnScreenWorkAreaInsetsChanged());
+ OnMonitorWorkAreaInsetsChanged());
}
void Shell::AddShellObserver(ShellObserver* observer) {
« no previous file with comments | « ash/shell.h ('k') | ash/shell_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698