| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "ash/shelf/app_list_shelf_item_delegate.h" | 57 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 58 #include "ash/shelf/shelf.h" | 58 #include "ash/shelf/shelf.h" |
| 59 #include "ash/shelf/shelf_delegate.h" | 59 #include "ash/shelf/shelf_delegate.h" |
| 60 #include "ash/shelf/shelf_widget.h" | 60 #include "ash/shelf/shelf_widget.h" |
| 61 #include "ash/shelf/shelf_window_watcher.h" | 61 #include "ash/shelf/shelf_window_watcher.h" |
| 62 #include "ash/shell_delegate.h" | 62 #include "ash/shell_delegate.h" |
| 63 #include "ash/shell_factory.h" | 63 #include "ash/shell_factory.h" |
| 64 #include "ash/shell_init_params.h" | 64 #include "ash/shell_init_params.h" |
| 65 #include "ash/system/status_area_widget.h" | 65 #include "ash/system/status_area_widget.h" |
| 66 #include "ash/system/toast/toast_manager.h" | 66 #include "ash/system/toast/toast_manager.h" |
| 67 #include "ash/system/tray/system_tray_notifier.h" | |
| 68 #include "ash/utility/screenshot_controller.h" | 67 #include "ash/utility/screenshot_controller.h" |
| 69 #include "ash/wm/ash_focus_rules.h" | 68 #include "ash/wm/ash_focus_rules.h" |
| 70 #include "ash/wm/ash_native_cursor_manager.h" | 69 #include "ash/wm/ash_native_cursor_manager.h" |
| 71 #include "ash/wm/event_client_impl.h" | 70 #include "ash/wm/event_client_impl.h" |
| 72 #include "ash/wm/lock_state_controller.h" | 71 #include "ash/wm/lock_state_controller.h" |
| 73 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 72 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 74 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" | 73 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
| 75 #include "ash/wm/overlay_event_filter.h" | 74 #include "ash/wm/overlay_event_filter.h" |
| 76 #include "ash/wm/overview/scoped_overview_animation_settings_factory_aura.h" | 75 #include "ash/wm/overview/scoped_overview_animation_settings_factory_aura.h" |
| 77 #include "ash/wm/power_button_controller.h" | 76 #include "ash/wm/power_button_controller.h" |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 window_tree_host_manager_->CloseChildWindows(); | 738 window_tree_host_manager_->CloseChildWindows(); |
| 740 // MruWindowTracker must be destroyed after all windows have been deleted to | 739 // MruWindowTracker must be destroyed after all windows have been deleted to |
| 741 // avoid a possible crash when Shell is destroyed from a non-normal shutdown | 740 // avoid a possible crash when Shell is destroyed from a non-normal shutdown |
| 742 // path. (crbug.com/485438). | 741 // path. (crbug.com/485438). |
| 743 wm_shell_common_->DeleteMruWindowTracker(); | 742 wm_shell_common_->DeleteMruWindowTracker(); |
| 744 | 743 |
| 745 // Chrome implementation of shelf delegate depends on FocusClient, | 744 // Chrome implementation of shelf delegate depends on FocusClient, |
| 746 // so must be deleted before |focus_client_| (below). | 745 // so must be deleted before |focus_client_| (below). |
| 747 shelf_delegate_.reset(); | 746 shelf_delegate_.reset(); |
| 748 | 747 |
| 749 // Destroy SystemTrayNotifier after destroying SystemTray as TrayItems | |
| 750 // needs to remove observers from it. | |
| 751 system_tray_notifier_.reset(); | |
| 752 | |
| 753 // These need a valid Shell instance to clean up properly, so explicitly | 748 // These need a valid Shell instance to clean up properly, so explicitly |
| 754 // delete them before invalidating the instance. | 749 // delete them before invalidating the instance. |
| 755 // Alphabetical. TODO(oshima): sort. | 750 // Alphabetical. TODO(oshima): sort. |
| 756 magnification_controller_.reset(); | 751 magnification_controller_.reset(); |
| 757 partial_magnification_controller_.reset(); | 752 partial_magnification_controller_.reset(); |
| 758 tooltip_controller_.reset(); | 753 tooltip_controller_.reset(); |
| 759 event_client_.reset(); | 754 event_client_.reset(); |
| 760 toplevel_window_event_handler_.reset(); | 755 toplevel_window_event_handler_.reset(); |
| 761 visibility_controller_.reset(); | 756 visibility_controller_.reset(); |
| 762 // |shelf_item_delegate_manager_| observes |shelf_model_|. It must be | 757 // |shelf_item_delegate_manager_| observes |shelf_model_|. It must be |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate()); | 1041 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate()); |
| 1047 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); | 1042 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); |
| 1048 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); | 1043 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); |
| 1049 media_delegate_.reset(delegate_->CreateMediaDelegate()); | 1044 media_delegate_.reset(delegate_->CreateMediaDelegate()); |
| 1050 pointer_watcher_delegate_ = delegate_->CreatePointerWatcherDelegate(); | 1045 pointer_watcher_delegate_ = delegate_->CreatePointerWatcherDelegate(); |
| 1051 | 1046 |
| 1052 resize_shadow_controller_.reset(new ResizeShadowController()); | 1047 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 1053 shadow_controller_.reset( | 1048 shadow_controller_.reset( |
| 1054 new ::wm::ShadowController(activation_client_)); | 1049 new ::wm::ShadowController(activation_client_)); |
| 1055 | 1050 |
| 1056 // Create system_tray_notifier_ before the delegate. | |
| 1057 system_tray_notifier_.reset(new SystemTrayNotifier()); | |
| 1058 | |
| 1059 SystemTrayDelegate* system_tray_delegate = | 1051 SystemTrayDelegate* system_tray_delegate = |
| 1060 delegate()->CreateSystemTrayDelegate(); | 1052 delegate()->CreateSystemTrayDelegate(); |
| 1061 DCHECK(system_tray_delegate); | 1053 DCHECK(system_tray_delegate); |
| 1062 wm_shell_->SetSystemTrayDelegate(base::WrapUnique(system_tray_delegate)); | 1054 wm_shell_->SetSystemTrayDelegate(base::WrapUnique(system_tray_delegate)); |
| 1063 | 1055 |
| 1064 locale_notification_controller_.reset(new LocaleNotificationController); | 1056 locale_notification_controller_.reset(new LocaleNotificationController); |
| 1065 | 1057 |
| 1066 // Initialize toast manager | 1058 // Initialize toast manager |
| 1067 toast_manager_.reset(new ToastManager); | 1059 toast_manager_.reset(new ToastManager); |
| 1068 | 1060 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 | 1203 |
| 1212 void Shell::OnWindowActivated( | 1204 void Shell::OnWindowActivated( |
| 1213 aura::client::ActivationChangeObserver::ActivationReason reason, | 1205 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1214 aura::Window* gained_active, | 1206 aura::Window* gained_active, |
| 1215 aura::Window* lost_active) { | 1207 aura::Window* lost_active) { |
| 1216 if (gained_active) | 1208 if (gained_active) |
| 1217 target_root_window_ = gained_active->GetRootWindow(); | 1209 target_root_window_ = gained_active->GetRootWindow(); |
| 1218 } | 1210 } |
| 1219 | 1211 |
| 1220 } // namespace ash | 1212 } // namespace ash |
| OLD | NEW |