| 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/session/session_controller.h" | 10 #include "ash/common/session/session_controller.h" |
| 11 #include "ash/common/session/session_state_delegate.h" | 11 #include "ash/common/session/session_state_delegate.h" |
| 12 #include "ash/common/shelf/app_list_shelf_item_delegate.h" | 12 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |
| 13 #include "ash/common/shell_delegate.h" | 13 #include "ash/common/shell_delegate.h" |
| 14 #include "ash/common/shutdown_controller.h" | |
| 15 #include "ash/common/system/chromeos/network/vpn_list.h" | |
| 16 #include "ash/common/system/tray/system_tray_notifier.h" | |
| 17 #include "ash/common/wm/overview/window_selector_controller.h" | |
| 18 #include "ash/common/wm/root_window_finder.h" | 14 #include "ash/common/wm/root_window_finder.h" |
| 19 #include "ash/common/wm/system_modal_container_layout_manager.h" | 15 #include "ash/common/wm/system_modal_container_layout_manager.h" |
| 20 #include "ash/common/wm/window_cycle_controller.h" | |
| 21 #include "ash/common/wm_window.h" | 16 #include "ash/common/wm_window.h" |
| 22 #include "ash/public/cpp/shell_window_ids.h" | 17 #include "ash/public/cpp/shell_window_ids.h" |
| 23 #include "ash/root_window_controller.h" | 18 #include "ash/root_window_controller.h" |
| 24 #include "ash/shell.h" | 19 #include "ash/shell.h" |
| 25 #include "base/bind.h" | 20 #include "base/bind.h" |
| 26 #include "base/logging.h" | 21 #include "base/logging.h" |
| 27 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
| 28 #include "ui/display/display.h" | 23 #include "ui/display/display.h" |
| 29 | 24 |
| 30 namespace ash { | 25 namespace ash { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 59 } |
| 65 | 60 |
| 66 void WmShell::AddLockStateObserver(LockStateObserver* observer) { | 61 void WmShell::AddLockStateObserver(LockStateObserver* observer) { |
| 67 lock_state_observers_.AddObserver(observer); | 62 lock_state_observers_.AddObserver(observer); |
| 68 } | 63 } |
| 69 | 64 |
| 70 void WmShell::RemoveLockStateObserver(LockStateObserver* observer) { | 65 void WmShell::RemoveLockStateObserver(LockStateObserver* observer) { |
| 71 lock_state_observers_.RemoveObserver(observer); | 66 lock_state_observers_.RemoveObserver(observer); |
| 72 } | 67 } |
| 73 | 68 |
| 74 WmShell::WmShell() | 69 WmShell::WmShell() { |
| 75 : shutdown_controller_(base::MakeUnique<ShutdownController>()), | |
| 76 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), | |
| 77 vpn_list_(base::MakeUnique<VpnList>()), | |
| 78 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), | |
| 79 window_selector_controller_( | |
| 80 base::MakeUnique<WindowSelectorController>()) { | |
| 81 DCHECK(!instance_); | 70 DCHECK(!instance_); |
| 82 instance_ = this; | 71 instance_ = this; |
| 83 } | 72 } |
| 84 | 73 |
| 85 RootWindowController* WmShell::GetPrimaryRootWindowController() { | 74 RootWindowController* WmShell::GetPrimaryRootWindowController() { |
| 86 return GetPrimaryRootWindow()->GetRootWindowController(); | 75 return GetPrimaryRootWindow()->GetRootWindowController(); |
| 87 } | 76 } |
| 88 | 77 |
| 89 bool WmShell::IsForceMaximizeOnFirstRun() { | 78 bool WmShell::IsForceMaximizeOnFirstRun() { |
| 90 return Shell::Get()->shell_delegate()->IsForceMaximizeOnFirstRun(); | 79 return Shell::Get()->shell_delegate()->IsForceMaximizeOnFirstRun(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return; | 116 return; |
| 128 } | 117 } |
| 129 } | 118 } |
| 130 for (WmWindow* root_window : root_windows) { | 119 for (WmWindow* root_window : root_windows) { |
| 131 root_window->GetRootWindowController() | 120 root_window->GetRootWindowController() |
| 132 ->GetSystemModalLayoutManager(removed) | 121 ->GetSystemModalLayoutManager(removed) |
| 133 ->DestroyModalBackground(); | 122 ->DestroyModalBackground(); |
| 134 } | 123 } |
| 135 } | 124 } |
| 136 | 125 |
| 137 void WmShell::DeleteWindowCycleController() { | |
| 138 window_cycle_controller_.reset(); | |
| 139 } | |
| 140 | |
| 141 void WmShell::DeleteWindowSelectorController() { | |
| 142 window_selector_controller_.reset(); | |
| 143 } | |
| 144 | |
| 145 } // namespace ash | 126 } // namespace ash |
| OLD | NEW |