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/shell.h" | 10 #include "ash/shell.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "chrome/browser/chromeos/power/brightness_observer.h" | 58 #include "chrome/browser/chromeos/power/brightness_observer.h" |
59 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" | 59 #include "chrome/browser/chromeos/power/idle_action_warning_observer.h" |
60 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" | 60 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" |
61 #include "chrome/browser/chromeos/power/power_button_observer.h" | 61 #include "chrome/browser/chromeos/power/power_button_observer.h" |
62 #include "chrome/browser/chromeos/power/resume_observer.h" | 62 #include "chrome/browser/chromeos/power/resume_observer.h" |
63 #include "chrome/browser/chromeos/power/screen_lock_observer.h" | 63 #include "chrome/browser/chromeos/power/screen_lock_observer.h" |
64 #include "chrome/browser/chromeos/power/suspend_observer.h" | 64 #include "chrome/browser/chromeos/power/suspend_observer.h" |
65 #include "chrome/browser/chromeos/power/user_activity_notifier.h" | 65 #include "chrome/browser/chromeos/power/user_activity_notifier.h" |
66 #include "chrome/browser/chromeos/power/video_activity_notifier.h" | 66 #include "chrome/browser/chromeos/power/video_activity_notifier.h" |
67 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" | 67 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" |
| 68 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h
" |
68 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 69 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
69 #include "chrome/browser/chromeos/settings/owner_key_util.h" | 70 #include "chrome/browser/chromeos/settings/owner_key_util.h" |
70 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" | 71 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" |
71 #include "chrome/browser/chromeos/system/statistics_provider.h" | 72 #include "chrome/browser/chromeos/system/statistics_provider.h" |
72 #include "chrome/browser/chromeos/system_key_event_listener.h" | 73 #include "chrome/browser/chromeos/system_key_event_listener.h" |
73 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" | 74 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" |
74 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 75 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
75 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" | 76 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
76 #include "chrome/browser/defaults.h" | 77 #include "chrome/browser/defaults.h" |
77 #include "chrome/browser/metrics/metrics_service.h" | 78 #include "chrome/browser/metrics/metrics_service.h" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 466 |
466 // Listen for system key events so that the user will be able to adjust the | 467 // Listen for system key events so that the user will be able to adjust the |
467 // volume on the login screen, if Chrome is running on Chrome OS | 468 // volume on the login screen, if Chrome is running on Chrome OS |
468 // (i.e. not Linux desktop), and in non-test mode. | 469 // (i.e. not Linux desktop), and in non-test mode. |
469 // Note: SystemKeyEventListener depends on the DBus thread. | 470 // Note: SystemKeyEventListener depends on the DBus thread. |
470 if (base::chromeos::IsRunningOnChromeOS() && | 471 if (base::chromeos::IsRunningOnChromeOS() && |
471 !parameters().ui_task) { // ui_task is non-NULL when running tests. | 472 !parameters().ui_task) { // ui_task is non-NULL when running tests. |
472 SystemKeyEventListener::Initialize(); | 473 SystemKeyEventListener::Initialize(); |
473 } | 474 } |
474 | 475 |
| 476 chromeos::DeviceOAuth2TokenServiceFactory::Initialize(); |
| 477 |
475 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 478 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
476 } | 479 } |
477 | 480 |
478 void ChromeBrowserMainPartsChromeos::PreProfileInit() { | 481 void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
479 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 482 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
480 // -- immediately before Profile creation(). | 483 // -- immediately before Profile creation(). |
481 | 484 |
482 // Now that the file thread exists we can record our stats. | 485 // Now that the file thread exists we can record our stats. |
483 BootTimesLoader::Get()->RecordChromeMainStats(); | 486 BootTimesLoader::Get()->RecordChromeMainStats(); |
484 | 487 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", | 719 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", |
717 true); | 720 true); |
718 | 721 |
719 g_browser_process->oom_priority_manager()->Stop(); | 722 g_browser_process->oom_priority_manager()->Stop(); |
720 | 723 |
721 // Stops LoginUtils background fetchers. This is needed because IO thread is | 724 // Stops LoginUtils background fetchers. This is needed because IO thread is |
722 // going to stop soon after this function. The pending background jobs could | 725 // going to stop soon after this function. The pending background jobs could |
723 // cause it to crash during shutdown. | 726 // cause it to crash during shutdown. |
724 LoginUtils::Get()->StopBackgroundFetchers(); | 727 LoginUtils::Get()->StopBackgroundFetchers(); |
725 | 728 |
| 729 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. |
| 730 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown(); |
| 731 |
726 // Shutdown the upgrade detector for Chrome OS. The upgrade detector | 732 // Shutdown the upgrade detector for Chrome OS. The upgrade detector |
727 // stops monitoring changes from the update engine. | 733 // stops monitoring changes from the update engine. |
728 if (UpgradeDetectorChromeos::GetInstance()) | 734 if (UpgradeDetectorChromeos::GetInstance()) |
729 UpgradeDetectorChromeos::GetInstance()->Shutdown(); | 735 UpgradeDetectorChromeos::GetInstance()->Shutdown(); |
730 | 736 |
731 // Shutdown the network change notifier for Chrome OS. The network | 737 // Shutdown the network change notifier for Chrome OS. The network |
732 // change notifier stops monitoring changes from the power manager and | 738 // change notifier stops monitoring changes from the power manager and |
733 // the network manager. | 739 // the network manager. |
734 if (CrosNetworkChangeNotifierFactory::GetInstance()) | 740 if (CrosNetworkChangeNotifierFactory::GetInstance()) |
735 CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown(); | 741 CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 851 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
846 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 852 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
847 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 853 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
848 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 854 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
849 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 855 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
850 // This is necessary to start the experiment as a side effect. | 856 // This is necessary to start the experiment as a side effect. |
851 trial->group(); | 857 trial->group(); |
852 } | 858 } |
853 | 859 |
854 } // namespace chromeos | 860 } // namespace chromeos |
OLD | NEW |