| 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_delegate_aura.h" | 11 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 12 #include "ash/accelerators/accelerator_delegate.h" | 12 #include "ash/accelerators/accelerator_delegate.h" |
| 13 #include "ash/aura/wm_shell_aura.h" | 13 #include "ash/aura/wm_shell_aura.h" |
| 14 #include "ash/aura/wm_window_aura.h" | 14 #include "ash/aura/wm_window_aura.h" |
| 15 #include "ash/autoclick/autoclick_controller.h" | 15 #include "ash/autoclick/autoclick_controller.h" |
| 16 #include "ash/common/accelerators/accelerator_controller.h" | 16 #include "ash/common/accelerators/accelerator_controller.h" |
| 17 #include "ash/common/ash_switches.h" | 17 #include "ash/common/ash_switches.h" |
| 18 #include "ash/common/frame/custom_frame_view_ash.h" | 18 #include "ash/common/frame/custom_frame_view_ash.h" |
| 19 #include "ash/common/gpu_support.h" | 19 #include "ash/common/gpu_support.h" |
| 20 #include "ash/common/keyboard/keyboard_ui.h" | 20 #include "ash/common/keyboard/keyboard_ui.h" |
| 21 #include "ash/common/login_status.h" | 21 #include "ash/common/login_status.h" |
| 22 #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/app_list_shelf_item_delegate.h" | 23 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |
| 25 #include "ash/common/shelf/shelf_delegate.h" | 24 #include "ash/common/shelf/shelf_delegate.h" |
| 26 #include "ash/common/shelf/shelf_item_delegate.h" | 25 #include "ash/common/shelf/shelf_item_delegate.h" |
| 27 #include "ash/common/shelf/shelf_model.h" | 26 #include "ash/common/shelf/shelf_model.h" |
| 28 #include "ash/common/shell_delegate.h" | 27 #include "ash/common/shell_delegate.h" |
| 29 #include "ash/common/shell_window_ids.h" | 28 #include "ash/common/shell_window_ids.h" |
| 30 #include "ash/common/system/locale/locale_notification_controller.h" | 29 #include "ash/common/system/locale/locale_notification_controller.h" |
| 31 #include "ash/common/system/status_area_widget.h" | 30 #include "ash/common/system/status_area_widget.h" |
| 32 #include "ash/common/system/tray/system_tray_delegate.h" | 31 #include "ash/common/system/tray/system_tray_delegate.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 407 |
| 409 void Shell::ShutdownShelf() { | 408 void Shell::ShutdownShelf() { |
| 410 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 409 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 411 for (RootWindowControllerList::iterator iter = controllers.begin(); | 410 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 412 iter != controllers.end(); ++iter) { | 411 iter != controllers.end(); ++iter) { |
| 413 if ((*iter)->shelf_widget()) | 412 if ((*iter)->shelf_widget()) |
| 414 (*iter)->shelf_widget()->Shutdown(); | 413 (*iter)->shelf_widget()->Shutdown(); |
| 415 } | 414 } |
| 416 } | 415 } |
| 417 | 416 |
| 418 void Shell::AddPointerWatcher(views::PointerWatcher* watcher, | |
| 419 bool wants_moves) { | |
| 420 pointer_watcher_delegate_->AddPointerWatcher(watcher, wants_moves); | |
| 421 } | |
| 422 | |
| 423 void Shell::RemovePointerWatcher(views::PointerWatcher* watcher) { | |
| 424 pointer_watcher_delegate_->RemovePointerWatcher(watcher); | |
| 425 } | |
| 426 | |
| 427 #if defined(OS_CHROMEOS) | 417 #if defined(OS_CHROMEOS) |
| 428 bool Shell::ShouldSaveDisplaySettings() { | 418 bool Shell::ShouldSaveDisplaySettings() { |
| 429 return !( | 419 return !( |
| 430 screen_orientation_controller_->ignore_display_configuration_updates() || | 420 screen_orientation_controller_->ignore_display_configuration_updates() || |
| 431 resolution_notification_controller_->DoesNotificationTimeout()); | 421 resolution_notification_controller_->DoesNotificationTimeout()); |
| 432 } | 422 } |
| 433 #endif | 423 #endif |
| 434 | 424 |
| 435 void Shell::UpdateShelfVisibility() { | 425 void Shell::UpdateShelfVisibility() { |
| 436 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 426 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 // of its owned RootWindowControllers relies on the value. | 652 // of its owned RootWindowControllers relies on the value. |
| 663 display_manager_->CreateScreenForShutdown(); | 653 display_manager_->CreateScreenForShutdown(); |
| 664 display_configuration_controller_.reset(); | 654 display_configuration_controller_.reset(); |
| 665 | 655 |
| 666 wm_shell_->Shutdown(); | 656 wm_shell_->Shutdown(); |
| 667 // Depends on |focus_client_|, so must be destroyed before. | 657 // Depends on |focus_client_|, so must be destroyed before. |
| 668 window_tree_host_manager_->Shutdown(); | 658 window_tree_host_manager_->Shutdown(); |
| 669 window_tree_host_manager_.reset(); | 659 window_tree_host_manager_.reset(); |
| 670 focus_client_.reset(); | 660 focus_client_.reset(); |
| 671 screen_position_controller_.reset(); | 661 screen_position_controller_.reset(); |
| 672 pointer_watcher_delegate_.reset(); | |
| 673 | 662 |
| 674 keyboard::KeyboardController::ResetInstance(nullptr); | 663 keyboard::KeyboardController::ResetInstance(nullptr); |
| 675 | 664 |
| 676 #if defined(OS_CHROMEOS) | 665 #if defined(OS_CHROMEOS) |
| 677 display_color_manager_.reset(); | 666 display_color_manager_.reset(); |
| 678 if (display_change_observer_) | 667 if (display_change_observer_) |
| 679 display_configurator_->RemoveObserver(display_change_observer_.get()); | 668 display_configurator_->RemoveObserver(display_change_observer_.get()); |
| 680 if (display_error_observer_) | 669 if (display_error_observer_) |
| 681 display_configurator_->RemoveObserver(display_error_observer_.get()); | 670 display_configurator_->RemoveObserver(display_error_observer_.get()); |
| 682 if (projecting_observer_) { | 671 if (projecting_observer_) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 event_client_.reset(new EventClientImpl); | 889 event_client_.reset(new EventClientImpl); |
| 901 | 890 |
| 902 // This controller needs to be set before SetupManagedWindowMode. | 891 // This controller needs to be set before SetupManagedWindowMode. |
| 903 desktop_background_controller_.reset( | 892 desktop_background_controller_.reset( |
| 904 new DesktopBackgroundController(blocking_pool_)); | 893 new DesktopBackgroundController(blocking_pool_)); |
| 905 user_wallpaper_delegate_.reset( | 894 user_wallpaper_delegate_.reset( |
| 906 wm_shell_->delegate()->CreateUserWallpaperDelegate()); | 895 wm_shell_->delegate()->CreateUserWallpaperDelegate()); |
| 907 | 896 |
| 908 session_state_delegate_.reset( | 897 session_state_delegate_.reset( |
| 909 wm_shell_->delegate()->CreateSessionStateDelegate()); | 898 wm_shell_->delegate()->CreateSessionStateDelegate()); |
| 910 pointer_watcher_delegate_ = | 899 wm_shell_->CreatePointerWatcherAdapter(); |
| 911 wm_shell_->delegate()->CreatePointerWatcherDelegate(); | |
| 912 | 900 |
| 913 resize_shadow_controller_.reset(new ResizeShadowController()); | 901 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 914 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); | 902 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); |
| 915 | 903 |
| 916 wm_shell_->SetSystemTrayDelegate( | 904 wm_shell_->SetSystemTrayDelegate( |
| 917 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); | 905 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); |
| 918 | 906 |
| 919 locale_notification_controller_.reset(new LocaleNotificationController); | 907 locale_notification_controller_.reset(new LocaleNotificationController); |
| 920 | 908 |
| 921 #if defined(OS_CHROMEOS) | 909 #if defined(OS_CHROMEOS) |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 1030 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
| 1043 return std::unique_ptr<ui::EventTargetIterator>(); | 1031 return std::unique_ptr<ui::EventTargetIterator>(); |
| 1044 } | 1032 } |
| 1045 | 1033 |
| 1046 ui::EventTargeter* Shell::GetEventTargeter() { | 1034 ui::EventTargeter* Shell::GetEventTargeter() { |
| 1047 NOTREACHED(); | 1035 NOTREACHED(); |
| 1048 return nullptr; | 1036 return nullptr; |
| 1049 } | 1037 } |
| 1050 | 1038 |
| 1051 } // namespace ash | 1039 } // namespace ash |
| OLD | NEW |