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

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: Isolate Chrome OS changes Created 6 years, 1 month 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 #include "ui/wm/core/user_activity_detector.h" 113 #include "ui/wm/core/user_activity_detector.h"
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/accelerometer/sensor_manager_delegate.h"
123 #include "ash/ash_constants.h" 124 #include "ash/ash_constants.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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 display_configurator_->RemoveObserver(display_change_observer_.get()); 810 display_configurator_->RemoveObserver(display_change_observer_.get());
810 if (display_configurator_animation_) 811 if (display_configurator_animation_)
811 display_configurator_->RemoveObserver( 812 display_configurator_->RemoveObserver(
812 display_configurator_animation_.get()); 813 display_configurator_animation_.get());
813 if (display_error_observer_) 814 if (display_error_observer_)
814 display_configurator_->RemoveObserver(display_error_observer_.get()); 815 display_configurator_->RemoveObserver(display_error_observer_.get());
815 if (projecting_observer_) 816 if (projecting_observer_)
816 display_configurator_->RemoveObserver(projecting_observer_.get()); 817 display_configurator_->RemoveObserver(projecting_observer_.get());
817 display_change_observer_.reset(); 818 display_change_observer_.reset();
818 819
820 sensor_manager_delegate_.reset();
821
819 PowerStatus::Shutdown(); 822 PowerStatus::Shutdown();
820 823
821 // Ensure that DBusThreadManager outlives this Shell. 824 // Ensure that DBusThreadManager outlives this Shell.
822 DCHECK(chromeos::DBusThreadManager::IsInitialized()); 825 DCHECK(chromeos::DBusThreadManager::IsInitialized());
823 #endif 826 #endif
824 827
825 DCHECK(instance_ == this); 828 DCHECK(instance_ == this);
826 instance_ = NULL; 829 instance_ = NULL;
827 } 830 }
828 831
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 scoped_ptr<ash::BrightnessControlDelegate>( 1056 scoped_ptr<ash::BrightnessControlDelegate>(
1054 new ash::system::BrightnessControllerChromeos).Pass()); 1057 new ash::system::BrightnessControllerChromeos).Pass());
1055 1058
1056 power_event_observer_.reset(new PowerEventObserver()); 1059 power_event_observer_.reset(new PowerEventObserver());
1057 user_activity_notifier_.reset( 1060 user_activity_notifier_.reset(
1058 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); 1061 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
1059 video_activity_notifier_.reset( 1062 video_activity_notifier_.reset(
1060 new VideoActivityNotifier(video_detector_.get())); 1063 new VideoActivityNotifier(video_detector_.get()));
1061 bluetooth_notification_controller_.reset(new BluetoothNotificationController); 1064 bluetooth_notification_controller_.reset(new BluetoothNotificationController);
1062 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder); 1065 last_window_closed_logout_reminder_.reset(new LastWindowClosedLogoutReminder);
1066 sensor_manager_delegate_.reset(new SensorManagerDelegate);
timvolodine 2014/11/07 03:27:39 does this mean we are continuously observing senso
flackr 2014/11/07 19:30:46 Agreed, we should try to limit the lifetime of thi
jonross 2014/11/10 22:39:09 Observing will now only occur after the delegate h
1063 #endif 1067 #endif
1064 1068
1065 weak_display_manager_factory_.reset( 1069 weak_display_manager_factory_.reset(
1066 new base::WeakPtrFactory<DisplayManager>(display_manager_.get())); 1070 new base::WeakPtrFactory<DisplayManager>(display_manager_.get()));
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 base::MessageLoopForUI::current()->PostTask( 1074 base::MessageLoopForUI::current()->PostTask(
1071 FROM_HERE, 1075 FROM_HERE,
1072 base::Bind(&DisplayManager::CreateMirrorWindowIfAny, 1076 base::Bind(&DisplayManager::CreateMirrorWindowIfAny,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 //////////////////////////////////////////////////////////////////////////////// 1167 ////////////////////////////////////////////////////////////////////////////////
1164 // Shell, aura::client::ActivationChangeObserver implementation: 1168 // Shell, aura::client::ActivationChangeObserver implementation:
1165 1169
1166 void Shell::OnWindowActivated(aura::Window* gained_active, 1170 void Shell::OnWindowActivated(aura::Window* gained_active,
1167 aura::Window* lost_active) { 1171 aura::Window* lost_active) {
1168 if (gained_active) 1172 if (gained_active)
1169 target_root_window_ = gained_active->GetRootWindow(); 1173 target_root_window_ = gained_active->GetRootWindow();
1170 } 1174 }
1171 1175
1172 } // namespace ash 1176 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698