Commit c4fd99c0 authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

[ProfilePicker]: Do not show the picker if Chrome has only one profile

The account picker isn't supposed to be shown to single-profile users.

This change would also make it easier to write browser tests that
enable the features::kNewProfilePicker flag, since they will land
directly in the browser.

Bug: 1063856
Change-Id: Id947d21686503bb068d4ce7b83c2f88889b064ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324847Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarMonica Basta <msalama@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792738}
parent fad00e37
......@@ -269,7 +269,10 @@ bool CanOpenProfileOnStartup(Profile* profile) {
#if !defined(OS_CHROMEOS)
bool ShouldShowProfilePicker() {
return !signin_util::IsForceSigninEnabled() &&
size_t number_of_profiles = g_browser_process->profile_manager()
->GetProfileAttributesStorage()
.GetNumberOfProfiles();
return !signin_util::IsForceSigninEnabled() && number_of_profiles != 1 &&
base::FeatureList::IsEnabled(features::kNewProfilePicker);
}
#endif // !defined(OS_CHROMEOS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment