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..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 |