OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/monitor/monitor_controller.h" | 5 #include "ash/monitor/monitor_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/monitor/multi_monitor_manager.h" | 8 #include "ash/monitor/multi_monitor_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (controller) | 39 if (controller) |
40 delete controller; | 40 delete controller; |
41 else | 41 else |
42 delete it->second; | 42 delete it->second; |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 void MonitorController::InitPrimaryDisplay() { | 46 void MonitorController::InitPrimaryDisplay() { |
47 aura::MonitorManager* monitor_manager = | 47 aura::MonitorManager* monitor_manager = |
48 aura::Env::GetInstance()->monitor_manager(); | 48 aura::Env::GetInstance()->monitor_manager(); |
49 const gfx::Display& display = monitor_manager->GetMonitorAt(0); | 49 const gfx::Display& display = monitor_manager->GetDisplayAt(0); |
50 DCHECK_EQ(0, display.id()); | 50 DCHECK_EQ(0, display.id()); |
51 aura::RootWindow* root = | 51 aura::RootWindow* root = |
52 monitor_manager->CreateRootWindowForMonitor(display); | 52 monitor_manager->CreateRootWindowForMonitor(display); |
53 root_windows_[display.id()] = root; | 53 root_windows_[display.id()] = root; |
54 if (aura::MonitorManager::use_fullscreen_host_window() && | 54 if (aura::MonitorManager::use_fullscreen_host_window() && |
55 !IsExtendedDesktopEnabled()) { | 55 !IsExtendedDesktopEnabled()) { |
56 root->ConfineCursorToWindow(); | 56 root->ConfineCursorToWindow(); |
57 } | 57 } |
58 root->SetHostBounds(display.bounds_in_pixel()); | 58 root->SetHostBounds(display.bounds_in_pixel()); |
59 } | 59 } |
60 | 60 |
61 void MonitorController::InitSecondaryDisplays() { | 61 void MonitorController::InitSecondaryDisplays() { |
62 aura::MonitorManager* monitor_manager = | 62 aura::MonitorManager* monitor_manager = |
63 aura::Env::GetInstance()->monitor_manager(); | 63 aura::Env::GetInstance()->monitor_manager(); |
64 for (size_t i = 1; i < monitor_manager->GetNumMonitors(); ++i) { | 64 for (size_t i = 1; i < monitor_manager->GetNumDisplays(); ++i) { |
65 const gfx::Display& display = monitor_manager->GetMonitorAt(i); | 65 const gfx::Display& display = monitor_manager->GetDisplayAt(i); |
66 aura::RootWindow* root = | 66 aura::RootWindow* root = |
67 monitor_manager->CreateRootWindowForMonitor(display); | 67 monitor_manager->CreateRootWindowForMonitor(display); |
68 root_windows_[display.id()] = root; | 68 root_windows_[display.id()] = root; |
69 Shell::GetInstance()->InitRootWindowForSecondaryMonitor(root); | 69 Shell::GetInstance()->InitRootWindowForSecondaryMonitor(root); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 aura::RootWindow* MonitorController::GetPrimaryRootWindow() { | 73 aura::RootWindow* MonitorController::GetPrimaryRootWindow() { |
74 DCHECK(!root_windows_.empty()); | 74 DCHECK(!root_windows_.empty()); |
75 return root_windows_[0]; | 75 return root_windows_[0]; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 switches::kAshExtendedDesktop); | 161 switches::kAshExtendedDesktop); |
162 } | 162 } |
163 | 163 |
164 // static | 164 // static |
165 void MonitorController::SetExtendedDesktopEnabled(bool enabled) { | 165 void MonitorController::SetExtendedDesktopEnabled(bool enabled) { |
166 extended_desktop_enabled = enabled; | 166 extended_desktop_enabled = enabled; |
167 } | 167 } |
168 | 168 |
169 } // namespace internal | 169 } // namespace internal |
170 } // namespace ash | 170 } // namespace ash |
OLD | NEW |