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

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 comments 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..67e8fc17a24a8865dc147aad678c028a4af7354c 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -256,4 +256,25 @@ 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()) {
+ all_profiles_locked = false;
+ break;
Roger Tawa OOO till Jul 10th 2016/05/30 19:03:45 Nit: maybe just return false?
Moe 2016/05/30 20:21:18 Done.
+ }
+ }
+ return all_profiles_locked;
+}
+
} // namespace profiles

Powered by Google App Engine
This is Rietveld 408576698