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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/profile_management_switches.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« 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