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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 12647008: Refactor OAuth2TokenService to have profile- and device-based implementations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Refactor Android integration into separate AndroidProfileOAuth2TokenService class. Created 7 years, 8 months 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/settings/device_oauth2_token_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 464
464 // Listen for system key events so that the user will be able to adjust the 465 // Listen for system key events so that the user will be able to adjust the
465 // volume on the login screen, if Chrome is running on Chrome OS 466 // volume on the login screen, if Chrome is running on Chrome OS
466 // (i.e. not Linux desktop), and in non-test mode. 467 // (i.e. not Linux desktop), and in non-test mode.
467 // Note: SystemKeyEventListener depends on the DBus thread. 468 // Note: SystemKeyEventListener depends on the DBus thread.
468 if (base::chromeos::IsRunningOnChromeOS() && 469 if (base::chromeos::IsRunningOnChromeOS() &&
469 !parameters().ui_task) { // ui_task is non-NULL when running tests. 470 !parameters().ui_task) { // ui_task is non-NULL when running tests.
470 SystemKeyEventListener::Initialize(); 471 SystemKeyEventListener::Initialize();
471 } 472 }
472 473
474 chromeos::DeviceOAuth2TokenServiceFactory::Initialize();
475
473 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); 476 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun();
474 } 477 }
475 478
476 void ChromeBrowserMainPartsChromeos::PreProfileInit() { 479 void ChromeBrowserMainPartsChromeos::PreProfileInit() {
477 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 480 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
478 // -- immediately before Profile creation(). 481 // -- immediately before Profile creation().
479 482
480 // Now that the file thread exists we can record our stats. 483 // Now that the file thread exists we can record our stats.
481 BootTimesLoader::Get()->RecordChromeMainStats(); 484 BootTimesLoader::Get()->RecordChromeMainStats();
482 485
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded", 717 BootTimesLoader::Get()->AddLogoutTimeMarker("UIMessageLoopEnded",
715 true); 718 true);
716 719
717 g_browser_process->oom_priority_manager()->Stop(); 720 g_browser_process->oom_priority_manager()->Stop();
718 721
719 // Stops LoginUtils background fetchers. This is needed because IO thread is 722 // Stops LoginUtils background fetchers. This is needed because IO thread is
720 // going to stop soon after this function. The pending background jobs could 723 // going to stop soon after this function. The pending background jobs could
721 // cause it to crash during shutdown. 724 // cause it to crash during shutdown.
722 LoginUtils::Get()->StopBackgroundFetchers(); 725 LoginUtils::Get()->StopBackgroundFetchers();
723 726
727 // Stops all in-flight OAuth2 token fetchers before the IO thread stops.
728 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown();
729
724 // Shutdown the upgrade detector for Chrome OS. The upgrade detector 730 // Shutdown the upgrade detector for Chrome OS. The upgrade detector
725 // stops monitoring changes from the update engine. 731 // stops monitoring changes from the update engine.
726 if (UpgradeDetectorChromeos::GetInstance()) 732 if (UpgradeDetectorChromeos::GetInstance())
727 UpgradeDetectorChromeos::GetInstance()->Shutdown(); 733 UpgradeDetectorChromeos::GetInstance()->Shutdown();
728 734
729 // Shutdown the network change notifier for Chrome OS. The network 735 // Shutdown the network change notifier for Chrome OS. The network
730 // change notifier stops monitoring changes from the power manager and 736 // change notifier stops monitoring changes from the power manager and
731 // the network manager. 737 // the network manager.
732 if (CrosNetworkChangeNotifierFactory::GetInstance()) 738 if (CrosNetworkChangeNotifierFactory::GetInstance())
733 CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown(); 739 CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 841 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
836 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 842 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
837 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 843 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
838 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 844 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
839 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 845 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
840 // This is necessary to start the experiment as a side effect. 846 // This is necessary to start the experiment as a side effect.
841 trial->group(); 847 trial->group();
842 } 848 }
843 849
844 } // namespace chromeos 850 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/settings/device_oauth2_token_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698