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/ash_switches.h" | 17 #include "ash/common/ash_switches.h" |
18 #include "ash/common/gpu_support.h" | 18 #include "ash/common/gpu_support.h" |
19 #include "ash/common/keyboard/keyboard_ui.h" | 19 #include "ash/common/keyboard/keyboard_ui.h" |
20 #include "ash/common/login_status.h" | 20 #include "ash/common/login_status.h" |
21 #include "ash/common/pointer_watcher_delegate.h" | 21 #include "ash/common/pointer_down_watcher_delegate.h" |
22 #include "ash/common/session/session_state_delegate.h" | 22 #include "ash/common/session/session_state_delegate.h" |
23 #include "ash/common/shelf/shelf_item_delegate.h" | 23 #include "ash/common/shelf/shelf_item_delegate.h" |
24 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 24 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
25 #include "ash/common/shelf/shelf_model.h" | 25 #include "ash/common/shelf/shelf_model.h" |
26 #include "ash/common/shell_delegate.h" | 26 #include "ash/common/shell_delegate.h" |
27 #include "ash/common/shell_window_ids.h" | 27 #include "ash/common/shell_window_ids.h" |
28 #include "ash/common/system/locale/locale_notification_controller.h" | 28 #include "ash/common/system/locale/locale_notification_controller.h" |
29 #include "ash/common/system/status_area_widget.h" | 29 #include "ash/common/system/status_area_widget.h" |
30 #include "ash/common/system/toast/toast_manager.h" | 30 #include "ash/common/system/toast/toast_manager.h" |
31 #include "ash/common/system/tray/system_tray_delegate.h" | 31 #include "ash/common/system/tray/system_tray_delegate.h" |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 451 |
452 void Shell::ShutdownShelf() { | 452 void Shell::ShutdownShelf() { |
453 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 453 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
454 for (RootWindowControllerList::iterator iter = controllers.begin(); | 454 for (RootWindowControllerList::iterator iter = controllers.begin(); |
455 iter != controllers.end(); ++iter) { | 455 iter != controllers.end(); ++iter) { |
456 if ((*iter)->shelf_widget()) | 456 if ((*iter)->shelf_widget()) |
457 (*iter)->shelf_widget()->Shutdown(); | 457 (*iter)->shelf_widget()->Shutdown(); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 void Shell::AddPointerWatcher(views::PointerWatcher* watcher) { | 461 void Shell::AddPointerDownWatcher(views::PointerDownWatcher* watcher) { |
462 pointer_watcher_delegate_->AddPointerWatcher(watcher); | 462 pointer_down_watcher_delegate_->AddPointerDownWatcher(watcher); |
463 } | 463 } |
464 | 464 |
465 void Shell::RemovePointerWatcher(views::PointerWatcher* watcher) { | 465 void Shell::RemovePointerDownWatcher(views::PointerDownWatcher* watcher) { |
466 pointer_watcher_delegate_->RemovePointerWatcher(watcher); | 466 pointer_down_watcher_delegate_->RemovePointerDownWatcher(watcher); |
467 } | 467 } |
468 | 468 |
469 #if defined(OS_CHROMEOS) | 469 #if defined(OS_CHROMEOS) |
470 bool Shell::ShouldSaveDisplaySettings() { | 470 bool Shell::ShouldSaveDisplaySettings() { |
471 return !( | 471 return !( |
472 screen_orientation_controller_->ignore_display_configuration_updates() || | 472 screen_orientation_controller_->ignore_display_configuration_updates() || |
473 resolution_notification_controller_->DoesNotificationTimeout()); | 473 resolution_notification_controller_->DoesNotificationTimeout()); |
474 } | 474 } |
475 #endif | 475 #endif |
476 | 476 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 display_manager_->CreateScreenForShutdown(); | 763 display_manager_->CreateScreenForShutdown(); |
764 display_configuration_controller_.reset(); | 764 display_configuration_controller_.reset(); |
765 | 765 |
766 wm_shell_->Shutdown(); | 766 wm_shell_->Shutdown(); |
767 // Depends on |focus_client_|, so must be destroyed before. | 767 // Depends on |focus_client_|, so must be destroyed before. |
768 window_tree_host_manager_->Shutdown(); | 768 window_tree_host_manager_->Shutdown(); |
769 window_tree_host_manager_.reset(); | 769 window_tree_host_manager_.reset(); |
770 focus_client_.reset(); | 770 focus_client_.reset(); |
771 screen_position_controller_.reset(); | 771 screen_position_controller_.reset(); |
772 new_window_delegate_.reset(); | 772 new_window_delegate_.reset(); |
773 pointer_watcher_delegate_.reset(); | 773 pointer_down_watcher_delegate_.reset(); |
774 | 774 |
775 keyboard::KeyboardController::ResetInstance(nullptr); | 775 keyboard::KeyboardController::ResetInstance(nullptr); |
776 | 776 |
777 #if defined(OS_CHROMEOS) | 777 #if defined(OS_CHROMEOS) |
778 display_color_manager_.reset(); | 778 display_color_manager_.reset(); |
779 if (display_change_observer_) | 779 if (display_change_observer_) |
780 display_configurator_->RemoveObserver(display_change_observer_.get()); | 780 display_configurator_->RemoveObserver(display_change_observer_.get()); |
781 if (display_error_observer_) | 781 if (display_error_observer_) |
782 display_configurator_->RemoveObserver(display_error_observer_.get()); | 782 display_configurator_->RemoveObserver(display_error_observer_.get()); |
783 if (projecting_observer_) { | 783 if (projecting_observer_) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 | 1006 |
1007 // This controller needs to be set before SetupManagedWindowMode. | 1007 // This controller needs to be set before SetupManagedWindowMode. |
1008 desktop_background_controller_.reset( | 1008 desktop_background_controller_.reset( |
1009 new DesktopBackgroundController(blocking_pool_)); | 1009 new DesktopBackgroundController(blocking_pool_)); |
1010 user_wallpaper_delegate_.reset( | 1010 user_wallpaper_delegate_.reset( |
1011 wm_shell_->delegate()->CreateUserWallpaperDelegate()); | 1011 wm_shell_->delegate()->CreateUserWallpaperDelegate()); |
1012 | 1012 |
1013 session_state_delegate_.reset( | 1013 session_state_delegate_.reset( |
1014 wm_shell_->delegate()->CreateSessionStateDelegate()); | 1014 wm_shell_->delegate()->CreateSessionStateDelegate()); |
1015 new_window_delegate_.reset(wm_shell_->delegate()->CreateNewWindowDelegate()); | 1015 new_window_delegate_.reset(wm_shell_->delegate()->CreateNewWindowDelegate()); |
1016 pointer_watcher_delegate_ = | 1016 pointer_down_watcher_delegate_ = |
1017 wm_shell_->delegate()->CreatePointerWatcherDelegate(); | 1017 wm_shell_->delegate()->CreatePointerDownWatcherDelegate(); |
1018 | 1018 |
1019 resize_shadow_controller_.reset(new ResizeShadowController()); | 1019 resize_shadow_controller_.reset(new ResizeShadowController()); |
1020 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); | 1020 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); |
1021 | 1021 |
1022 wm_shell_->SetSystemTrayDelegate( | 1022 wm_shell_->SetSystemTrayDelegate( |
1023 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); | 1023 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); |
1024 | 1024 |
1025 locale_notification_controller_.reset(new LocaleNotificationController); | 1025 locale_notification_controller_.reset(new LocaleNotificationController); |
1026 | 1026 |
1027 // Initialize toast manager | 1027 // Initialize toast manager |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 | 1162 |
1163 void Shell::OnWindowActivated( | 1163 void Shell::OnWindowActivated( |
1164 aura::client::ActivationChangeObserver::ActivationReason reason, | 1164 aura::client::ActivationChangeObserver::ActivationReason reason, |
1165 aura::Window* gained_active, | 1165 aura::Window* gained_active, |
1166 aura::Window* lost_active) { | 1166 aura::Window* lost_active) { |
1167 if (gained_active) | 1167 if (gained_active) |
1168 target_root_window_ = gained_active->GetRootWindow(); | 1168 target_root_window_ = gained_active->GetRootWindow(); |
1169 } | 1169 } |
1170 | 1170 |
1171 } // namespace ash | 1171 } // namespace ash |
OLD | NEW |