| 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 | |
| 151 return GetProcessState() >= STATE_NEW_AVATAR_MENU; | 147 return GetProcessState() >= STATE_NEW_AVATAR_MENU; |
| 152 #endif | |
| 153 } | 148 } |
| 154 | 149 |
| 155 bool IsNewProfileManagement() { | 150 bool IsNewProfileManagement() { |
| 156 // NewProfileManagement is only available on desktop. | |
| 157 #if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_CHROMEOS) | |
| 158 return false; | |
| 159 #else | |
| 160 return GetProcessState() >= STATE_NEW_PROFILE_MANAGEMENT; | 151 return GetProcessState() >= STATE_NEW_PROFILE_MANAGEMENT; |
| 161 #endif | |
| 162 } | 152 } |
| 163 | 153 |
| 164 bool IsNewProfileManagementPreviewEnabled() { | 154 bool IsNewProfileManagementPreviewEnabled() { |
| 165 // No promotion to Enable Account Consistency. | 155 // No promotion to Enable Account Consistency. |
| 166 return false; | 156 return false; |
| 167 } | 157 } |
| 168 | 158 |
| 169 void EnableNewAvatarMenuForTesting(base::CommandLine* command_line) { | 159 void EnableNewAvatarMenuForTesting(base::CommandLine* command_line) { |
| 170 command_line->AppendSwitch(switches::kEnableNewAvatarMenu); | 160 command_line->AppendSwitch(switches::kEnableNewAvatarMenu); |
| 171 DCHECK(!command_line->HasSwitch(switches::kDisableNewAvatarMenu)); | 161 DCHECK(!command_line->HasSwitch(switches::kDisableNewAvatarMenu)); |
| 172 } | 162 } |
| 173 | 163 |
| 174 void DisableNewAvatarMenuForTesting(base::CommandLine* command_line) { | 164 void DisableNewAvatarMenuForTesting(base::CommandLine* command_line) { |
| 175 command_line->AppendSwitch(switches::kDisableNewAvatarMenu); | 165 command_line->AppendSwitch(switches::kDisableNewAvatarMenu); |
| 176 DCHECK(!command_line->HasSwitch(switches::kEnableNewAvatarMenu)); | 166 DCHECK(!command_line->HasSwitch(switches::kEnableNewAvatarMenu)); |
| 177 } | 167 } |
| 178 | 168 |
| 179 void EnableNewProfileManagementForTesting(base::CommandLine* command_line) { | 169 void EnableNewProfileManagementForTesting(base::CommandLine* command_line) { |
| 180 command_line->AppendSwitch(switches::kEnableNewProfileManagement); | 170 command_line->AppendSwitch(switches::kEnableNewProfileManagement); |
| 181 DCHECK(!command_line->HasSwitch(switches::kDisableNewProfileManagement)); | 171 DCHECK(!command_line->HasSwitch(switches::kDisableNewProfileManagement)); |
| 182 } | 172 } |
| 183 | 173 |
| 184 void EnableAccountConsistencyForTesting(base::CommandLine* command_line) { | 174 void EnableAccountConsistencyForTesting(base::CommandLine* command_line) { |
| 185 command_line->AppendSwitch(switches::kEnableAccountConsistency); | 175 command_line->AppendSwitch(switches::kEnableAccountConsistency); |
| 186 DCHECK(!command_line->HasSwitch(switches::kDisableAccountConsistency)); | 176 DCHECK(!command_line->HasSwitch(switches::kDisableAccountConsistency)); |
| 187 } | 177 } |
| 188 | 178 |
| 189 } // namespace switches | 179 } // namespace switches |
| OLD | NEW |