| 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 10 matching lines...) Expand all Loading... |
| 21 #include "ash/common/login_status.h" | 21 #include "ash/common/login_status.h" |
| 22 #include "ash/common/pointer_down_watcher_delegate.h" | 22 #include "ash/common/pointer_down_watcher_delegate.h" |
| 23 #include "ash/common/session/session_state_delegate.h" | 23 #include "ash/common/session/session_state_delegate.h" |
| 24 #include "ash/common/shelf/shelf_item_delegate.h" | 24 #include "ash/common/shelf/shelf_item_delegate.h" |
| 25 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 25 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
| 26 #include "ash/common/shelf/shelf_model.h" | 26 #include "ash/common/shelf/shelf_model.h" |
| 27 #include "ash/common/shell_delegate.h" | 27 #include "ash/common/shell_delegate.h" |
| 28 #include "ash/common/shell_window_ids.h" | 28 #include "ash/common/shell_window_ids.h" |
| 29 #include "ash/common/system/locale/locale_notification_controller.h" | 29 #include "ash/common/system/locale/locale_notification_controller.h" |
| 30 #include "ash/common/system/status_area_widget.h" | 30 #include "ash/common/system/status_area_widget.h" |
| 31 #include "ash/common/system/toast/toast_manager.h" | |
| 32 #include "ash/common/system/tray/system_tray_delegate.h" | 31 #include "ash/common/system/tray/system_tray_delegate.h" |
| 33 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 32 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 34 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 33 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 35 #include "ash/common/wm/mru_window_tracker.h" | 34 #include "ash/common/wm/mru_window_tracker.h" |
| 36 #include "ash/common/wm/root_window_finder.h" | 35 #include "ash/common/wm/root_window_finder.h" |
| 37 #include "ash/common/wm/window_positioner.h" | 36 #include "ash/common/wm/window_positioner.h" |
| 38 #include "ash/common/wm_shell.h" | 37 #include "ash/common/wm_shell.h" |
| 39 #include "ash/desktop_background/desktop_background_controller.h" | 38 #include "ash/desktop_background/desktop_background_controller.h" |
| 40 #include "ash/desktop_background/desktop_background_view.h" | 39 #include "ash/desktop_background/desktop_background_view.h" |
| 41 #include "ash/desktop_background/user_wallpaper_delegate.h" | 40 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 | 668 |
| 670 // Destroy maximize mode controller early on since it has some observers which | 669 // Destroy maximize mode controller early on since it has some observers which |
| 671 // need to be removed. | 670 // need to be removed. |
| 672 wm_shell_->DeleteMaximizeModeController(); | 671 wm_shell_->DeleteMaximizeModeController(); |
| 673 | 672 |
| 674 // Destroy the keyboard before closing the shelf, since it will invoke a shelf | 673 // Destroy the keyboard before closing the shelf, since it will invoke a shelf |
| 675 // layout. | 674 // layout. |
| 676 DeactivateKeyboard(); | 675 DeactivateKeyboard(); |
| 677 | 676 |
| 678 // Destroy toasts | 677 // Destroy toasts |
| 679 toast_manager_.reset(); | 678 wm_shell_->DeleteToastManager(); |
| 680 | 679 |
| 681 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure | 680 // Destroy SystemTrayDelegate before destroying the status area(s). Make sure |
| 682 // to deinitialize the shelf first, as it is initialized after the delegate. | 681 // to deinitialize the shelf first, as it is initialized after the delegate. |
| 683 ShutdownShelf(); | 682 ShutdownShelf(); |
| 684 wm_shell_->DeleteSystemTrayDelegate(); | 683 wm_shell_->DeleteSystemTrayDelegate(); |
| 685 | 684 |
| 686 locale_notification_controller_.reset(); | 685 locale_notification_controller_.reset(); |
| 687 | 686 |
| 688 // Drag-and-drop must be canceled prior to close all windows. | 687 // Drag-and-drop must be canceled prior to close all windows. |
| 689 drag_drop_controller_.reset(); | 688 drag_drop_controller_.reset(); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 wm_shell_->delegate()->CreatePointerDownWatcherDelegate(); | 1019 wm_shell_->delegate()->CreatePointerDownWatcherDelegate(); |
| 1021 | 1020 |
| 1022 resize_shadow_controller_.reset(new ResizeShadowController()); | 1021 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 1023 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); | 1022 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); |
| 1024 | 1023 |
| 1025 wm_shell_->SetSystemTrayDelegate( | 1024 wm_shell_->SetSystemTrayDelegate( |
| 1026 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); | 1025 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); |
| 1027 | 1026 |
| 1028 locale_notification_controller_.reset(new LocaleNotificationController); | 1027 locale_notification_controller_.reset(new LocaleNotificationController); |
| 1029 | 1028 |
| 1030 // Initialize toast manager | |
| 1031 toast_manager_.reset(new ToastManager); | |
| 1032 | |
| 1033 #if defined(OS_CHROMEOS) | 1029 #if defined(OS_CHROMEOS) |
| 1034 // Create TouchTransformerController before | 1030 // Create TouchTransformerController before |
| 1035 // WindowTreeHostManager::InitDisplays() | 1031 // WindowTreeHostManager::InitDisplays() |
| 1036 // since TouchTransformerController listens on | 1032 // since TouchTransformerController listens on |
| 1037 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 1033 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
| 1038 if (!in_mus_) | 1034 if (!in_mus_) |
| 1039 touch_transformer_controller_.reset(new TouchTransformerController()); | 1035 touch_transformer_controller_.reset(new TouchTransformerController()); |
| 1040 #endif // defined(OS_CHROMEOS) | 1036 #endif // defined(OS_CHROMEOS) |
| 1041 | 1037 |
| 1042 wm_shell_->SetKeyboardUI(init_params.keyboard_factory.is_null() | 1038 wm_shell_->SetKeyboardUI(init_params.keyboard_factory.is_null() |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 | 1161 |
| 1166 void Shell::OnWindowActivated( | 1162 void Shell::OnWindowActivated( |
| 1167 aura::client::ActivationChangeObserver::ActivationReason reason, | 1163 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1168 aura::Window* gained_active, | 1164 aura::Window* gained_active, |
| 1169 aura::Window* lost_active) { | 1165 aura::Window* lost_active) { |
| 1170 if (gained_active) | 1166 if (gained_active) |
| 1171 target_root_window_ = gained_active->GetRootWindow(); | 1167 target_root_window_ = gained_active->GetRootWindow(); |
| 1172 } | 1168 } |
| 1173 | 1169 |
| 1174 } // namespace ash | 1170 } // namespace ash |
| OLD | NEW |