| 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/aura/wm_shell_aura.h" | 5 #include "ash/aura/wm_shell_aura.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 WmShellAura::WmShellAura(std::unique_ptr<ShellDelegate> shell_delegate) | 43 WmShellAura::WmShellAura(std::unique_ptr<ShellDelegate> shell_delegate) |
| 44 : WmShell(std::move(shell_delegate)) { | 44 : WmShell(std::move(shell_delegate)) { |
| 45 WmShell::Set(this); | 45 WmShell::Set(this); |
| 46 } | 46 } |
| 47 | 47 |
| 48 WmShellAura::~WmShellAura() { | 48 WmShellAura::~WmShellAura() { |
| 49 WmShell::Set(nullptr); | 49 WmShell::Set(nullptr); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WmShellAura::PrepareForShutdown() { | 52 void WmShellAura::Shutdown() { |
| 53 if (added_activation_observer_) | 53 if (added_activation_observer_) |
| 54 Shell::GetInstance()->activation_client()->RemoveObserver(this); | 54 Shell::GetInstance()->activation_client()->RemoveObserver(this); |
| 55 | 55 |
| 56 if (added_display_observer_) | 56 if (added_display_observer_) |
| 57 Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); | 57 Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); |
| 58 |
| 59 WmShell::Shutdown(); |
| 58 } | 60 } |
| 59 | 61 |
| 60 WmWindow* WmShellAura::NewContainerWindow() { | 62 WmWindow* WmShellAura::NewContainerWindow() { |
| 61 aura::Window* aura_window = new aura::Window(nullptr); | 63 aura::Window* aura_window = new aura::Window(nullptr); |
| 62 aura_window->Init(ui::LAYER_NOT_DRAWN); | 64 aura_window->Init(ui::LAYER_NOT_DRAWN); |
| 63 return WmWindowAura::Get(aura_window); | 65 return WmWindowAura::Get(aura_window); |
| 64 } | 66 } |
| 65 | 67 |
| 66 WmWindow* WmShellAura::GetFocusedWindow() { | 68 WmWindow* WmShellAura::GetFocusedWindow() { |
| 67 return WmWindowAura::Get( | 69 return WmWindowAura::Get( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 158 |
| 157 void WmShellAura::OnOverviewModeStarting() { | 159 void WmShellAura::OnOverviewModeStarting() { |
| 158 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), | 160 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), |
| 159 OnOverviewModeStarting()); | 161 OnOverviewModeStarting()); |
| 160 } | 162 } |
| 161 | 163 |
| 162 void WmShellAura::OnOverviewModeEnded() { | 164 void WmShellAura::OnOverviewModeEnded() { |
| 163 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded()); | 165 FOR_EACH_OBSERVER(ShellObserver, *shell_observers(), OnOverviewModeEnded()); |
| 164 } | 166 } |
| 165 | 167 |
| 166 AccessibilityDelegate* WmShellAura::GetAccessibilityDelegate() { | |
| 167 return Shell::GetInstance()->accessibility_delegate(); | |
| 168 } | |
| 169 | |
| 170 SessionStateDelegate* WmShellAura::GetSessionStateDelegate() { | 168 SessionStateDelegate* WmShellAura::GetSessionStateDelegate() { |
| 171 return Shell::GetInstance()->session_state_delegate(); | 169 return Shell::GetInstance()->session_state_delegate(); |
| 172 } | 170 } |
| 173 | 171 |
| 174 void WmShellAura::AddActivationObserver(WmActivationObserver* observer) { | 172 void WmShellAura::AddActivationObserver(WmActivationObserver* observer) { |
| 175 if (!added_activation_observer_) { | 173 if (!added_activation_observer_) { |
| 176 added_activation_observer_ = true; | 174 added_activation_observer_ = true; |
| 177 Shell::GetInstance()->activation_client()->AddObserver(this); | 175 Shell::GetInstance()->activation_client()->AddObserver(this); |
| 178 } | 176 } |
| 179 activation_observers_.AddObserver(observer); | 177 activation_observers_.AddObserver(observer); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 230 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, |
| 233 OnDisplayConfigurationChanging()); | 231 OnDisplayConfigurationChanging()); |
| 234 } | 232 } |
| 235 | 233 |
| 236 void WmShellAura::OnDisplayConfigurationChanged() { | 234 void WmShellAura::OnDisplayConfigurationChanged() { |
| 237 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 235 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, |
| 238 OnDisplayConfigurationChanged()); | 236 OnDisplayConfigurationChanged()); |
| 239 } | 237 } |
| 240 | 238 |
| 241 } // namespace ash | 239 } // namespace ash |
| OLD | NEW |