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

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

Issue 2325643003: Disables user manager actions only if there is at least one regular profile and they're all locked. (Closed)
Patch Set: Addressed comment Created 4 years, 3 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 3cfa03ca464408ba6dd74ad84cc9d0210f1580ad..304ccc68aa5a351277040961e9f678ad3fb257f6 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -256,8 +256,8 @@ void SetLastUsedProfile(const std::string& profile_dir) {
local_state->SetString(prefs::kProfileLastUsed, profile_dir);
}
-bool AreAllProfilesLocked() {
- bool all_profiles_locked = true;
+bool AreAllNonChildNonSupervisedProfilesLocked() {
+ bool at_least_one_regular_profile_present = false;
std::vector<ProfileAttributesEntry*> entries =
g_browser_process->profile_manager()->GetProfileAttributesStorage().
@@ -266,14 +266,15 @@ bool AreAllProfilesLocked() {
if (entry->IsOmitted())
continue;
- // Supervised and Child profiles cannot be locked.
- if (!entry->IsSigninRequired() &&
- !entry->IsChild() &&
- !entry->IsLegacySupervised()) {
- return false;
+ // Only consider non-child and non-supervised profiles.
+ if (!entry->IsChild() && !entry->IsLegacySupervised()) {
+ at_least_one_regular_profile_present = true;
+
+ if (!entry->IsSigninRequired())
+ return false;
}
}
- return all_profiles_locked;
+ return at_least_one_regular_profile_present;
}
} // namespace profiles
« no previous file with comments | « chrome/browser/profiles/profiles_state.h ('k') | chrome/browser/ui/webui/signin/user_manager_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698