| 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 | 9 |
| 10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 #include "ui/wm/core/visibility_controller.h" | 113 #include "ui/wm/core/visibility_controller.h" |
| 114 #include "ui/wm/core/window_modality_controller.h" | 114 #include "ui/wm/core/window_modality_controller.h" |
| 115 | 115 |
| 116 #if defined(OS_CHROMEOS) | 116 #if defined(OS_CHROMEOS) |
| 117 #if defined(USE_X11) | 117 #if defined(USE_X11) |
| 118 #include "ui/gfx/x/x11_types.h" | 118 #include "ui/gfx/x/x11_types.h" |
| 119 #endif // defined(USE_X11) | 119 #endif // defined(USE_X11) |
| 120 #include "ash/accelerators/magnifier_key_scroller.h" | 120 #include "ash/accelerators/magnifier_key_scroller.h" |
| 121 #include "ash/accelerators/spoken_feedback_toggler.h" | 121 #include "ash/accelerators/spoken_feedback_toggler.h" |
| 122 #include "ash/ash_constants.h" | 122 #include "ash/ash_constants.h" |
| 123 #include "ash/content/accelerometer/sensor_manager_delegate_chromeos.h" |
| 123 #include "ash/content/display/screen_orientation_controller_chromeos.h" | 124 #include "ash/content/display/screen_orientation_controller_chromeos.h" |
| 124 #include "ash/display/display_change_observer_chromeos.h" | 125 #include "ash/display/display_change_observer_chromeos.h" |
| 125 #include "ash/display/display_configurator_animation.h" | 126 #include "ash/display/display_configurator_animation.h" |
| 126 #include "ash/display/display_error_observer_chromeos.h" | 127 #include "ash/display/display_error_observer_chromeos.h" |
| 127 #include "ash/display/projecting_observer_chromeos.h" | 128 #include "ash/display/projecting_observer_chromeos.h" |
| 128 #include "ash/display/resolution_notification_controller.h" | 129 #include "ash/display/resolution_notification_controller.h" |
| 129 #include "ash/sticky_keys/sticky_keys_controller.h" | 130 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 130 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" | 131 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" |
| 131 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" | 132 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" |
| 132 #include "ash/system/chromeos/power/power_event_observer.h" | 133 #include "ash/system/chromeos/power/power_event_observer.h" |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 display_configurator_->RemoveObserver(display_change_observer_.get()); | 815 display_configurator_->RemoveObserver(display_change_observer_.get()); |
| 815 if (display_configurator_animation_) | 816 if (display_configurator_animation_) |
| 816 display_configurator_->RemoveObserver( | 817 display_configurator_->RemoveObserver( |
| 817 display_configurator_animation_.get()); | 818 display_configurator_animation_.get()); |
| 818 if (display_error_observer_) | 819 if (display_error_observer_) |
| 819 display_configurator_->RemoveObserver(display_error_observer_.get()); | 820 display_configurator_->RemoveObserver(display_error_observer_.get()); |
| 820 if (projecting_observer_) | 821 if (projecting_observer_) |
| 821 display_configurator_->RemoveObserver(projecting_observer_.get()); | 822 display_configurator_->RemoveObserver(projecting_observer_.get()); |
| 822 display_change_observer_.reset(); | 823 display_change_observer_.reset(); |
| 823 | 824 |
| 825 sensor_manager_delegate_.reset(); |
| 826 |
| 824 PowerStatus::Shutdown(); | 827 PowerStatus::Shutdown(); |
| 825 | 828 |
| 826 // Ensure that DBusThreadManager outlives this Shell. | 829 // Ensure that DBusThreadManager outlives this Shell. |
| 827 DCHECK(chromeos::DBusThreadManager::IsInitialized()); | 830 DCHECK(chromeos::DBusThreadManager::IsInitialized()); |
| 828 #endif | 831 #endif |
| 829 | 832 |
| 830 DCHECK(instance_ == this); | 833 DCHECK(instance_ == this); |
| 831 instance_ = NULL; | 834 instance_ = NULL; |
| 832 } | 835 } |
| 833 | 836 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 scoped_ptr<ash::BrightnessControlDelegate>( | 1065 scoped_ptr<ash::BrightnessControlDelegate>( |
| 1063 new ash::system::BrightnessControllerChromeos).Pass()); | 1066 new ash::system::BrightnessControllerChromeos).Pass()); |
| 1064 | 1067 |
| 1065 power_event_observer_.reset(new PowerEventObserver()); | 1068 power_event_observer_.reset(new PowerEventObserver()); |
| 1066 user_activity_notifier_.reset( | 1069 user_activity_notifier_.reset( |
| 1067 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); | 1070 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); |
| 1068 video_activity_notifier_.reset( | 1071 video_activity_notifier_.reset( |
| 1069 new VideoActivityNotifier(video_detector_.get())); | 1072 new VideoActivityNotifier(video_detector_.get())); |
| 1070 bluetooth_notification_controller_.reset(new BluetoothNotificationController); | 1073 bluetooth_notification_controller_.reset(new BluetoothNotificationController); |
| 1071 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); | 1074 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); |
| 1075 sensor_manager_delegate_.reset(new SensorManagerDelegateChromeOS); |
| 1072 screen_orientation_controller_.reset(new ScreenOrientationController()); | 1076 screen_orientation_controller_.reset(new ScreenOrientationController()); |
| 1073 #endif | 1077 #endif |
| 1074 // The compositor thread and main message loop have to be running in | 1078 // The compositor thread and main message loop have to be running in |
| 1075 // order to create mirror window. Run it after the main message loop | 1079 // order to create mirror window. Run it after the main message loop |
| 1076 // is started. | 1080 // is started. |
| 1077 display_manager_->CreateMirrorWindowAsyncIfAny(); | 1081 display_manager_->CreateMirrorWindowAsyncIfAny(); |
| 1078 } | 1082 } |
| 1079 | 1083 |
| 1080 void Shell::InitKeyboard() { | 1084 void Shell::InitKeyboard() { |
| 1081 if (keyboard::IsKeyboardEnabled()) { | 1085 if (keyboard::IsKeyboardEnabled()) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 //////////////////////////////////////////////////////////////////////////////// | 1171 //////////////////////////////////////////////////////////////////////////////// |
| 1168 // Shell, aura::client::ActivationChangeObserver implementation: | 1172 // Shell, aura::client::ActivationChangeObserver implementation: |
| 1169 | 1173 |
| 1170 void Shell::OnWindowActivated(aura::Window* gained_active, | 1174 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 1171 aura::Window* lost_active) { | 1175 aura::Window* lost_active) { |
| 1172 if (gained_active) | 1176 if (gained_active) |
| 1173 target_root_window_ = gained_active->GetRootWindow(); | 1177 target_root_window_ = gained_active->GetRootWindow(); |
| 1174 } | 1178 } |
| 1175 | 1179 |
| 1176 } // namespace ash | 1180 } // namespace ash |
| OLD | NEW |