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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/signin/chrome_signin_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index b4af151f25fe08903f6931cdba7a60f112934fe0..a026bfd6aded35c27abb237a7e911c2845802db0 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/profiles/startup_task_runner_service_factory.h"
#include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -53,6 +54,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/password_manager/core/browser/password_store.h"
+#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -1182,8 +1184,10 @@ void ProfileManager::AddProfileToCache(Profile* profile) {
if (cache.GetIndexOfProfileWithPath(profile->GetPath()) != std::string::npos)
return;
- base::string16 username = base::UTF8ToUTF16(profile->GetPrefs()->GetString(
- prefs::kGoogleServicesUsername));
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(profile);
+ base::string16 username = base::UTF8ToUTF16(
+ signin_manager->GetAuthenticatedUsername());
// Profile name and avatar are set by InitProfileUserPrefs and stored in the
// profile. Use those values to setup the cache entry.
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/signin/chrome_signin_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698