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 |
11 #include "ash/accelerators/accelerator_controller.h" | 11 #include "ash/accelerators/accelerator_controller.h" |
12 #include "ash/accelerators/accelerator_delegate.h" | 12 #include "ash/accelerators/accelerator_delegate.h" |
13 #include "ash/accelerators/focus_manager_factory.h" | 13 #include "ash/accelerators/focus_manager_factory.h" |
14 #include "ash/aura/wm_shell_aura.h" | 14 #include "ash/aura/wm_shell_aura.h" |
15 #include "ash/aura/wm_window_aura.h" | 15 #include "ash/aura/wm_window_aura.h" |
16 #include "ash/autoclick/autoclick_controller.h" | 16 #include "ash/autoclick/autoclick_controller.h" |
17 #include "ash/common/accessibility_delegate.h" | |
18 #include "ash/common/ash_switches.h" | 17 #include "ash/common/ash_switches.h" |
19 #include "ash/common/gpu_support.h" | 18 #include "ash/common/gpu_support.h" |
20 #include "ash/common/keyboard/keyboard_ui.h" | 19 #include "ash/common/keyboard/keyboard_ui.h" |
21 #include "ash/common/login_status.h" | 20 #include "ash/common/login_status.h" |
22 #include "ash/common/pointer_watcher_delegate.h" | 21 #include "ash/common/pointer_watcher_delegate.h" |
23 #include "ash/common/session/session_state_delegate.h" | 22 #include "ash/common/session/session_state_delegate.h" |
24 #include "ash/common/shelf/shelf_item_delegate.h" | 23 #include "ash/common/shelf/shelf_item_delegate.h" |
25 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 24 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
26 #include "ash/common/shelf/shelf_model.h" | 25 #include "ash/common/shelf/shelf_model.h" |
27 #include "ash/common/shell_delegate.h" | 26 #include "ash/common/shell_delegate.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 audio_a11y_controller_.reset(); | 756 audio_a11y_controller_.reset(); |
758 #endif // defined(OS_CHROMEOS) | 757 #endif // defined(OS_CHROMEOS) |
759 | 758 |
760 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 759 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
761 // WindowTreeHostManager before resetting |window_tree_host_manager_|, since | 760 // WindowTreeHostManager before resetting |window_tree_host_manager_|, since |
762 // destruction | 761 // destruction |
763 // of its owned RootWindowControllers relies on the value. | 762 // of its owned RootWindowControllers relies on the value. |
764 display_manager_->CreateScreenForShutdown(); | 763 display_manager_->CreateScreenForShutdown(); |
765 display_configuration_controller_.reset(); | 764 display_configuration_controller_.reset(); |
766 | 765 |
767 wm_shell_->PrepareForShutdown(); | 766 wm_shell_->Shutdown(); |
768 // Depends on |focus_client_|, so must be destroyed before. | 767 // Depends on |focus_client_|, so must be destroyed before. |
769 window_tree_host_manager_->Shutdown(); | 768 window_tree_host_manager_->Shutdown(); |
770 window_tree_host_manager_.reset(); | 769 window_tree_host_manager_.reset(); |
771 focus_client_.reset(); | 770 focus_client_.reset(); |
772 screen_position_controller_.reset(); | 771 screen_position_controller_.reset(); |
773 accessibility_delegate_.reset(); | |
774 new_window_delegate_.reset(); | 772 new_window_delegate_.reset(); |
775 pointer_watcher_delegate_.reset(); | 773 pointer_watcher_delegate_.reset(); |
776 | 774 |
777 keyboard::KeyboardController::ResetInstance(nullptr); | 775 keyboard::KeyboardController::ResetInstance(nullptr); |
778 | 776 |
779 #if defined(OS_CHROMEOS) | 777 #if defined(OS_CHROMEOS) |
780 display_color_manager_.reset(); | 778 display_color_manager_.reset(); |
781 if (display_change_observer_) | 779 if (display_change_observer_) |
782 display_configurator_->RemoveObserver(display_change_observer_.get()); | 780 display_configurator_->RemoveObserver(display_change_observer_.get()); |
783 if (display_error_observer_) | 781 if (display_error_observer_) |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 event_client_.reset(new EventClientImpl); | 1006 event_client_.reset(new EventClientImpl); |
1009 | 1007 |
1010 // This controller needs to be set before SetupManagedWindowMode. | 1008 // This controller needs to be set before SetupManagedWindowMode. |
1011 desktop_background_controller_.reset( | 1009 desktop_background_controller_.reset( |
1012 new DesktopBackgroundController(blocking_pool_)); | 1010 new DesktopBackgroundController(blocking_pool_)); |
1013 user_wallpaper_delegate_.reset( | 1011 user_wallpaper_delegate_.reset( |
1014 wm_shell_->delegate()->CreateUserWallpaperDelegate()); | 1012 wm_shell_->delegate()->CreateUserWallpaperDelegate()); |
1015 | 1013 |
1016 session_state_delegate_.reset( | 1014 session_state_delegate_.reset( |
1017 wm_shell_->delegate()->CreateSessionStateDelegate()); | 1015 wm_shell_->delegate()->CreateSessionStateDelegate()); |
1018 accessibility_delegate_.reset( | |
1019 wm_shell_->delegate()->CreateAccessibilityDelegate()); | |
1020 new_window_delegate_.reset(wm_shell_->delegate()->CreateNewWindowDelegate()); | 1016 new_window_delegate_.reset(wm_shell_->delegate()->CreateNewWindowDelegate()); |
1021 pointer_watcher_delegate_ = | 1017 pointer_watcher_delegate_ = |
1022 wm_shell_->delegate()->CreatePointerWatcherDelegate(); | 1018 wm_shell_->delegate()->CreatePointerWatcherDelegate(); |
1023 | 1019 |
1024 resize_shadow_controller_.reset(new ResizeShadowController()); | 1020 resize_shadow_controller_.reset(new ResizeShadowController()); |
1025 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); | 1021 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); |
1026 | 1022 |
1027 wm_shell_->SetSystemTrayDelegate( | 1023 wm_shell_->SetSystemTrayDelegate( |
1028 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); | 1024 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); |
1029 | 1025 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 | 1163 |
1168 void Shell::OnWindowActivated( | 1164 void Shell::OnWindowActivated( |
1169 aura::client::ActivationChangeObserver::ActivationReason reason, | 1165 aura::client::ActivationChangeObserver::ActivationReason reason, |
1170 aura::Window* gained_active, | 1166 aura::Window* gained_active, |
1171 aura::Window* lost_active) { | 1167 aura::Window* lost_active) { |
1172 if (gained_active) | 1168 if (gained_active) |
1173 target_root_window_ = gained_active->GetRootWindow(); | 1169 target_root_window_ = gained_active->GetRootWindow(); |
1174 } | 1170 } |
1175 | 1171 |
1176 } // namespace ash | 1172 } // namespace ash |
OLD | NEW |