OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/common/profile_management_switches.h" | 5 #include "components/signin/core/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 "base/metrics/field_trial.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "components/signin/core/common/signin_switches.h" | 10 #include "components/signin/core/common/signin_switches.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 bool IsFastUserSwitching() { | 137 bool IsFastUserSwitching() { |
138 return CommandLine::ForCurrentProcess()->HasSwitch( | 138 return CommandLine::ForCurrentProcess()->HasSwitch( |
139 switches::kFastUserSwitching); | 139 switches::kFastUserSwitching); |
140 } | 140 } |
141 | 141 |
142 bool IsGoogleProfileInfo() { | 142 bool IsGoogleProfileInfo() { |
143 return CheckFlag(switches::kGoogleProfileInfo, STATE_NEW_AVATAR_MENU); | 143 return CheckFlag(switches::kGoogleProfileInfo, STATE_NEW_AVATAR_MENU); |
144 } | 144 } |
145 | 145 |
146 bool IsNewAvatarMenu() { | 146 bool IsNewAvatarMenu() { |
147 // NewAvatarMenu is only available on desktop. | |
148 #if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_CHROMEOS) | |
149 return false; | |
150 #else | |
147 return GetProcessState() >= STATE_NEW_AVATAR_MENU; | 151 return GetProcessState() >= STATE_NEW_AVATAR_MENU; |
152 #endif | |
148 } | 153 } |
149 | 154 |
150 bool IsNewProfileManagement() { | 155 bool IsNewProfileManagement() { |
156 // NewProfileManagement is only available on desktop. | |
Nikita (slow)
2014/08/15 14:56:13
That's not correct.
On Chrome OS "new profile man
dzhioev (left Google)
2014/08/15 15:31:33
I don't know for sure. Chrome OS checks only IsEna
| |
157 #if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_CHROMEOS) | |
158 return false; | |
159 #else | |
151 return GetProcessState() >= STATE_NEW_PROFILE_MANAGEMENT; | 160 return GetProcessState() >= STATE_NEW_PROFILE_MANAGEMENT; |
161 #endif | |
152 } | 162 } |
153 | 163 |
154 bool IsNewProfileManagementPreviewEnabled() { | 164 bool IsNewProfileManagementPreviewEnabled() { |
155 // No promotion to Enable Account Consistency. | 165 // No promotion to Enable Account Consistency. |
156 return false; | 166 return false; |
157 } | 167 } |
158 | 168 |
159 void EnableNewAvatarMenuForTesting(base::CommandLine* command_line) { | 169 void EnableNewAvatarMenuForTesting(base::CommandLine* command_line) { |
160 command_line->AppendSwitch(switches::kEnableNewAvatarMenu); | 170 command_line->AppendSwitch(switches::kEnableNewAvatarMenu); |
161 DCHECK(!command_line->HasSwitch(switches::kDisableNewAvatarMenu)); | 171 DCHECK(!command_line->HasSwitch(switches::kDisableNewAvatarMenu)); |
162 } | 172 } |
163 | 173 |
164 void DisableNewAvatarMenuForTesting(base::CommandLine* command_line) { | 174 void DisableNewAvatarMenuForTesting(base::CommandLine* command_line) { |
165 command_line->AppendSwitch(switches::kDisableNewAvatarMenu); | 175 command_line->AppendSwitch(switches::kDisableNewAvatarMenu); |
166 DCHECK(!command_line->HasSwitch(switches::kEnableNewAvatarMenu)); | 176 DCHECK(!command_line->HasSwitch(switches::kEnableNewAvatarMenu)); |
167 } | 177 } |
168 | 178 |
169 void EnableNewProfileManagementForTesting(base::CommandLine* command_line) { | 179 void EnableNewProfileManagementForTesting(base::CommandLine* command_line) { |
170 command_line->AppendSwitch(switches::kEnableNewProfileManagement); | 180 command_line->AppendSwitch(switches::kEnableNewProfileManagement); |
171 DCHECK(!command_line->HasSwitch(switches::kDisableNewProfileManagement)); | 181 DCHECK(!command_line->HasSwitch(switches::kDisableNewProfileManagement)); |
172 } | 182 } |
173 | 183 |
174 void EnableAccountConsistencyForTesting(base::CommandLine* command_line) { | 184 void EnableAccountConsistencyForTesting(base::CommandLine* command_line) { |
175 command_line->AppendSwitch(switches::kEnableAccountConsistency); | 185 command_line->AppendSwitch(switches::kEnableAccountConsistency); |
176 DCHECK(!command_line->HasSwitch(switches::kDisableAccountConsistency)); | 186 DCHECK(!command_line->HasSwitch(switches::kDisableAccountConsistency)); |
177 } | 187 } |
178 | 188 |
179 } // namespace switches | 189 } // namespace switches |
OLD | NEW |