Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: ash/shell.cc

Issue 680383007: DeviceOrientation API on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 new ash::system::BrightnessControllerChromeos).Pass()); 1059 new ash::system::BrightnessControllerChromeos).Pass());
1057 1060
1058 power_event_observer_.reset(new PowerEventObserver()); 1061 power_event_observer_.reset(new PowerEventObserver());
1059 user_activity_notifier_.reset( 1062 user_activity_notifier_.reset(
1060 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); 1063 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
1061 video_activity_notifier_.reset( 1064 video_activity_notifier_.reset(
1062 new VideoActivityNotifier(video_detector_.get())); 1065 new VideoActivityNotifier(video_detector_.get()));
1063 bluetooth_notification_controller_.reset(new BluetoothNotificationController); 1066 bluetooth_notification_controller_.reset(new BluetoothNotificationController);
1064 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); 1067 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder);
1065 screen_orientation_delegate_.reset(new ScreenOrientationDelegate()); 1068 screen_orientation_delegate_.reset(new ScreenOrientationDelegate());
1069 sensor_manager_delegate_.reset(new SensorManagerDelegateChromeOS);
1066 #endif 1070 #endif
1067 // The compositor thread and main message loop have to be running in 1071 // The compositor thread and main message loop have to be running in
1068 // order to create mirror window. Run it after the main message loop 1072 // order to create mirror window. Run it after the main message loop
1069 // is started. 1073 // is started.
1070 display_manager_->CreateMirrorWindowAsyncIfAny(); 1074 display_manager_->CreateMirrorWindowAsyncIfAny();
1071 } 1075 }
1072 1076
1073 void Shell::InitKeyboard() { 1077 void Shell::InitKeyboard() {
1074 if (keyboard::IsKeyboardEnabled()) { 1078 if (keyboard::IsKeyboardEnabled()) {
1075 if (keyboard::KeyboardController::GetInstance()) { 1079 if (keyboard::KeyboardController::GetInstance()) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 //////////////////////////////////////////////////////////////////////////////// 1164 ////////////////////////////////////////////////////////////////////////////////
1161 // Shell, aura::client::ActivationChangeObserver implementation: 1165 // Shell, aura::client::ActivationChangeObserver implementation:
1162 1166
1163 void Shell::OnWindowActivated(aura::Window* gained_active, 1167 void Shell::OnWindowActivated(aura::Window* gained_active,
1164 aura::Window* lost_active) { 1168 aura::Window* lost_active) {
1165 if (gained_active) 1169 if (gained_active)
1166 target_root_window_ = gained_active->GetRootWindow(); 1170 target_root_window_ = gained_active->GetRootWindow();
1167 } 1171 }
1168 1172
1169 } // namespace ash 1173 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698