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

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

Issue 2025433002: MD User Manager: Display error message when all profiles are locked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 4 years, 7 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
Index: chrome/browser/profiles/profiles_state.cc
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
index 2735fc6ba4303d110fb18c9d3945d21ae6903d8a..e3acad3245bcec2402530d7f62da5aba6b7dbbf0 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -256,4 +256,24 @@ void SetLastUsedProfile(const std::string& profile_dir) {
local_state->SetString(prefs::kProfileLastUsed, profile_dir);
}
+bool AreAllProfilesLocked() {
+ bool all_profiles_locked = true;
+
+ std::vector<ProfileAttributesEntry*> entries =
+ g_browser_process->profile_manager()->GetProfileAttributesStorage().
+ GetAllProfilesAttributes();
+ for (const ProfileAttributesEntry* entry : entries) {
+ if (entry->IsOmitted())
+ continue;
+
+ // Supervised and Child profiles cannot be locked.
+ if (!entry->IsSigninRequired() &&
+ !entry->IsChild() &&
+ !entry->IsLegacySupervised()) {
+ return false;
+ }
+ }
+ return all_profiles_locked;
+}
+
} // namespace profiles
« no previous file with comments | « chrome/browser/profiles/profiles_state.h ('k') | chrome/browser/resources/md_user_manager/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698