OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 27 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
28 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
30 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
31 #include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h" | 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h" |
32 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 32 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
33 #include "chrome/browser/chromeos/audio/audio_handler.h" | 33 #include "chrome/browser/chromeos/audio/audio_handler.h" |
34 #include "chrome/browser/chromeos/boot_times_loader.h" | 34 #include "chrome/browser/chromeos/boot_times_loader.h" |
35 #include "chrome/browser/chromeos/contacts/contact_manager.h" | 35 #include "chrome/browser/chromeos/contacts/contact_manager.h" |
36 #include "chrome/browser/chromeos/cros/cert_library.h" | |
36 #include "chrome/browser/chromeos/cros/cros_library.h" | 37 #include "chrome/browser/chromeos/cros/cros_library.h" |
37 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 38 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
38 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 39 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
39 #include "chrome/browser/chromeos/extensions/default_app_order.h" | 40 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
40 #include "chrome/browser/chromeos/external_metrics.h" | 41 #include "chrome/browser/chromeos/external_metrics.h" |
41 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 42 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
42 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 43 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
43 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 44 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
44 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 45 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
45 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 46 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 #include "chromeos/chromeos_switches.h" | 98 #include "chromeos/chromeos_switches.h" |
98 #include "chromeos/cryptohome/async_method_caller.h" | 99 #include "chromeos/cryptohome/async_method_caller.h" |
99 #include "chromeos/cryptohome/cryptohome_library.h" | 100 #include "chromeos/cryptohome/cryptohome_library.h" |
100 #include "chromeos/dbus/dbus_thread_manager.h" | 101 #include "chromeos/dbus/dbus_thread_manager.h" |
101 #include "chromeos/dbus/power_manager_client.h" | 102 #include "chromeos/dbus/power_manager_client.h" |
102 #include "chromeos/dbus/session_manager_client.h" | 103 #include "chromeos/dbus/session_manager_client.h" |
103 #include "chromeos/disks/disk_mount_manager.h" | 104 #include "chromeos/disks/disk_mount_manager.h" |
104 #include "chromeos/ime/input_method_manager.h" | 105 #include "chromeos/ime/input_method_manager.h" |
105 #include "chromeos/ime/xkeyboard.h" | 106 #include "chromeos/ime/xkeyboard.h" |
106 #include "chromeos/login/login_state.h" | 107 #include "chromeos/login/login_state.h" |
108 #include "chromeos/network/cert_loader.h" | |
107 #include "chromeos/network/geolocation_handler.h" | 109 #include "chromeos/network/geolocation_handler.h" |
108 #include "chromeos/network/managed_network_configuration_handler.h" | 110 #include "chromeos/network/managed_network_configuration_handler.h" |
109 #include "chromeos/network/network_change_notifier_chromeos.h" | 111 #include "chromeos/network/network_change_notifier_chromeos.h" |
110 #include "chromeos/network/network_change_notifier_factory_chromeos.h" | 112 #include "chromeos/network/network_change_notifier_factory_chromeos.h" |
111 #include "chromeos/network/network_configuration_handler.h" | 113 #include "chromeos/network/network_configuration_handler.h" |
112 #include "chromeos/network/network_event_log.h" | 114 #include "chromeos/network/network_event_log.h" |
113 #include "chromeos/network/network_state_handler.h" | 115 #include "chromeos/network/network_state_handler.h" |
114 #include "content/public/browser/browser_thread.h" | 116 #include "content/public/browser/browser_thread.h" |
115 #include "content/public/browser/notification_service.h" | 117 #include "content/public/browser/notification_service.h" |
116 #include "content/public/browser/power_save_blocker.h" | 118 #include "content/public/browser/power_save_blocker.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 } | 264 } |
263 } | 265 } |
264 | 266 |
265 void RunAutoLaunchKioskApp() { | 267 void RunAutoLaunchKioskApp() { |
266 // KioskAppLauncher deletes itself when done. | 268 // KioskAppLauncher deletes itself when done. |
267 (new KioskAppLauncher( | 269 (new KioskAppLauncher( |
268 KioskAppManager::Get()->GetAutoLaunchApp()))->Start(); | 270 KioskAppManager::Get()->GetAutoLaunchApp()))->Start(); |
269 | 271 |
270 // Login screen is skipped but 'login-prompt-visible' signal is still needed. | 272 // Login screen is skipped but 'login-prompt-visible' signal is still needed. |
271 LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible"; | 273 LOG(INFO) << "Kiosk app auto launch >> login-prompt-visible"; |
272 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 274 DBusThreadManager::Get()->GetSessionManagerClient()-> |
273 EmitLoginPromptVisible(); | 275 EmitLoginPromptVisible(); |
274 } | 276 } |
275 | 277 |
276 bool UseNewAudioHandler() { | 278 bool UseNewAudioHandler() { |
277 return !CommandLine::ForCurrentProcess()-> | 279 return !CommandLine::ForCurrentProcess()-> |
278 HasSwitch(ash::switches::kAshDisableNewAudioHandler); | 280 HasSwitch(ash::switches::kAshDisableNewAudioHandler); |
279 } | 281 } |
280 | 282 |
281 } // namespace | 283 } // namespace |
282 | 284 |
283 namespace internal { | 285 namespace internal { |
284 | 286 |
285 // Wrapper class for initializing dbus related services and shutting them | 287 // Wrapper class for initializing dbus related services and shutting them |
286 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the | 288 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the |
287 // destructor will get called if and only if this has been instantiated. | 289 // destructor will get called if and only if this has been instantiated. |
288 class DBusServices { | 290 class DBusServices { |
pneubeck (no reviews)
2013/05/02 14:58:35
The name of this class and its comment don't match
stevenjb
2013/05/03 01:00:31
Agreed. I plan to do a cleanup pass soon after 28
| |
289 public: | 291 public: |
290 explicit DBusServices(const content::MainFunctionParams& parameters) | 292 explicit DBusServices(const content::MainFunctionParams& parameters) |
291 : cros_initialized_(false) { | 293 : cros_initialized_(false) { |
292 // Initialize CrosLibrary only for the browser, unless running tests | 294 // Initialize CrosLibrary only for the browser, unless running tests |
293 // (which do their own CrosLibrary setup). | 295 // (which do their own CrosLibrary setup). |
294 if (!parameters.ui_task) { | 296 if (!parameters.ui_task) { |
295 const bool use_stub = !base::chromeos::IsRunningOnChromeOS(); | 297 const bool use_stub = !base::chromeos::IsRunningOnChromeOS(); |
296 CrosLibrary::Initialize(use_stub); | 298 CrosLibrary::Initialize(use_stub); |
297 cros_initialized_ = true; | 299 cros_initialized_ = true; |
298 } | 300 } |
299 | 301 |
300 // Initialize DBusThreadManager for the browser. This must be done after | 302 // Initialize DBusThreadManager for the browser. This must be done after |
301 // the main message loop is started, as it uses the message loop. | 303 // the main message loop is started, as it uses the message loop. |
302 DBusThreadManager::Initialize(); | 304 DBusThreadManager::Initialize(); |
303 CrosDBusService::Initialize(); | 305 CrosDBusService::Initialize(); |
304 | 306 |
307 LoginState::Initialize(); | |
308 CertLoader::Initialize(); | |
309 CertLibrary::Initialize(); | |
305 CryptohomeLibrary::Initialize(); | 310 CryptohomeLibrary::Initialize(); |
306 | 311 |
307 // This function and SystemKeyEventListener use InputMethodManager. | 312 // This function and SystemKeyEventListener use InputMethodManager. |
308 chromeos::input_method::Initialize( | 313 chromeos::input_method::Initialize( |
309 content::BrowserThread::GetMessageLoopProxyForThread( | 314 content::BrowserThread::GetMessageLoopProxyForThread( |
310 content::BrowserThread::UI), | 315 content::BrowserThread::UI), |
311 content::BrowserThread::GetMessageLoopProxyForThread( | 316 content::BrowserThread::GetMessageLoopProxyForThread( |
312 content::BrowserThread::FILE)); | 317 content::BrowserThread::FILE)); |
313 disks::DiskMountManager::Initialize(); | 318 disks::DiskMountManager::Initialize(); |
314 cryptohome::AsyncMethodCaller::Initialize(); | 319 cryptohome::AsyncMethodCaller::Initialize(); |
315 | 320 |
316 chromeos::LoginState::Initialize(); | |
317 | |
318 // Always initialize these handlers which should not conflict with | 321 // Always initialize these handlers which should not conflict with |
319 // NetworkLibrary. | 322 // NetworkLibrary. |
320 chromeos::network_event_log::Initialize(); | 323 network_event_log::Initialize(); |
321 chromeos::GeolocationHandler::Initialize(); | 324 GeolocationHandler::Initialize(); |
322 chromeos::NetworkStateHandler::Initialize(); | 325 NetworkStateHandler::Initialize(); |
323 | 326 |
324 chromeos::NetworkConfigurationHandler::Initialize(); | 327 NetworkConfigurationHandler::Initialize(); |
325 chromeos::ManagedNetworkConfigurationHandler::Initialize(); | 328 ManagedNetworkConfigurationHandler::Initialize(); |
326 | 329 |
327 // Initialize the network change notifier for Chrome OS. The network | 330 // Initialize the network change notifier for Chrome OS. The network |
328 // change notifier starts to monitor changes from the power manager and | 331 // change notifier starts to monitor changes from the power manager and |
329 // the network manager. | 332 // the network manager. |
330 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 333 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
331 chromeos::switches::kDisableNewNetworkChangeNotifier)) { | 334 chromeos::switches::kDisableNewNetworkChangeNotifier)) { |
332 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); | 335 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); |
333 } else { | 336 } else { |
334 CrosNetworkChangeNotifierFactory::GetInstance()->Init(); | 337 CrosNetworkChangeNotifierFactory::GetInstance()->Init(); |
335 } | 338 } |
336 | 339 |
337 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade | 340 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade |
338 // detector starts to monitor changes from the update engine. | 341 // detector starts to monitor changes from the update engine. |
339 UpgradeDetectorChromeos::GetInstance()->Init(); | 342 UpgradeDetectorChromeos::GetInstance()->Init(); |
340 | 343 |
341 if (base::chromeos::IsRunningOnChromeOS()) { | 344 if (base::chromeos::IsRunningOnChromeOS()) { |
342 // Disable Num Lock on X start up for http://crosbug.com/29169. | 345 // Disable Num Lock on X start up for http://crosbug.com/29169. |
343 input_method::GetInputMethodManager()->GetXKeyboard()-> | 346 input_method::GetInputMethodManager()->GetXKeyboard()-> |
344 SetNumLockEnabled(false); | 347 SetNumLockEnabled(false); |
345 } | 348 } |
346 | 349 |
347 // Initialize the device settings service so that we'll take actions per | 350 // Initialize the device settings service so that we'll take actions per |
348 // signals sent from the session manager. This needs to happen before | 351 // signals sent from the session manager. This needs to happen before |
349 // g_browser_process initializes BrowserPolicyConnector. | 352 // g_browser_process initializes BrowserPolicyConnector. |
350 DeviceSettingsService::Initialize(); | 353 DeviceSettingsService::Initialize(); |
351 DeviceSettingsService::Get()->SetSessionManager( | 354 DeviceSettingsService::Get()->SetSessionManager( |
352 DBusThreadManager::Get()->GetSessionManagerClient(), | 355 DBusThreadManager::Get()->GetSessionManagerClient(), |
353 OwnerKeyUtil::Create()); | 356 OwnerKeyUtil::Create()); |
354 chromeos::ConnectivityStateHelper::Initialize(); | 357 ConnectivityStateHelper::Initialize(); |
355 } | 358 } |
356 | 359 |
357 ~DBusServices() { | 360 ~DBusServices() { |
358 chromeos::ConnectivityStateHelper::Shutdown(); | 361 ConnectivityStateHelper::Shutdown(); |
359 // CrosLibrary is shut down before DBusThreadManager even though it | 362 // CrosLibrary is shut down before DBusThreadManager even though it |
360 // is initialized first becuase some of its libraries depend on DBus | 363 // is initialized first becuase some of its libraries depend on DBus |
361 // clients. | 364 // clients. |
362 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. | 365 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. |
363 // (crosbug.com/26160) | 366 // (crosbug.com/26160) |
364 if (cros_initialized_ && CrosLibrary::Get()) | 367 if (cros_initialized_ && CrosLibrary::Get()) |
365 CrosLibrary::Shutdown(); | 368 CrosLibrary::Shutdown(); |
366 | 369 |
367 chromeos::ManagedNetworkConfigurationHandler::Shutdown(); | 370 ManagedNetworkConfigurationHandler::Shutdown(); |
368 chromeos::NetworkConfigurationHandler::Shutdown(); | 371 NetworkConfigurationHandler::Shutdown(); |
369 | 372 |
370 chromeos::NetworkStateHandler::Shutdown(); | 373 NetworkStateHandler::Shutdown(); |
371 chromeos::GeolocationHandler::Shutdown(); | 374 GeolocationHandler::Shutdown(); |
372 chromeos::network_event_log::Shutdown(); | 375 network_event_log::Shutdown(); |
373 | 376 |
374 chromeos::LoginState::Shutdown(); | 377 LoginState::Shutdown(); |
375 | 378 |
376 cryptohome::AsyncMethodCaller::Shutdown(); | 379 cryptohome::AsyncMethodCaller::Shutdown(); |
377 disks::DiskMountManager::Shutdown(); | 380 disks::DiskMountManager::Shutdown(); |
378 input_method::Shutdown(); | 381 input_method::Shutdown(); |
379 CryptohomeLibrary::Shutdown(); | 382 CryptohomeLibrary::Shutdown(); |
383 CertLibrary::Shutdown(); | |
pneubeck (no reviews)
2013/05/02 14:58:35
Shutdown of CertLoader?
Can you use the reverse o
stevenjb
2013/05/03 01:00:31
Done.
| |
380 CrosDBusService::Shutdown(); | 384 CrosDBusService::Shutdown(); |
381 // NOTE: This must only be called if Initialize() was called. | 385 // NOTE: This must only be called if Initialize() was called. |
382 DBusThreadManager::Shutdown(); | 386 DBusThreadManager::Shutdown(); |
383 } | 387 } |
384 | 388 |
385 private: | 389 private: |
386 bool cros_initialized_; | 390 bool cros_initialized_; |
387 | 391 |
388 DISALLOW_COPY_AND_ASSIGN(DBusServices); | 392 DISALLOW_COPY_AND_ASSIGN(DBusServices); |
389 }; | 393 }; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
501 | 505 |
502 // Listen for system key events so that the user will be able to adjust the | 506 // Listen for system key events so that the user will be able to adjust the |
503 // volume on the login screen, if Chrome is running on Chrome OS | 507 // volume on the login screen, if Chrome is running on Chrome OS |
504 // (i.e. not Linux desktop), and in non-test mode. | 508 // (i.e. not Linux desktop), and in non-test mode. |
505 // Note: SystemKeyEventListener depends on the DBus thread. | 509 // Note: SystemKeyEventListener depends on the DBus thread. |
506 if (base::chromeos::IsRunningOnChromeOS() && | 510 if (base::chromeos::IsRunningOnChromeOS() && |
507 !parameters().ui_task) { // ui_task is non-NULL when running tests. | 511 !parameters().ui_task) { // ui_task is non-NULL when running tests. |
508 SystemKeyEventListener::Initialize(); | 512 SystemKeyEventListener::Initialize(); |
509 } | 513 } |
510 | 514 |
511 chromeos::DeviceOAuth2TokenServiceFactory::Initialize(); | 515 DeviceOAuth2TokenServiceFactory::Initialize(); |
512 | 516 |
513 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 517 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
514 } | 518 } |
515 | 519 |
516 void ChromeBrowserMainPartsChromeos::PreProfileInit() { | 520 void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
517 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 521 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
518 // -- immediately before Profile creation(). | 522 // -- immediately before Profile creation(). |
519 | 523 |
520 // Now that the file thread exists we can record our stats. | 524 // Now that the file thread exists we can record our stats. |
521 BootTimesLoader::Get()->RecordChromeMainStats(); | 525 BootTimesLoader::Get()->RecordChromeMainStats(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
586 user_manager->SessionStarted(); | 590 user_manager->SessionStarted(); |
587 } | 591 } |
588 | 592 |
589 if (!app_order_loader_) { | 593 if (!app_order_loader_) { |
590 app_order_loader_.reset( | 594 app_order_loader_.reset( |
591 new default_app_order::ExternalLoader(true /* async */)); | 595 new default_app_order::ExternalLoader(true /* async */)); |
592 } | 596 } |
593 | 597 |
594 // Initialize magnification manager before ash tray is created. And this must | 598 // Initialize magnification manager before ash tray is created. And this must |
595 // be placed after UserManager::SessionStarted(); | 599 // be placed after UserManager::SessionStarted(); |
596 chromeos::MagnificationManager::Initialize(); | 600 MagnificationManager::Initialize(); |
597 | 601 |
598 // Add observers for WallpaperManager. This depends on PowerManagerClient, | 602 // Add observers for WallpaperManager. This depends on PowerManagerClient, |
599 // TimezoneSettings and CrosSettings. | 603 // TimezoneSettings and CrosSettings. |
600 WallpaperManager::Get()->AddObservers(); | 604 WallpaperManager::Get()->AddObservers(); |
601 | 605 |
602 #if defined(USE_LINUX_BREAKPAD) | 606 #if defined(USE_LINUX_BREAKPAD) |
603 cros_version_loader_.GetVersion(VersionLoader::VERSION_FULL, | 607 cros_version_loader_.GetVersion(VersionLoader::VERSION_FULL, |
604 base::Bind(&ChromeOSVersionCallback), | 608 base::Bind(&ChromeOSVersionCallback), |
605 &tracker_); | 609 &tracker_); |
606 #endif | 610 #endif |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
749 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); | 753 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", true); |
750 | 754 |
751 g_browser_process->platform_part()->oom_priority_manager()->Stop(); | 755 g_browser_process->platform_part()->oom_priority_manager()->Stop(); |
752 | 756 |
753 // Stops LoginUtils background fetchers. This is needed because IO thread is | 757 // Stops LoginUtils background fetchers. This is needed because IO thread is |
754 // going to stop soon after this function. The pending background jobs could | 758 // going to stop soon after this function. The pending background jobs could |
755 // cause it to crash during shutdown. | 759 // cause it to crash during shutdown. |
756 LoginUtils::Get()->StopBackgroundFetchers(); | 760 LoginUtils::Get()->StopBackgroundFetchers(); |
757 | 761 |
758 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. | 762 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. |
759 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown(); | 763 DeviceOAuth2TokenServiceFactory::Shutdown(); |
760 | 764 |
761 // Shutdown the upgrade detector for Chrome OS. The upgrade detector | 765 // Shutdown the upgrade detector for Chrome OS. The upgrade detector |
762 // stops monitoring changes from the update engine. | 766 // stops monitoring changes from the update engine. |
763 if (UpgradeDetectorChromeos::GetInstance()) | 767 if (UpgradeDetectorChromeos::GetInstance()) |
764 UpgradeDetectorChromeos::GetInstance()->Shutdown(); | 768 UpgradeDetectorChromeos::GetInstance()->Shutdown(); |
765 | 769 |
766 // Shutdown the network change notifier for Chrome OS. The network | 770 // Shutdown the network change notifier for Chrome OS. The network |
767 // change notifier stops monitoring changes from the power manager and | 771 // change notifier stops monitoring changes from the power manager and |
768 // the network manager. | 772 // the network manager. |
769 if (CrosNetworkChangeNotifierFactory::GetInstance()) | 773 if (CrosNetworkChangeNotifierFactory::GetInstance()) |
(...skipping 16 matching lines...) Expand all Loading... | |
786 suspend_observer_.reset(); | 790 suspend_observer_.reset(); |
787 resume_observer_.reset(); | 791 resume_observer_.reset(); |
788 brightness_observer_.reset(); | 792 brightness_observer_.reset(); |
789 retail_mode_power_save_blocker_.reset(); | 793 retail_mode_power_save_blocker_.reset(); |
790 peripheral_battery_observer_.reset(); | 794 peripheral_battery_observer_.reset(); |
791 | 795 |
792 // The XInput2 event listener needs to be shut down earlier than when | 796 // The XInput2 event listener needs to be shut down earlier than when |
793 // Singletons are finally destroyed in AtExitManager. | 797 // Singletons are finally destroyed in AtExitManager. |
794 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 798 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
795 | 799 |
796 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call, | 800 // SystemKeyEventListener::Shutdown() is always safe to call, |
797 // even if Initialize() wasn't called. | 801 // even if Initialize() wasn't called. |
798 SystemKeyEventListener::Shutdown(); | 802 SystemKeyEventListener::Shutdown(); |
799 imageburner::BurnManager::Shutdown(); | 803 imageburner::BurnManager::Shutdown(); |
800 if (UseNewAudioHandler()) { | 804 if (UseNewAudioHandler()) { |
801 CrasAudioHandler::Shutdown(); | 805 CrasAudioHandler::Shutdown(); |
802 } else { | 806 } else { |
803 AudioHandler::Shutdown(); | 807 AudioHandler::Shutdown(); |
804 } | 808 } |
805 | 809 |
806 if (CommandLine::ForCurrentProcess()->HasSwitch( | 810 if (CommandLine::ForCurrentProcess()->HasSwitch( |
807 chromeos::switches::kEnableChromeAudioSwitching)) | 811 chromeos::switches::kEnableChromeAudioSwitching)) |
808 CrasAudioSwitchHandler::Shutdown(); | 812 CrasAudioSwitchHandler::Shutdown(); |
809 | 813 |
810 WebSocketProxyController::Shutdown(); | 814 WebSocketProxyController::Shutdown(); |
811 | 815 |
812 // Let classes unregister themselves as observers of the ash::Shell singleton | 816 // Let classes unregister themselves as observers of the ash::Shell singleton |
813 // before the shell is destroyed. | 817 // before the shell is destroyed. |
814 user_activity_notifier_.reset(); | 818 user_activity_notifier_.reset(); |
815 video_activity_notifier_.reset(); | 819 video_activity_notifier_.reset(); |
816 display_configuration_observer_.reset(); | 820 display_configuration_observer_.reset(); |
817 | 821 |
818 // Detach D-Bus clients before DBusThreadManager is shut down. | 822 // Detach D-Bus clients before DBusThreadManager is shut down. |
819 power_button_observer_.reset(); | 823 power_button_observer_.reset(); |
820 screensaver_controller_.reset(); | 824 screensaver_controller_.reset(); |
821 idle_action_warning_observer_.reset(); | 825 idle_action_warning_observer_.reset(); |
822 | 826 |
823 // Delete ContactManager while |g_browser_process| is still alive. | 827 // Delete ContactManager while |g_browser_process| is still alive. |
824 contact_manager_.reset(); | 828 contact_manager_.reset(); |
825 | 829 |
826 chromeos::MagnificationManager::Shutdown(); | 830 MagnificationManager::Shutdown(); |
827 | 831 |
828 // Let the UserManager and WallpaperManager unregister itself as an observer | 832 // Let the UserManager and WallpaperManager unregister itself as an observer |
829 // of the CrosSettings singleton before it is destroyed. | 833 // of the CrosSettings singleton before it is destroyed. |
830 UserManager::Get()->Shutdown(); | 834 UserManager::Get()->Shutdown(); |
831 WallpaperManager::Get()->Shutdown(); | 835 WallpaperManager::Get()->Shutdown(); |
832 | 836 |
833 // Let the AutomaticRebootManager unregister itself as an observer of several | 837 // Let the AutomaticRebootManager unregister itself as an observer of several |
834 // subsystems. | 838 // subsystems. |
835 automatic_reboot_manager_.reset(); | 839 automatic_reboot_manager_.reset(); |
836 | 840 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
891 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 895 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
892 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 896 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
893 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 897 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
894 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 898 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
895 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 899 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
896 // This is necessary to start the experiment as a side effect. | 900 // This is necessary to start the experiment as a side effect. |
897 trial->group(); | 901 trial->group(); |
898 } | 902 } |
899 | 903 |
900 } // namespace chromeos | 904 } // namespace chromeos |
OLD | NEW |