Chromium Code Reviews| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 #include "chromeos/dbus/dbus_thread_manager.h" | 86 #include "chromeos/dbus/dbus_thread_manager.h" |
| 87 #include "chromeos/dbus/power_policy_controller.h" | 87 #include "chromeos/dbus/power_policy_controller.h" |
| 88 #include "chromeos/dbus/session_manager_client.h" | 88 #include "chromeos/dbus/session_manager_client.h" |
| 89 #include "chromeos/disks/disk_mount_manager.h" | 89 #include "chromeos/disks/disk_mount_manager.h" |
| 90 #include "chromeos/ime/input_method_manager.h" | 90 #include "chromeos/ime/input_method_manager.h" |
| 91 #include "chromeos/ime/xkeyboard.h" | 91 #include "chromeos/ime/xkeyboard.h" |
| 92 #include "chromeos/login/login_state.h" | 92 #include "chromeos/login/login_state.h" |
| 93 #include "chromeos/network/network_change_notifier_chromeos.h" | 93 #include "chromeos/network/network_change_notifier_chromeos.h" |
| 94 #include "chromeos/network/network_change_notifier_factory_chromeos.h" | 94 #include "chromeos/network/network_change_notifier_factory_chromeos.h" |
| 95 #include "chromeos/network/network_handler.h" | 95 #include "chromeos/network/network_handler.h" |
| 96 #include "chromeos/power/power_data_collector.h" | |
| 96 #include "chromeos/system/statistics_provider.h" | 97 #include "chromeos/system/statistics_provider.h" |
| 97 #include "content/public/browser/browser_thread.h" | 98 #include "content/public/browser/browser_thread.h" |
| 98 #include "content/public/browser/notification_service.h" | 99 #include "content/public/browser/notification_service.h" |
| 99 #include "content/public/browser/power_save_blocker.h" | 100 #include "content/public/browser/power_save_blocker.h" |
| 100 #include "content/public/common/main_function_params.h" | 101 #include "content/public/common/main_function_params.h" |
| 101 #include "grit/platform_locale_settings.h" | 102 #include "grit/platform_locale_settings.h" |
| 102 #include "media/audio/sounds/sounds_manager.h" | 103 #include "media/audio/sounds/sounds_manager.h" |
| 103 #include "net/base/network_change_notifier.h" | 104 #include "net/base/network_change_notifier.h" |
| 104 #include "net/url_request/url_request.h" | 105 #include "net/url_request/url_request.h" |
| 105 #include "net/url_request/url_request_context_getter.h" | 106 #include "net/url_request/url_request_context_getter.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 | 332 |
| 332 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( | 333 ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( |
| 333 const content::MainFunctionParams& parameters) | 334 const content::MainFunctionParams& parameters) |
| 334 : ChromeBrowserMainPartsLinux(parameters) { | 335 : ChromeBrowserMainPartsLinux(parameters) { |
| 335 } | 336 } |
| 336 | 337 |
| 337 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { | 338 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { |
| 338 if (KioskModeSettings::Get()->IsKioskModeEnabled()) | 339 if (KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 339 ShutdownKioskModeScreensaver(); | 340 ShutdownKioskModeScreensaver(); |
| 340 | 341 |
| 342 // Since DBusThreadManager is shutdown via the DBusServices destructor, it is | |
| 343 // safe to shutdown the PowerDataCollector here. | |
| 344 PowerDataCollector::Shutdown(); | |
|
Daniel Erat
2013/12/12 01:31:52
(i'll let steven comment on whether there's a bett
| |
| 345 | |
| 341 // To be precise, logout (browser shutdown) is not yet done, but the | 346 // To be precise, logout (browser shutdown) is not yet done, but the |
| 342 // remaining work is negligible, hence we say LogoutDone here. | 347 // remaining work is negligible, hence we say LogoutDone here. |
| 343 BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", false); | 348 BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", false); |
| 344 BootTimesLoader::Get()->WriteLogoutTimes(); | 349 BootTimesLoader::Get()->WriteLogoutTimes(); |
| 345 } | 350 } |
| 346 | 351 |
| 347 // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- | 352 // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- |
| 348 | 353 |
| 349 void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() { | 354 void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() { |
| 350 CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); | 355 CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 new NetworkChangeNotifierFactoryChromeos()); | 397 new NetworkChangeNotifierFactoryChromeos()); |
| 393 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); | 398 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); |
| 394 } | 399 } |
| 395 | 400 |
| 396 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { | 401 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { |
| 397 base::MessageLoopForUI* message_loop = base::MessageLoopForUI::current(); | 402 base::MessageLoopForUI* message_loop = base::MessageLoopForUI::current(); |
| 398 message_loop->AddObserver(g_message_loop_observer.Pointer()); | 403 message_loop->AddObserver(g_message_loop_observer.Pointer()); |
| 399 | 404 |
| 400 dbus_services_.reset(new internal::DBusServices(parameters())); | 405 dbus_services_.reset(new internal::DBusServices(parameters())); |
| 401 | 406 |
| 407 // Initialize power data collector only after DBusThreadManager is initialized | |
| 408 // in the DBusServices. | |
| 409 PowerDataCollector::Initialize(); | |
|
Daniel Erat
2013/12/12 01:31:52
same here
| |
| 410 | |
| 402 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); | 411 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); |
| 403 } | 412 } |
| 404 | 413 |
| 405 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. | 414 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. |
| 406 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. | 415 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. |
| 407 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 416 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
| 408 // Set the crypto thread after the IO thread has been created/started. | 417 // Set the crypto thread after the IO thread has been created/started. |
| 409 CertLoader::Get()->SetCryptoTaskRunner( | 418 CertLoader::Get()->SetCryptoTaskRunner( |
| 410 content::BrowserThread::GetMessageLoopProxyForThread( | 419 content::BrowserThread::GetMessageLoopProxyForThread( |
| 411 content::BrowserThread::IO)); | 420 content::BrowserThread::IO)); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 771 | 780 |
| 772 // Destroy DeviceSettingsService after g_browser_process. | 781 // Destroy DeviceSettingsService after g_browser_process. |
| 773 DeviceSettingsService::Shutdown(); | 782 DeviceSettingsService::Shutdown(); |
| 774 } | 783 } |
| 775 | 784 |
| 776 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 785 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
| 777 default_pinned_apps_field_trial::SetupTrial(); | 786 default_pinned_apps_field_trial::SetupTrial(); |
| 778 } | 787 } |
| 779 | 788 |
| 780 } // namespace chromeos | 789 } // namespace chromeos |
| OLD | NEW |