| Index: chrome/browser/profiles/avatar_menu_model.cc
|
| diff --git a/chrome/browser/profiles/avatar_menu_model.cc b/chrome/browser/profiles/avatar_menu_model.cc
|
| index d6e1418eb59ef0edc0e854e984d736039d6b6b53..6176834a227080bc3668ded25dc090f0bc8cbd72 100644
|
| --- a/chrome/browser/profiles/avatar_menu_model.cc
|
| +++ b/chrome/browser/profiles/avatar_menu_model.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/profiles/avatar_menu_model.h"
|
|
|
| #include "base/bind.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "base/stl_util.h"
|
| #include "base/string_number_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -48,6 +49,10 @@ void OnProfileCreated(bool always_create,
|
| }
|
| }
|
|
|
| +// Constants for the show profile switcher experiment
|
| +const char kShowProfileSwitcherFieldTrialName[] = "ShowProfileSwitcher";
|
| +const char kAlwaysShowSwitcherGroupName[] = "AlwaysShow";
|
| +
|
| } // namespace
|
|
|
| AvatarMenuModel::AvatarMenuModel(ProfileInfoInterface* profile_cache,
|
| @@ -167,6 +172,12 @@ void AvatarMenuModel::Observe(int type,
|
|
|
| // static
|
| bool AvatarMenuModel::ShouldShowAvatarMenu() {
|
| + if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) ==
|
| + kAlwaysShowSwitcherGroupName) {
|
| + // We should only be in this group when multi-profiles is enabled.
|
| + DCHECK(ProfileManager::IsMultipleProfilesEnabled());
|
| + return true;
|
| + }
|
| return ProfileManager::IsMultipleProfilesEnabled() &&
|
| g_browser_process->profile_manager()->GetNumberOfProfiles() > 1;
|
| }
|
|
|