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 |