OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/profile_management_switches.h" | 5 #include "chrome/common/profile_management_switches.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | |
8 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
9 | 10 |
11 namespace { | |
12 | |
13 const char kNewProfileManagementFieldTrialName[] = "NewProfileManagement"; | |
14 | |
15 bool CheckProfileManagementFlag(std::string command_switch, bool active_state) { | |
16 std::string trial_type = | |
17 base::FieldTrialList::FindFullName(kNewProfileManagementFieldTrialName); | |
18 if (!trial_type.empty()) { | |
19 if (trial_type == "Enabled") | |
20 return active_state; | |
21 if (trial_type == "Disabled") | |
22 return !active_state; | |
23 } | |
24 return CommandLine::ForCurrentProcess()->HasSwitch(command_switch); | |
acleung1
2014/01/14 22:20:27
Hi Brian.
Shouldn't this take priority? For peopl
| |
25 } | |
26 | |
27 } // namespace | |
28 | |
10 namespace switches { | 29 namespace switches { |
11 | 30 |
12 bool IsEnableInlineSignin() { | 31 bool IsEnableWebBasedSignin() { |
13 return !CommandLine::ForCurrentProcess()->HasSwitch( | 32 return CheckProfileManagementFlag(switches::kEnableWebBasedSignin, false); |
14 switches::kEnableWebBasedSignin); | |
15 } | 33 } |
16 | 34 |
17 bool IsGoogleProfileInfo() { | 35 bool IsGoogleProfileInfo() { |
18 return CommandLine::ForCurrentProcess()->HasSwitch( | 36 return CheckProfileManagementFlag(switches::kGoogleProfileInfo, true); |
19 switches::kGoogleProfileInfo); | |
20 } | 37 } |
21 | 38 |
22 bool IsNewProfileManagement() { | 39 bool IsNewProfileManagement() { |
23 return CommandLine::ForCurrentProcess()->HasSwitch( | 40 return CheckProfileManagementFlag(switches::kNewProfileManagement, true); |
24 switches::kNewProfileManagement); | |
25 } | 41 } |
26 | 42 |
27 } // namespace switches | 43 } // namespace switches |
OLD | NEW |