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

Unified Diff: chrome/common/profile_management_switches.cc

Issue 111033005: Support experiment control of profile-management flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use ! instead of ^ to return desired state Created 6 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
« no previous file with comments | « chrome/common/profile_management_switches.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/profile_management_switches.cc
diff --git a/chrome/common/profile_management_switches.cc b/chrome/common/profile_management_switches.cc
index 634eb216d19a6acdd4789634ff27edaceeff95d8..8215b99e084ff4e5669bfc027e92f00216d1c57f 100644
--- a/chrome/common/profile_management_switches.cc
+++ b/chrome/common/profile_management_switches.cc
@@ -5,23 +5,39 @@
#include "chrome/common/profile_management_switches.h"
#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "chrome/common/chrome_switches.h"
+namespace {
+
+const char kNewProfileManagementFieldTrialName[] = "NewProfileManagement";
+
+bool CheckProfileManagementFlag(std::string command_switch, bool active_state) {
+ std::string trial_type =
+ base::FieldTrialList::FindFullName(kNewProfileManagementFieldTrialName);
+ if (!trial_type.empty()) {
+ if (trial_type == "Enabled")
+ return active_state;
+ if (trial_type == "Disabled")
+ return !active_state;
+ }
+ return CommandLine::ForCurrentProcess()->HasSwitch(command_switch);
acleung1 2014/01/14 22:20:27 Hi Brian. Shouldn't this take priority? For peopl
+}
+
+} // namespace
+
namespace switches {
-bool IsEnableInlineSignin() {
- return !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableWebBasedSignin);
+bool IsEnableWebBasedSignin() {
+ return CheckProfileManagementFlag(switches::kEnableWebBasedSignin, false);
}
bool IsGoogleProfileInfo() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kGoogleProfileInfo);
+ return CheckProfileManagementFlag(switches::kGoogleProfileInfo, true);
}
bool IsNewProfileManagement() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kNewProfileManagement);
+ return CheckProfileManagementFlag(switches::kNewProfileManagement, true);
}
} // namespace switches
« no previous file with comments | « chrome/common/profile_management_switches.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698