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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 #include "ui/wm/core/visibility_controller.h" | 114 #include "ui/wm/core/visibility_controller.h" |
115 #include "ui/wm/core/window_modality_controller.h" | 115 #include "ui/wm/core/window_modality_controller.h" |
116 | 116 |
117 #if defined(OS_CHROMEOS) | 117 #if defined(OS_CHROMEOS) |
118 #if defined(USE_X11) | 118 #if defined(USE_X11) |
119 #include "ash/accelerators/magnifier_key_scroller.h" | 119 #include "ash/accelerators/magnifier_key_scroller.h" |
120 #include "ash/accelerators/spoken_feedback_toggler.h" | 120 #include "ash/accelerators/spoken_feedback_toggler.h" |
121 #include "ui/gfx/x/x11_types.h" | 121 #include "ui/gfx/x/x11_types.h" |
122 #endif // defined(USE_X11) | 122 #endif // defined(USE_X11) |
123 #include "ash/ash_constants.h" | 123 #include "ash/ash_constants.h" |
| 124 #include "ash/content/accelerometer/sensor_manager_delegate_chromeos.h" |
124 #include "ash/content/display/screen_orientation_delegate_chromeos.h" | 125 #include "ash/content/display/screen_orientation_delegate_chromeos.h" |
125 #include "ash/display/display_change_observer_chromeos.h" | 126 #include "ash/display/display_change_observer_chromeos.h" |
126 #include "ash/display/display_configurator_animation.h" | 127 #include "ash/display/display_configurator_animation.h" |
127 #include "ash/display/display_error_observer_chromeos.h" | 128 #include "ash/display/display_error_observer_chromeos.h" |
128 #include "ash/display/projecting_observer_chromeos.h" | 129 #include "ash/display/projecting_observer_chromeos.h" |
129 #include "ash/display/resolution_notification_controller.h" | 130 #include "ash/display/resolution_notification_controller.h" |
130 #include "ash/sticky_keys/sticky_keys_controller.h" | 131 #include "ash/sticky_keys/sticky_keys_controller.h" |
131 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" | 132 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" |
132 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" | 133 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" |
133 #include "ash/system/chromeos/power/power_event_observer.h" | 134 #include "ash/system/chromeos/power/power_event_observer.h" |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 display_configurator_->RemoveObserver(display_change_observer_.get()); | 811 display_configurator_->RemoveObserver(display_change_observer_.get()); |
811 if (display_configurator_animation_) | 812 if (display_configurator_animation_) |
812 display_configurator_->RemoveObserver( | 813 display_configurator_->RemoveObserver( |
813 display_configurator_animation_.get()); | 814 display_configurator_animation_.get()); |
814 if (display_error_observer_) | 815 if (display_error_observer_) |
815 display_configurator_->RemoveObserver(display_error_observer_.get()); | 816 display_configurator_->RemoveObserver(display_error_observer_.get()); |
816 if (projecting_observer_) | 817 if (projecting_observer_) |
817 display_configurator_->RemoveObserver(projecting_observer_.get()); | 818 display_configurator_->RemoveObserver(projecting_observer_.get()); |
818 display_change_observer_.reset(); | 819 display_change_observer_.reset(); |
819 | 820 |
| 821 sensor_manager_delegate_.reset(); |
| 822 |
820 PowerStatus::Shutdown(); | 823 PowerStatus::Shutdown(); |
821 | 824 |
822 // Ensure that DBusThreadManager outlives this Shell. | 825 // Ensure that DBusThreadManager outlives this Shell. |
823 DCHECK(chromeos::DBusThreadManager::IsInitialized()); | 826 DCHECK(chromeos::DBusThreadManager::IsInitialized()); |
824 #endif | 827 #endif |
825 | 828 |
826 DCHECK(instance_ == this); | 829 DCHECK(instance_ == this); |
827 instance_ = NULL; | 830 instance_ = NULL; |
828 } | 831 } |
829 | 832 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 new ash::system::BrightnessControllerChromeos).Pass()); | 1058 new ash::system::BrightnessControllerChromeos).Pass()); |
1056 | 1059 |
1057 power_event_observer_.reset(new PowerEventObserver()); | 1060 power_event_observer_.reset(new PowerEventObserver()); |
1058 user_activity_notifier_.reset( | 1061 user_activity_notifier_.reset( |
1059 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); | 1062 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); |
1060 video_activity_notifier_.reset( | 1063 video_activity_notifier_.reset( |
1061 new VideoActivityNotifier(video_detector_.get())); | 1064 new VideoActivityNotifier(video_detector_.get())); |
1062 bluetooth_notification_controller_.reset(new BluetoothNotificationController); | 1065 bluetooth_notification_controller_.reset(new BluetoothNotificationController); |
1063 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); | 1066 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); |
1064 screen_orientation_delegate_.reset(new ScreenOrientationDelegate()); | 1067 screen_orientation_delegate_.reset(new ScreenOrientationDelegate()); |
| 1068 sensor_manager_delegate_.reset(new SensorManagerDelegateChromeOS); |
1065 #endif | 1069 #endif |
1066 // The compositor thread and main message loop have to be running in | 1070 // The compositor thread and main message loop have to be running in |
1067 // order to create mirror window. Run it after the main message loop | 1071 // order to create mirror window. Run it after the main message loop |
1068 // is started. | 1072 // is started. |
1069 display_manager_->CreateMirrorWindowAsyncIfAny(); | 1073 display_manager_->CreateMirrorWindowAsyncIfAny(); |
1070 } | 1074 } |
1071 | 1075 |
1072 void Shell::InitKeyboard() { | 1076 void Shell::InitKeyboard() { |
1073 if (keyboard::IsKeyboardEnabled()) { | 1077 if (keyboard::IsKeyboardEnabled()) { |
1074 if (keyboard::KeyboardController::GetInstance()) { | 1078 if (keyboard::KeyboardController::GetInstance()) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 //////////////////////////////////////////////////////////////////////////////// | 1163 //////////////////////////////////////////////////////////////////////////////// |
1160 // Shell, aura::client::ActivationChangeObserver implementation: | 1164 // Shell, aura::client::ActivationChangeObserver implementation: |
1161 | 1165 |
1162 void Shell::OnWindowActivated(aura::Window* gained_active, | 1166 void Shell::OnWindowActivated(aura::Window* gained_active, |
1163 aura::Window* lost_active) { | 1167 aura::Window* lost_active) { |
1164 if (gained_active) | 1168 if (gained_active) |
1165 target_root_window_ = gained_active->GetRootWindow(); | 1169 target_root_window_ = gained_active->GetRootWindow(); |
1166 } | 1170 } |
1167 | 1171 |
1168 } // namespace ash | 1172 } // namespace ash |
OLD | NEW |