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

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: give bcwhite OWNER permission for new switches file 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..e2f7283ac4b255420063c1e5c2ef801c804c0de8 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 negate) {
+ std::string trial_type =
+ base::FieldTrialList::FindFullName(kNewProfileManagementFieldTrialName);
+ if (!trial_type.empty()) {
+ if (trial_type == "Enabled")
+ return true ^ negate;
+ if (trial_type == "Disabled")
+ return false ^ negate;
Roger Tawa OOO till Jul 10th 2014/01/07 17:01:54 Nit: since: true^negate == !negate false^negat
bcwhite 2014/01/07 21:23:20 Done.
+ }
+ return CommandLine::ForCurrentProcess()->HasSwitch(command_switch);
+}
+
+} // namespace
+
namespace switches {
-bool IsEnableInlineSignin() {
- return !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableWebBasedSignin);
+bool IsEnableWebBasedSignin() {
+ return CheckProfileManagementFlag(switches::kEnableWebBasedSignin, true);
}
bool IsGoogleProfileInfo() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kGoogleProfileInfo);
+ return CheckProfileManagementFlag(switches::kGoogleProfileInfo, false);
}
bool IsNewProfileManagement() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kNewProfileManagement);
+ return CheckProfileManagementFlag(switches::kNewProfileManagement, false);
}
} // 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