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 |