| 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 20 matching lines...) Expand all Loading... |
| 31 #include "ash/common/palette_delegate.h" | 31 #include "ash/common/palette_delegate.h" |
| 32 #include "ash/common/session/session_controller.h" | 32 #include "ash/common/session/session_controller.h" |
| 33 #include "ash/common/session/session_state_delegate.h" | 33 #include "ash/common/session/session_state_delegate.h" |
| 34 #include "ash/common/shelf/shelf_controller.h" | 34 #include "ash/common/shelf/shelf_controller.h" |
| 35 #include "ash/common/shelf/shelf_delegate.h" | 35 #include "ash/common/shelf/shelf_delegate.h" |
| 36 #include "ash/common/shelf/shelf_model.h" | 36 #include "ash/common/shelf/shelf_model.h" |
| 37 #include "ash/common/shelf/shelf_window_watcher.h" | 37 #include "ash/common/shelf/shelf_window_watcher.h" |
| 38 #include "ash/common/shelf/wm_shelf.h" | 38 #include "ash/common/shelf/wm_shelf.h" |
| 39 #include "ash/common/shell_delegate.h" | 39 #include "ash/common/shell_delegate.h" |
| 40 #include "ash/common/shell_observer.h" | 40 #include "ash/common/shell_observer.h" |
| 41 #include "ash/common/shutdown_controller.h" |
| 41 #include "ash/common/system/brightness_control_delegate.h" | 42 #include "ash/common/system/brightness_control_delegate.h" |
| 42 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller
.h" | 43 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller
.h" |
| 43 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" | 44 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" |
| 44 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h
" | 45 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h
" |
| 45 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" | 46 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" |
| 46 #include "ash/common/system/chromeos/network/sms_observer.h" | 47 #include "ash/common/system/chromeos/network/sms_observer.h" |
| 48 #include "ash/common/system/chromeos/network/vpn_list.h" |
| 47 #include "ash/common/system/chromeos/power/power_status.h" | 49 #include "ash/common/system/chromeos/power/power_status.h" |
| 48 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" | 50 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" |
| 49 #include "ash/common/system/keyboard_brightness_control_delegate.h" | 51 #include "ash/common/system/keyboard_brightness_control_delegate.h" |
| 50 #include "ash/common/system/locale/locale_notification_controller.h" | 52 #include "ash/common/system/locale/locale_notification_controller.h" |
| 51 #include "ash/common/system/status_area_widget.h" | 53 #include "ash/common/system/status_area_widget.h" |
| 52 #include "ash/common/system/toast/toast_manager.h" | 54 #include "ash/common/system/toast/toast_manager.h" |
| 53 #include "ash/common/system/tray/system_tray_controller.h" | 55 #include "ash/common/system/tray/system_tray_controller.h" |
| 54 #include "ash/common/system/tray/system_tray_delegate.h" | 56 #include "ash/common/system/tray/system_tray_delegate.h" |
| 55 #include "ash/common/system/tray/system_tray_notifier.h" | 57 #include "ash/common/system/tray/system_tray_notifier.h" |
| 56 #include "ash/common/wallpaper/wallpaper_controller.h" | 58 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 57 #include "ash/common/wallpaper/wallpaper_delegate.h" | 59 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 58 #include "ash/common/wm/container_finder.h" | 60 #include "ash/common/wm/container_finder.h" |
| 59 #include "ash/common/wm/immersive_context_ash.h" | 61 #include "ash/common/wm/immersive_context_ash.h" |
| 60 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 62 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 61 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 63 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 62 #include "ash/common/wm/mru_window_tracker.h" | 64 #include "ash/common/wm/mru_window_tracker.h" |
| 65 #include "ash/common/wm/overview/window_selector_controller.h" |
| 63 #include "ash/common/wm/root_window_finder.h" | 66 #include "ash/common/wm/root_window_finder.h" |
| 64 #include "ash/common/wm/system_modal_container_layout_manager.h" | 67 #include "ash/common/wm/system_modal_container_layout_manager.h" |
| 68 #include "ash/common/wm/window_cycle_controller.h" |
| 65 #include "ash/common/wm/window_positioner.h" | 69 #include "ash/common/wm/window_positioner.h" |
| 66 #include "ash/common/wm/workspace_controller.h" | 70 #include "ash/common/wm/workspace_controller.h" |
| 67 #include "ash/common/wm_shell.h" | 71 #include "ash/common/wm_shell.h" |
| 68 #include "ash/common/wm_window.h" | 72 #include "ash/common/wm_window.h" |
| 69 #include "ash/display/cursor_window_controller.h" | 73 #include "ash/display/cursor_window_controller.h" |
| 70 #include "ash/display/display_color_manager_chromeos.h" | 74 #include "ash/display/display_color_manager_chromeos.h" |
| 71 #include "ash/display/display_configuration_controller.h" | 75 #include "ash/display/display_configuration_controller.h" |
| 72 #include "ash/display/display_error_observer_chromeos.h" | 76 #include "ash/display/display_error_observer_chromeos.h" |
| 73 #include "ash/display/event_transformation_handler.h" | 77 #include "ash/display/event_transformation_handler.h" |
| 74 #include "ash/display/mouse_cursor_event_filter.h" | 78 #include "ash/display/mouse_cursor_event_filter.h" |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), | 556 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), |
| 553 keyboard_brightness_control_delegate_( | 557 keyboard_brightness_control_delegate_( |
| 554 base::MakeUnique<KeyboardBrightnessController>()), | 558 base::MakeUnique<KeyboardBrightnessController>()), |
| 555 locale_notification_controller_( | 559 locale_notification_controller_( |
| 556 base::MakeUnique<LocaleNotificationController>()), | 560 base::MakeUnique<LocaleNotificationController>()), |
| 557 media_controller_(base::MakeUnique<MediaController>()), | 561 media_controller_(base::MakeUnique<MediaController>()), |
| 558 new_window_controller_(base::MakeUnique<NewWindowController>()), | 562 new_window_controller_(base::MakeUnique<NewWindowController>()), |
| 559 session_controller_(base::MakeUnique<SessionController>()), | 563 session_controller_(base::MakeUnique<SessionController>()), |
| 560 shelf_controller_(base::MakeUnique<ShelfController>()), | 564 shelf_controller_(base::MakeUnique<ShelfController>()), |
| 561 shell_delegate_(std::move(shell_delegate)), | 565 shell_delegate_(std::move(shell_delegate)), |
| 566 shutdown_controller_(base::MakeUnique<ShutdownController>()), |
| 562 system_tray_controller_(base::MakeUnique<SystemTrayController>()), | 567 system_tray_controller_(base::MakeUnique<SystemTrayController>()), |
| 568 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), |
| 569 vpn_list_(base::MakeUnique<VpnList>()), |
| 570 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), |
| 571 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), |
| 563 app_list_(base::MakeUnique<app_list::AppList>()), | 572 app_list_(base::MakeUnique<app_list::AppList>()), |
| 564 link_handler_model_factory_(nullptr), | 573 link_handler_model_factory_(nullptr), |
| 565 tray_bluetooth_helper_(base::MakeUnique<TrayBluetoothHelper>()), | 574 tray_bluetooth_helper_(base::MakeUnique<TrayBluetoothHelper>()), |
| 566 display_configurator_(new display::DisplayConfigurator()), | 575 display_configurator_(new display::DisplayConfigurator()), |
| 567 native_cursor_manager_(nullptr), | 576 native_cursor_manager_(nullptr), |
| 568 simulate_modal_window_open_for_testing_(false), | 577 simulate_modal_window_open_for_testing_(false), |
| 569 is_touch_hud_projection_enabled_(false) { | 578 is_touch_hud_projection_enabled_(false) { |
| 570 // TODO(sky): better refactor cash/mash dependencies. Perhaps put all cash | 579 // TODO(sky): better refactor cash/mash dependencies. Perhaps put all cash |
| 571 // state on WmShellAura. http://crbug.com/671246. | 580 // state on WmShellAura. http://crbug.com/671246. |
| 572 | 581 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 // deleted because it's observing video activity through | 669 // deleted because it's observing video activity through |
| 661 // VideoDetector::Observer interface. | 670 // VideoDetector::Observer interface. |
| 662 video_activity_notifier_.reset(); | 671 video_activity_notifier_.reset(); |
| 663 video_detector_.reset(); | 672 video_detector_.reset(); |
| 664 high_contrast_controller_.reset(); | 673 high_contrast_controller_.reset(); |
| 665 | 674 |
| 666 shadow_controller_.reset(); | 675 shadow_controller_.reset(); |
| 667 resize_shadow_controller_.reset(); | 676 resize_shadow_controller_.reset(); |
| 668 | 677 |
| 669 // Has to happen before ~MruWindowTracker. | 678 // Has to happen before ~MruWindowTracker. |
| 670 wm_shell_->DeleteWindowCycleController(); | 679 window_cycle_controller_.reset(); |
| 671 wm_shell_->DeleteWindowSelectorController(); | 680 window_selector_controller_.reset(); |
| 672 | 681 |
| 673 CloseAllRootWindowChildWindows(); | 682 CloseAllRootWindowChildWindows(); |
| 674 | 683 |
| 675 // MruWindowTracker must be destroyed after all windows have been deleted to | 684 // MruWindowTracker must be destroyed after all windows have been deleted to |
| 676 // avoid a possible crash when Shell is destroyed from a non-normal shutdown | 685 // avoid a possible crash when Shell is destroyed from a non-normal shutdown |
| 677 // path. (crbug.com/485438). | 686 // path. (crbug.com/485438). |
| 678 mru_window_tracker_.reset(); | 687 mru_window_tracker_.reset(); |
| 679 | 688 |
| 680 // These need a valid Shell instance to clean up properly, so explicitly | 689 // These need a valid Shell instance to clean up properly, so explicitly |
| 681 // delete them before invalidating the instance. | 690 // delete them before invalidating the instance. |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 AddPreTargetHandler(system_gesture_filter_.get()); | 962 AddPreTargetHandler(system_gesture_filter_.get()); |
| 954 } | 963 } |
| 955 | 964 |
| 956 sticky_keys_controller_.reset(new StickyKeysController); | 965 sticky_keys_controller_.reset(new StickyKeysController); |
| 957 if (!is_mash) { | 966 if (!is_mash) { |
| 958 screen_pinning_controller_.reset( | 967 screen_pinning_controller_.reset( |
| 959 new ScreenPinningController(window_tree_host_manager_.get())); | 968 new ScreenPinningController(window_tree_host_manager_.get())); |
| 960 } | 969 } |
| 961 | 970 |
| 962 lock_state_controller_ = | 971 lock_state_controller_ = |
| 963 base::MakeUnique<LockStateController>(wm_shell_->shutdown_controller()); | 972 base::MakeUnique<LockStateController>(shutdown_controller_.get()); |
| 964 power_button_controller_.reset( | 973 power_button_controller_.reset( |
| 965 new PowerButtonController(lock_state_controller_.get())); | 974 new PowerButtonController(lock_state_controller_.get())); |
| 966 // Pass the initial display state to PowerButtonController. | 975 // Pass the initial display state to PowerButtonController. |
| 967 power_button_controller_->OnDisplayModeChanged( | 976 power_button_controller_->OnDisplayModeChanged( |
| 968 display_configurator_->cached_displays()); | 977 display_configurator_->cached_displays()); |
| 969 | 978 |
| 970 AddShellObserver(lock_state_controller_.get()); | 979 AddShellObserver(lock_state_controller_.get()); |
| 971 | 980 |
| 972 // The connector is unavailable in some tests. | 981 // The connector is unavailable in some tests. |
| 973 if (is_mash && shell_delegate_->GetShellConnector()) { | 982 if (is_mash && shell_delegate_->GetShellConnector()) { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 | 1229 |
| 1221 // Only trigger an update in mash because with classic ash chrome calls | 1230 // Only trigger an update in mash because with classic ash chrome calls |
| 1222 // UpdateAfterLoginStatusChange() directly. | 1231 // UpdateAfterLoginStatusChange() directly. |
| 1223 if (wm_shell_->IsRunningInMash()) { | 1232 if (wm_shell_->IsRunningInMash()) { |
| 1224 // TODO(jamescook): Should this call Shell::OnLoginStatusChanged() too? | 1233 // TODO(jamescook): Should this call Shell::OnLoginStatusChanged() too? |
| 1225 UpdateAfterLoginStatusChange(session_controller_->GetLoginStatus()); | 1234 UpdateAfterLoginStatusChange(session_controller_->GetLoginStatus()); |
| 1226 } | 1235 } |
| 1227 } | 1236 } |
| 1228 | 1237 |
| 1229 } // namespace ash | 1238 } // namespace ash |
| OLD | NEW |