| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 // static | 216 // static |
| 217 bool Shell::HasInstance() { | 217 bool Shell::HasInstance() { |
| 218 return !!instance_; | 218 return !!instance_; |
| 219 } | 219 } |
| 220 | 220 |
| 221 // static | 221 // static |
| 222 void Shell::DeleteInstance() { | 222 void Shell::DeleteInstance() { |
| 223 delete instance_; | 223 delete instance_; |
| 224 instance_ = nullptr; | |
| 225 } | 224 } |
| 226 | 225 |
| 227 // static | 226 // static |
| 228 RootWindowController* Shell::GetPrimaryRootWindowController() { | 227 RootWindowController* Shell::GetPrimaryRootWindowController() { |
| 229 CHECK(HasInstance()); | 228 CHECK(HasInstance()); |
| 230 return GetRootWindowController(GetPrimaryRootWindow()); | 229 return GetRootWindowController(GetPrimaryRootWindow()); |
| 231 } | 230 } |
| 232 | 231 |
| 233 // static | 232 // static |
| 234 Shell::RootWindowControllerList Shell::GetAllRootWindowControllers() { | 233 Shell::RootWindowControllerList Shell::GetAllRootWindowControllers() { |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 audio_a11y_controller_.reset(); | 809 audio_a11y_controller_.reset(); |
| 811 #endif // defined(OS_CHROMEOS) | 810 #endif // defined(OS_CHROMEOS) |
| 812 | 811 |
| 813 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 812 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
| 814 // WindowTreeHostManager before resetting |window_tree_host_manager_|, since | 813 // WindowTreeHostManager before resetting |window_tree_host_manager_|, since |
| 815 // destruction | 814 // destruction |
| 816 // of its owned RootWindowControllers relies on the value. | 815 // of its owned RootWindowControllers relies on the value. |
| 817 display_manager_->CreateScreenForShutdown(); | 816 display_manager_->CreateScreenForShutdown(); |
| 818 display_configuration_controller_.reset(); | 817 display_configuration_controller_.reset(); |
| 819 | 818 |
| 819 // Needs to happen before |window_tree_host_manager_|. Calls back to Shell, so |
| 820 // also needs to be destroyed before |instance_| reset to null. |
| 821 wm_globals_.reset(); |
| 822 |
| 820 // Depends on |focus_client_|, so must be destroyed before. | 823 // Depends on |focus_client_|, so must be destroyed before. |
| 821 window_tree_host_manager_->Shutdown(); | 824 window_tree_host_manager_->Shutdown(); |
| 822 window_tree_host_manager_.reset(); | 825 window_tree_host_manager_.reset(); |
| 823 focus_client_.reset(); | 826 focus_client_.reset(); |
| 824 screen_position_controller_.reset(); | 827 screen_position_controller_.reset(); |
| 825 accessibility_delegate_.reset(); | 828 accessibility_delegate_.reset(); |
| 826 new_window_delegate_.reset(); | 829 new_window_delegate_.reset(); |
| 827 media_delegate_.reset(); | 830 media_delegate_.reset(); |
| 828 | 831 |
| 829 keyboard::KeyboardController::ResetInstance(nullptr); | 832 keyboard::KeyboardController::ResetInstance(nullptr); |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 | 1232 |
| 1230 void Shell::OnWindowActivated( | 1233 void Shell::OnWindowActivated( |
| 1231 aura::client::ActivationChangeObserver::ActivationReason reason, | 1234 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1232 aura::Window* gained_active, | 1235 aura::Window* gained_active, |
| 1233 aura::Window* lost_active) { | 1236 aura::Window* lost_active) { |
| 1234 if (gained_active) | 1237 if (gained_active) |
| 1235 target_root_window_ = gained_active->GetRootWindow(); | 1238 target_root_window_ = gained_active->GetRootWindow(); |
| 1236 } | 1239 } |
| 1237 | 1240 |
| 1238 } // namespace ash | 1241 } // namespace ash |
| OLD | NEW |