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

Unified Diff: ash/monitor/monitor_controller.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 8 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/monitor/monitor_controller.cc
diff --git a/ash/monitor/monitor_controller.cc b/ash/monitor/monitor_controller.cc
index 3ebfea4877601869e060c759a113a21eda047e24..167a28c1df8407d88bbfabfdb3109c9ef416d3c4 100644
--- a/ash/monitor/monitor_controller.cc
+++ b/ash/monitor/monitor_controller.cc
@@ -13,9 +13,9 @@
#include "base/stl_util.h"
#include "base/time.h"
#include "ui/aura/env.h"
-#include "ui/aura/monitor.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/gfx/monitor.h"
namespace ash {
namespace internal {
@@ -46,18 +46,19 @@ MonitorController::MonitorController() {
MonitorController::~MonitorController() {
aura::Env::GetInstance()->monitor_manager()->RemoveObserver(this);
// Remove the root first.
- aura::Monitor* monitor = Shell::GetRootWindow()->GetProperty(kMonitorKey);
+ gfx::Monitor* monitor = Shell::GetRootWindow()->GetProperty(kMonitorKey);
DCHECK(monitor);
root_windows_.erase(monitor);
STLDeleteContainerPairSecondPointers(
root_windows_.begin(), root_windows_.end());
}
-void MonitorController::OnMonitorBoundsChanged(const aura::Monitor* monitor) {
+void MonitorController::OnMonitorBoundsChanged(
+ const gfx::Monitor* monitor) {
root_windows_[monitor]->SetHostBounds(monitor->bounds());
}
-void MonitorController::OnMonitorAdded(aura::Monitor* monitor) {
+void MonitorController::OnMonitorAdded(gfx::Monitor* monitor) {
if (root_windows_.empty()) {
root_windows_[monitor] = Shell::GetRootWindow();
Shell::GetRootWindow()->SetHostBounds(monitor->bounds());
@@ -69,7 +70,7 @@ void MonitorController::OnMonitorAdded(aura::Monitor* monitor) {
SetupAsSecondaryMonitor(root);
}
-void MonitorController::OnMonitorRemoved(const aura::Monitor* monitor) {
+void MonitorController::OnMonitorRemoved(const gfx::Monitor* monitor) {
aura::RootWindow* root = root_windows_[monitor];
DCHECK(root);
// Primary monitor should never be removed by MonitorManager.
@@ -86,16 +87,15 @@ void MonitorController::Init() {
aura::MonitorManager* monitor_manager =
aura::Env::GetInstance()->monitor_manager();
for (size_t i = 0; i < monitor_manager->GetNumMonitors(); ++i) {
- aura::Monitor* monitor = monitor_manager->GetMonitorAt(i);
- const aura::Monitor* key = monitor;
+ gfx::Monitor* monitor = monitor_manager->GetMonitorAt(i);
if (i == 0) {
// Primary monitor
- root_windows_[key] = Shell::GetRootWindow();
+ root_windows_[monitor] = Shell::GetRootWindow();
Shell::GetRootWindow()->SetHostBounds(monitor->bounds());
} else {
aura::RootWindow* root =
monitor_manager->CreateRootWindowForMonitor(monitor);
- root_windows_[key] = root;
+ root_windows_[monitor] = root;
SetupAsSecondaryMonitor(root);
}
}

Powered by Google App Engine
This is Rietveld 408576698