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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 1380103004: Delay fetching account info until OnRefreshTokensLoaded(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix iOs Created 5 years, 1 month 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/signin/account_fetcher_service_factory.cc » ('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) 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 "chrome/browser/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/deferred_sequenced_task_runner.h" 11 #include "base/deferred_sequenced_task_runner.h"
12 #include "base/files/file_enumerator.h" 12 #include "base/files/file_enumerator.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/metrics/histogram_macros.h" 15 #include "base/metrics/histogram_macros.h"
16 #include "base/prefs/pref_service.h" 16 #include "base/prefs/pref_service.h"
17 #include "base/prefs/scoped_user_pref_update.h" 17 #include "base/prefs/scoped_user_pref_update.h"
18 #include "base/profiler/scoped_profile.h" 18 #include "base/profiler/scoped_profile.h"
19 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/trace_event/trace_event.h" 22 #include "base/trace_event/trace_event.h"
23 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 23 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
24 #include "chrome/browser/bookmarks/startup_task_runner_service_factory.h" 24 #include "chrome/browser/bookmarks/startup_task_runner_service_factory.h"
25 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
26 #include "chrome/browser/chrome_notification_types.h" 26 #include "chrome/browser/chrome_notification_types.h"
27 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 27 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
28 #include "chrome/browser/download/download_service.h" 28 #include "chrome/browser/download/download_service.h"
29 #include "chrome/browser/download/download_service_factory.h" 29 #include "chrome/browser/download/download_service_factory.h"
30 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
30 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
32 #include "chrome/browser/password_manager/password_manager_setting_migrator_serv ice.h" 33 #include "chrome/browser/password_manager/password_manager_setting_migrator_serv ice.h"
33 #include "chrome/browser/password_manager/password_manager_setting_migrator_serv ice_factory.h" 34 #include "chrome/browser/password_manager/password_manager_setting_migrator_serv ice_factory.h"
34 #include "chrome/browser/password_manager/password_store_factory.h" 35 #include "chrome/browser/password_manager/password_store_factory.h"
35 #include "chrome/browser/prefs/incognito_mode_prefs.h" 36 #include "chrome/browser/prefs/incognito_mode_prefs.h"
36 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" 37 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
37 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 38 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
38 #include "chrome/browser/profiles/profile_destroyer.h" 39 #include "chrome/browser/profiles/profile_destroyer.h"
39 #include "chrome/browser/profiles/profile_info_cache.h" 40 #include "chrome/browser/profiles/profile_info_cache.h"
(...skipping 15 matching lines...) Expand all
55 #include "chrome/common/chrome_paths_internal.h" 56 #include "chrome/common/chrome_paths_internal.h"
56 #include "chrome/common/chrome_switches.h" 57 #include "chrome/common/chrome_switches.h"
57 #include "chrome/common/logging_chrome.h" 58 #include "chrome/common/logging_chrome.h"
58 #include "chrome/common/pref_names.h" 59 #include "chrome/common/pref_names.h"
59 #include "chrome/common/url_constants.h" 60 #include "chrome/common/url_constants.h"
60 #include "chrome/grit/generated_resources.h" 61 #include "chrome/grit/generated_resources.h"
61 #include "components/bookmarks/browser/bookmark_model.h" 62 #include "components/bookmarks/browser/bookmark_model.h"
62 #include "components/bookmarks/browser/startup_task_runner_service.h" 63 #include "components/bookmarks/browser/startup_task_runner_service.h"
63 #include "components/bookmarks/common/bookmark_pref_names.h" 64 #include "components/bookmarks/common/bookmark_pref_names.h"
64 #include "components/content_settings/core/browser/host_content_settings_map.h" 65 #include "components/content_settings/core/browser/host_content_settings_map.h"
66 #include "components/invalidation/impl/profile_invalidation_provider.h"
67 #include "components/invalidation/public/invalidation_service.h"
65 #include "components/password_manager/core/browser/password_store.h" 68 #include "components/password_manager/core/browser/password_store.h"
66 #include "components/signin/core/browser/account_fetcher_service.h" 69 #include "components/signin/core/browser/account_fetcher_service.h"
67 #include "components/signin/core/browser/account_tracker_service.h" 70 #include "components/signin/core/browser/account_tracker_service.h"
68 #include "components/signin/core/browser/gaia_cookie_manager_service.h" 71 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
69 #include "components/signin/core/browser/signin_manager.h" 72 #include "components/signin/core/browser/signin_manager.h"
70 #include "components/signin/core/common/profile_management_switches.h" 73 #include "components/signin/core/common/profile_management_switches.h"
71 #include "components/signin/core/common/signin_pref_names.h" 74 #include "components/signin/core/common/signin_pref_names.h"
72 #include "content/public/browser/browser_thread.h" 75 #include "content/public/browser/browser_thread.h"
73 #include "content/public/browser/notification_service.h" 76 #include "content/public/browser/notification_service.h"
74 #include "content/public/browser/user_metrics.h" 77 #include "content/public/browser/user_metrics.h"
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 // Start the deferred task runners once the profile is loaded. 1111 // Start the deferred task runners once the profile is loaded.
1109 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> 1112 StartupTaskRunnerServiceFactory::GetForProfile(profile)->
1110 StartDeferredTaskRunners(); 1113 StartDeferredTaskRunners();
1111 1114
1112 // Activate data reduction proxy. This creates a request context and makes a 1115 // Activate data reduction proxy. This creates a request context and makes a
1113 // URL request to check if the data reduction proxy server is reachable. 1116 // URL request to check if the data reduction proxy server is reachable.
1114 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile)-> 1117 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile)->
1115 MaybeActivateDataReductionProxy(true); 1118 MaybeActivateDataReductionProxy(true);
1116 1119
1117 GaiaCookieManagerServiceFactory::GetForProfile(profile)->Init(); 1120 GaiaCookieManagerServiceFactory::GetForProfile(profile)->Init();
1118 AccountFetcherServiceFactory::GetForProfile(profile)->EnableNetworkFetches(); 1121 invalidation::ProfileInvalidationProvider* invalidation_provider =
1122 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile);
1123 // Chrome OS login and guest profiles do not support invalidation. This is
1124 // fine as they do not have GAIA credentials anyway. http://crbug.com/358169
1125 invalidation::InvalidationService* invalidation_service =
1126 invalidation_provider ? invalidation_provider->GetInvalidationService()
1127 : nullptr;
1128 AccountFetcherServiceFactory::GetForProfile(profile)
1129 ->SetupInvalidations(invalidation_service);
1119 AccountReconcilorFactory::GetForProfile(profile); 1130 AccountReconcilorFactory::GetForProfile(profile);
1120 1131
1121 // Service is responsible for migration of the legacy password manager 1132 // Service is responsible for migration of the legacy password manager
1122 // preference which controls behaviour of the Chrome to the new preference 1133 // preference which controls behaviour of the Chrome to the new preference
1123 // which controls password management behaviour on Chrome and Android. After 1134 // which controls password management behaviour on Chrome and Android. After
1124 // migration will be performed for all users it's planned to remove the 1135 // migration will be performed for all users it's planned to remove the
1125 // migration code, rough time estimates are Q1 2016. 1136 // migration code, rough time estimates are Q1 2016.
1126 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) 1137 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile)
1127 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); 1138 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile));
1128 } 1139 }
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 1514
1504 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1515 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1505 if (!original_callback.is_null()) 1516 if (!original_callback.is_null())
1506 original_callback.Run(loaded_profile, status); 1517 original_callback.Run(loaded_profile, status);
1507 } 1518 }
1508 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 1519 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
1509 1520
1510 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1521 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1511 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1522 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1512 } 1523 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/account_fetcher_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698