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

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

Issue 12040085: Adding show profile switcher field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/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;
}
« no previous file with comments | « chrome/browser/chrome_browser_field_trials.cc ('k') | chrome/browser/profiles/avatar_menu_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698