| 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 19 matching lines...) Expand all Loading... |
| 30 #include "ash/gpu_support.h" | 30 #include "ash/gpu_support.h" |
| 31 #include "ash/high_contrast/high_contrast_controller.h" | 31 #include "ash/high_contrast/high_contrast_controller.h" |
| 32 #include "ash/host/ash_window_tree_host_init_params.h" | 32 #include "ash/host/ash_window_tree_host_init_params.h" |
| 33 #include "ash/ime/input_method_event_handler.h" | 33 #include "ash/ime/input_method_event_handler.h" |
| 34 #include "ash/keyboard/keyboard_ui.h" | 34 #include "ash/keyboard/keyboard_ui.h" |
| 35 #include "ash/keyboard_uma_event_filter.h" | 35 #include "ash/keyboard_uma_event_filter.h" |
| 36 #include "ash/magnifier/magnification_controller.h" | 36 #include "ash/magnifier/magnification_controller.h" |
| 37 #include "ash/magnifier/partial_magnification_controller.h" | 37 #include "ash/magnifier/partial_magnification_controller.h" |
| 38 #include "ash/media_delegate.h" | 38 #include "ash/media_delegate.h" |
| 39 #include "ash/new_window_delegate.h" | 39 #include "ash/new_window_delegate.h" |
| 40 #include "ash/pointer_watcher_delegate.h" |
| 40 #include "ash/root_window_controller.h" | 41 #include "ash/root_window_controller.h" |
| 41 #include "ash/session/session_state_delegate.h" | 42 #include "ash/session/session_state_delegate.h" |
| 42 #include "ash/shelf/app_list_shelf_item_delegate.h" | 43 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 43 #include "ash/shelf/shelf.h" | 44 #include "ash/shelf/shelf.h" |
| 44 #include "ash/shelf/shelf_delegate.h" | 45 #include "ash/shelf/shelf_delegate.h" |
| 45 #include "ash/shelf/shelf_item_delegate.h" | 46 #include "ash/shelf/shelf_item_delegate.h" |
| 46 #include "ash/shelf/shelf_item_delegate_manager.h" | 47 #include "ash/shelf/shelf_item_delegate_manager.h" |
| 47 #include "ash/shelf/shelf_model.h" | 48 #include "ash/shelf/shelf_model.h" |
| 48 #include "ash/shelf/shelf_widget.h" | 49 #include "ash/shelf/shelf_widget.h" |
| 49 #include "ash/shelf/shelf_window_watcher.h" | 50 #include "ash/shelf/shelf_window_watcher.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 } | 485 } |
| 485 | 486 |
| 486 void Shell::AddShellObserver(ShellObserver* observer) { | 487 void Shell::AddShellObserver(ShellObserver* observer) { |
| 487 observers_.AddObserver(observer); | 488 observers_.AddObserver(observer); |
| 488 } | 489 } |
| 489 | 490 |
| 490 void Shell::RemoveShellObserver(ShellObserver* observer) { | 491 void Shell::RemoveShellObserver(ShellObserver* observer) { |
| 491 observers_.RemoveObserver(observer); | 492 observers_.RemoveObserver(observer); |
| 492 } | 493 } |
| 493 | 494 |
| 495 void Shell::AddPointerWatcher(views::PointerWatcher* watcher) { |
| 496 pointer_watcher_delegate_->AddPointerWatcher(watcher); |
| 497 } |
| 498 |
| 499 void Shell::RemovePointerWatcher(views::PointerWatcher* watcher) { |
| 500 pointer_watcher_delegate_->RemovePointerWatcher(watcher); |
| 501 } |
| 502 |
| 494 #if defined(OS_CHROMEOS) | 503 #if defined(OS_CHROMEOS) |
| 495 bool Shell::ShouldSaveDisplaySettings() { | 504 bool Shell::ShouldSaveDisplaySettings() { |
| 496 return !(screen_orientation_controller_ | 505 return !(screen_orientation_controller_ |
| 497 ->ignore_display_configuration_updates() || | 506 ->ignore_display_configuration_updates() || |
| 498 resolution_notification_controller_->DoesNotificationTimeout()); | 507 resolution_notification_controller_->DoesNotificationTimeout()); |
| 499 } | 508 } |
| 500 #endif | 509 #endif |
| 501 | 510 |
| 502 void Shell::UpdateShelfVisibility() { | 511 void Shell::UpdateShelfVisibility() { |
| 503 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 512 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 wm_globals_.reset(); | 831 wm_globals_.reset(); |
| 823 | 832 |
| 824 // Depends on |focus_client_|, so must be destroyed before. | 833 // Depends on |focus_client_|, so must be destroyed before. |
| 825 window_tree_host_manager_->Shutdown(); | 834 window_tree_host_manager_->Shutdown(); |
| 826 window_tree_host_manager_.reset(); | 835 window_tree_host_manager_.reset(); |
| 827 focus_client_.reset(); | 836 focus_client_.reset(); |
| 828 screen_position_controller_.reset(); | 837 screen_position_controller_.reset(); |
| 829 accessibility_delegate_.reset(); | 838 accessibility_delegate_.reset(); |
| 830 new_window_delegate_.reset(); | 839 new_window_delegate_.reset(); |
| 831 media_delegate_.reset(); | 840 media_delegate_.reset(); |
| 841 pointer_watcher_delegate_.reset(); |
| 832 | 842 |
| 833 keyboard::KeyboardController::ResetInstance(nullptr); | 843 keyboard::KeyboardController::ResetInstance(nullptr); |
| 834 | 844 |
| 835 #if defined(OS_CHROMEOS) | 845 #if defined(OS_CHROMEOS) |
| 836 display_color_manager_.reset(); | 846 display_color_manager_.reset(); |
| 837 if (display_change_observer_) | 847 if (display_change_observer_) |
| 838 display_configurator_->RemoveObserver(display_change_observer_.get()); | 848 display_configurator_->RemoveObserver(display_change_observer_.get()); |
| 839 if (display_error_observer_) | 849 if (display_error_observer_) |
| 840 display_configurator_->RemoveObserver(display_error_observer_.get()); | 850 display_configurator_->RemoveObserver(display_error_observer_.get()); |
| 841 if (projecting_observer_) { | 851 if (projecting_observer_) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 | 1069 |
| 1060 // This controller needs to be set before SetupManagedWindowMode. | 1070 // This controller needs to be set before SetupManagedWindowMode. |
| 1061 desktop_background_controller_.reset( | 1071 desktop_background_controller_.reset( |
| 1062 new DesktopBackgroundController(blocking_pool_)); | 1072 new DesktopBackgroundController(blocking_pool_)); |
| 1063 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); | 1073 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); |
| 1064 | 1074 |
| 1065 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate()); | 1075 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate()); |
| 1066 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); | 1076 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); |
| 1067 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); | 1077 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); |
| 1068 media_delegate_.reset(delegate_->CreateMediaDelegate()); | 1078 media_delegate_.reset(delegate_->CreateMediaDelegate()); |
| 1079 pointer_watcher_delegate_ = delegate_->CreatePointerWatcherDelegate(); |
| 1069 | 1080 |
| 1070 resize_shadow_controller_.reset(new ResizeShadowController()); | 1081 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 1071 shadow_controller_.reset( | 1082 shadow_controller_.reset( |
| 1072 new ::wm::ShadowController(activation_client_)); | 1083 new ::wm::ShadowController(activation_client_)); |
| 1073 | 1084 |
| 1074 // Create system_tray_notifier_ before the delegate. | 1085 // Create system_tray_notifier_ before the delegate. |
| 1075 system_tray_notifier_.reset(new SystemTrayNotifier()); | 1086 system_tray_notifier_.reset(new SystemTrayNotifier()); |
| 1076 | 1087 |
| 1077 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. | 1088 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. |
| 1078 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); | 1089 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1248 |
| 1238 void Shell::OnWindowActivated( | 1249 void Shell::OnWindowActivated( |
| 1239 aura::client::ActivationChangeObserver::ActivationReason reason, | 1250 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1240 aura::Window* gained_active, | 1251 aura::Window* gained_active, |
| 1241 aura::Window* lost_active) { | 1252 aura::Window* lost_active) { |
| 1242 if (gained_active) | 1253 if (gained_active) |
| 1243 target_root_window_ = gained_active->GetRootWindow(); | 1254 target_root_window_ = gained_active->GetRootWindow(); |
| 1244 } | 1255 } |
| 1245 | 1256 |
| 1246 } // namespace ash | 1257 } // namespace ash |
| OLD | NEW |