Chromium Code Reviews| 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 |