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

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

Issue 253723004: Add ProfileImpl::UpdateProfileManagedUserIdCache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 4f434b906a4bfe1d348283f808c7ef81dfb21374..264839ed21810e6ff0cf92e13f0b5a8a0edc125a 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -502,6 +502,10 @@ void ProfileImpl::DoFinalInit() {
base::Bind(&ProfileImpl::UpdateProfileUserNameCache,
base::Unretained(this)));
pref_change_registrar_.Add(
+ prefs::kManagedUserId,
+ base::Bind(&ProfileImpl::UpdateProfileManagedUserIdCache,
+ base::Unretained(this)));
+ pref_change_registrar_.Add(
prefs::kDefaultZoomLevel,
base::Bind(&ProfileImpl::OnDefaultZoomLevelChanged,
base::Unretained(this)));
@@ -532,6 +536,7 @@ void ProfileImpl::DoFinalInit() {
// kGoogleServicesUsername, initialize components that depend on it to reflect
// the current value.
UpdateProfileUserNameCache();
+ UpdateProfileManagedUserIdCache();
UpdateProfileIsEphemeralCache();
GAIAInfoUpdateServiceFactory::GetForProfile(this);
@@ -1251,6 +1256,17 @@ void ProfileImpl::UpdateProfileUserNameCache() {
}
}
+void ProfileImpl::UpdateProfileManagedUserIdCache() {
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
+ size_t index = cache.GetIndexOfProfileWithPath(GetPath());
+ if (index != std::string::npos) {
+ std::string managed_user_id = GetPrefs()->GetString(prefs::kManagedUserId);
+ cache.SetManagedUserIdOfProfileAtIndex(index, managed_user_id);
+ ProfileMetrics::UpdateReportedProfilesStatistics(profile_manager);
+ }
+}
+
void ProfileImpl::UpdateProfileNameCache() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698