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

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: 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..5c674efe0858ded70c956d8535441f72f3b41e69 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;
+
+ if (!entry->IsSigninRequired() &&
dpapad 2016/05/27 23:59:42 Can we hide the complexity of determining whether
anthonyvd 2016/05/30 14:09:28 Semantically, that's what IsSigninRequired is doin
+ !entry->IsChild() &&
+ !entry->IsLegacySupervised()) {
+ all_profiles_locked = false;
+ break;
+ }
+ }
+ return all_profiles_locked;
+}
+
} // namespace profiles

Powered by Google App Engine
This is Rietveld 408576698