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

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: fix command line 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..5565b6dc8053fe0ed9e0175f7f8b94b34c4a5637 100644
--- a/ash/monitor/monitor_controller.cc
+++ b/ash/monitor/monitor_controller.cc
@@ -13,7 +13,7 @@
#include "base/stl_util.h"
#include "base/time.h"
#include "ui/aura/env.h"
-#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_aura.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -46,30 +46,33 @@ MonitorController::MonitorController() {
MonitorController::~MonitorController() {
aura::Env::GetInstance()->monitor_manager()->RemoveObserver(this);
// Remove the root first.
- aura::Monitor* monitor = Shell::GetRootWindow()->GetProperty(kMonitorKey);
+ aura::MonitorAura* 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) {
- root_windows_[monitor]->SetHostBounds(monitor->bounds());
+void MonitorController::OnMonitorBoundsChanged(const gfx::Monitor* monitor) {
+ const aura::MonitorAura* monitor_aura =
+ static_cast<const aura::MonitorAura*>(monitor);
+ root_windows_[monitor]->SetHostBounds(monitor_aura->bounds());
}
-void MonitorController::OnMonitorAdded(aura::Monitor* monitor) {
+void MonitorController::OnMonitorAdded(gfx::Monitor* monitor) {
+ aura::MonitorAura* monitor_aura = static_cast<aura::MonitorAura*>(monitor);
if (root_windows_.empty()) {
root_windows_[monitor] = Shell::GetRootWindow();
- Shell::GetRootWindow()->SetHostBounds(monitor->bounds());
+ Shell::GetRootWindow()->SetHostBounds(monitor_aura->bounds());
return;
}
aura::RootWindow* root = aura::Env::GetInstance()->monitor_manager()->
- CreateRootWindowForMonitor(monitor);
+ CreateRootWindowForMonitor(monitor_aura);
root_windows_[monitor] = root;
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,8 +89,8 @@ 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;
+ aura::MonitorAura* monitor = monitor_manager->GetMonitorAt(i);
+ const gfx::Monitor* key = monitor;
if (i == 0) {
// Primary monitor
root_windows_[key] = Shell::GetRootWindow();

Powered by Google App Engine
This is Rietveld 408576698