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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 #include "ash/system/chromeos/power/power_event_observer.h" | 134 #include "ash/system/chromeos/power/power_event_observer.h" |
135 #include "ash/system/chromeos/power/power_status.h" | 135 #include "ash/system/chromeos/power/power_status.h" |
136 #include "ash/system/chromeos/power/video_activity_notifier.h" | 136 #include "ash/system/chromeos/power/video_activity_notifier.h" |
137 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" | 137 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" |
138 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 138 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
139 #include "ash/touch/touch_transformer_controller.h" | 139 #include "ash/touch/touch_transformer_controller.h" |
140 #include "ash/virtual_keyboard_controller.h" | 140 #include "ash/virtual_keyboard_controller.h" |
141 #include "base/bind_helpers.h" | 141 #include "base/bind_helpers.h" |
142 #include "base/sys_info.h" | 142 #include "base/sys_info.h" |
143 #include "chromeos/dbus/dbus_thread_manager.h" | 143 #include "chromeos/dbus/dbus_thread_manager.h" |
144 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | |
144 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 145 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
145 #include "ui/display/chromeos/display_configurator.h" | 146 #include "ui/display/chromeos/display_configurator.h" |
146 #endif // defined(OS_CHROMEOS) | 147 #endif // defined(OS_CHROMEOS) |
147 | 148 |
148 namespace ash { | 149 namespace ash { |
149 | 150 |
150 namespace { | 151 namespace { |
151 | 152 |
152 using aura::Window; | 153 using aura::Window; |
153 using views::Widget; | 154 using views::Widget; |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 delegate_->PreInit(); | 848 delegate_->PreInit(); |
848 bool display_initialized = display_manager_->InitFromCommandLine(); | 849 bool display_initialized = display_manager_->InitFromCommandLine(); |
849 #if defined(OS_CHROMEOS) | 850 #if defined(OS_CHROMEOS) |
850 display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); | 851 display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); |
851 display_configurator_animation_.reset(new DisplayConfiguratorAnimation()); | 852 display_configurator_animation_.reset(new DisplayConfiguratorAnimation()); |
852 display_configurator_->AddObserver(display_configurator_animation_.get()); | 853 display_configurator_->AddObserver(display_configurator_animation_.get()); |
853 | 854 |
854 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. | 855 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. |
855 chromeos::DBusThreadManager* dbus_thread_manager = | 856 chromeos::DBusThreadManager* dbus_thread_manager = |
856 chromeos::DBusThreadManager::Get(); | 857 chromeos::DBusThreadManager::Get(); |
858 | |
859 if (!bluez::BluezDBusManager::IsInitialized()) { | |
860 bluez::BluezDBusManager::Initialize( | |
861 dbus_thread_manager->GetSystemBus(), | |
862 dbus_thread_manager->IsUsingStub( | |
863 chromeos::DBusClientBundle::BLUETOOTH)); | |
864 } | |
oshima
2015/09/28 17:34:12
can you move this to AshTestHelper? That's where D
rkc
2015/09/28 17:53:13
Done.
| |
865 | |
857 projecting_observer_.reset( | 866 projecting_observer_.reset( |
858 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); | 867 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); |
859 display_configurator_->AddObserver(projecting_observer_.get()); | 868 display_configurator_->AddObserver(projecting_observer_.get()); |
860 AddShellObserver(projecting_observer_.get()); | 869 AddShellObserver(projecting_observer_.get()); |
861 | 870 |
862 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { | 871 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { |
863 display_change_observer_.reset(new DisplayChangeObserver); | 872 display_change_observer_.reset(new DisplayChangeObserver); |
864 // Register |display_change_observer_| first so that the rest of | 873 // Register |display_change_observer_| first so that the rest of |
865 // observer gets invoked after the root windows are configured. | 874 // observer gets invoked after the root windows are configured. |
866 display_configurator_->AddObserver(display_change_observer_.get()); | 875 display_configurator_->AddObserver(display_change_observer_.get()); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1186 | 1195 |
1187 void Shell::OnWindowActivated( | 1196 void Shell::OnWindowActivated( |
1188 aura::client::ActivationChangeObserver::ActivationReason reason, | 1197 aura::client::ActivationChangeObserver::ActivationReason reason, |
1189 aura::Window* gained_active, | 1198 aura::Window* gained_active, |
1190 aura::Window* lost_active) { | 1199 aura::Window* lost_active) { |
1191 if (gained_active) | 1200 if (gained_active) |
1192 target_root_window_ = gained_active->GetRootWindow(); | 1201 target_root_window_ = gained_active->GetRootWindow(); |
1193 } | 1202 } |
1194 | 1203 |
1195 } // namespace ash | 1204 } // namespace ash |
OLD | NEW |