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

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

Issue 633233002: Lock only permitted where a supervised user is or was. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | chrome/browser/profiles/profile_window.cc » ('j') | chrome/common/pref_names.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index c2e414899c4036c0cd094f7e5b924abc8dda16ab..1c50724c58e87802df0d7b9fe90dd0ef43f91f6b 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -166,6 +166,12 @@ ProfileInfoCache::ProfileInfoCache(PrefService* prefs,
if (!info->HasKey(kIsUsingDefaultAvatarKey)) {
info->SetBoolean(kIsUsingDefaultAvatarKey, using_default_name);
}
+
+ std::string supervised_user_id;
+ if (info->GetString(kSupervisedUserId, &supervised_user_id) &&
+ !supervised_user_id.empty()) {
+ prefs_->SetBoolean(prefs::kSupervisedUserExistsOrExisted, true);
+ }
}
// If needed, start downloading the high-res avatars and migrate any legacy
@@ -200,6 +206,8 @@ void ProfileInfoCache::AddProfileToCache(
// Default value for whether background apps are running is false.
info->SetBoolean(kBackgroundAppsKey, false);
info->SetString(kSupervisedUserId, supervised_user_id);
+ if (!supervised_user_id.empty())
+ prefs_->SetBoolean(prefs::kSupervisedUserExistsOrExisted, true);
info->SetBoolean(kIsOmittedFromProfileListKey, !supervised_user_id.empty());
info->SetBoolean(kProfileIsEphemeral, false);
info->SetBoolean(kIsUsingDefaultNameKey, IsDefaultProfileName(name));
@@ -550,6 +558,9 @@ void ProfileInfoCache::SetSupervisedUserIdOfProfileAtIndex(
// This takes ownership of |info|.
SetInfoForProfileAtIndex(index, info.release());
+ if (!id.empty())
+ prefs_->SetBoolean(prefs::kSupervisedUserExistsOrExisted, true);
+
base::FilePath profile_path = GetPathOfProfileAtIndex(index);
FOR_EACH_OBSERVER(ProfileInfoCacheObserver,
observer_list_,
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_window.cc » ('j') | chrome/common/pref_names.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698