| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/wm_shell.h" | 5 #include "ash/common/wm_shell.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/accelerators/ash_focus_manager_factory.h" | 10 #include "ash/common/accelerators/ash_focus_manager_factory.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 window_cycle_controller_(new WindowCycleController), | 137 window_cycle_controller_(new WindowCycleController), |
| 138 window_selector_controller_(new WindowSelectorController) { | 138 window_selector_controller_(new WindowSelectorController) { |
| 139 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
| 140 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos); | 140 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos); |
| 141 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController); | 141 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController); |
| 142 #endif | 142 #endif |
| 143 } | 143 } |
| 144 | 144 |
| 145 WmShell::~WmShell() {} | 145 WmShell::~WmShell() {} |
| 146 | 146 |
| 147 WmWindow* WmShell::GetRootWindowForNewWindows() { |
| 148 if (scoped_root_window_for_new_windows_) |
| 149 return scoped_root_window_for_new_windows_; |
| 150 return root_window_for_new_windows_; |
| 151 } |
| 152 |
| 147 bool WmShell::IsSystemModalWindowOpen() { | 153 bool WmShell::IsSystemModalWindowOpen() { |
| 148 if (simulate_modal_window_open_for_testing_) | 154 if (simulate_modal_window_open_for_testing_) |
| 149 return true; | 155 return true; |
| 150 | 156 |
| 151 // Traverse all system modal containers, and find its direct child window | 157 // Traverse all system modal containers, and find its direct child window |
| 152 // with "SystemModal" setting, and visible. | 158 // with "SystemModal" setting, and visible. |
| 153 for (WmWindow* root : GetAllRootWindows()) { | 159 for (WmWindow* root : GetAllRootWindows()) { |
| 154 WmWindow* system_modal = | 160 WmWindow* system_modal = |
| 155 root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); | 161 root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); |
| 156 if (!system_modal) | 162 if (!system_modal) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 void WmShell::DeleteToastManager() { | 261 void WmShell::DeleteToastManager() { |
| 256 toast_manager_.reset(); | 262 toast_manager_.reset(); |
| 257 } | 263 } |
| 258 | 264 |
| 259 void WmShell::SetAcceleratorController( | 265 void WmShell::SetAcceleratorController( |
| 260 std::unique_ptr<AcceleratorController> accelerator_controller) { | 266 std::unique_ptr<AcceleratorController> accelerator_controller) { |
| 261 accelerator_controller_ = std::move(accelerator_controller); | 267 accelerator_controller_ = std::move(accelerator_controller); |
| 262 } | 268 } |
| 263 | 269 |
| 264 } // namespace ash | 270 } // namespace ash |
| OLD | NEW |