| Index: components/signin/core/common/profile_management_switches.cc
|
| diff --git a/components/signin/core/common/profile_management_switches.cc b/components/signin/core/common/profile_management_switches.cc
|
| index 80d025b12594ebafc3f4c4c355ae2030cf4ffded..33cac231a2a4eaaec404abf98502770ed9a0fa3a 100644
|
| --- a/components/signin/core/common/profile_management_switches.cc
|
| +++ b/components/signin/core/common/profile_management_switches.cc
|
| @@ -9,22 +9,29 @@
|
| #include "base/command_line.h"
|
| #include "base/feature_list.h"
|
| #include "base/metrics/field_trial.h"
|
| -#include "build/build_config.h"
|
| #include "components/signin/core/common/signin_switches.h"
|
|
|
| namespace switches {
|
|
|
| -bool IsAccountConsistencyMirrorEnabled() {
|
| +AccountConsistencyMethod GetAccountConsistencyMethod() {
|
| #if defined(OS_ANDROID) || defined(OS_IOS)
|
| - // Account consistency is enabled on Android and iOS.
|
| - return true;
|
| + // Mirror is enabled on Android and iOS.
|
| + return AccountConsistencyMethod::kMirror;
|
| #else
|
| base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
|
| - return cmd->GetSwitchValueASCII(switches::kAccountConsistency) ==
|
| - switches::kAccountConsistencyMirror;
|
| + std::string method = cmd->GetSwitchValueASCII(switches::kAccountConsistency);
|
| + if (method == switches::kAccountConsistencyMirror)
|
| + return AccountConsistencyMethod::kMirror;
|
| + if (method == switches::kAccountConsistencyDice)
|
| + return AccountConsistencyMethod::kDice;
|
| + return AccountConsistencyMethod::kDisabled;
|
| #endif // defined(OS_ANDROID) || defined(OS_IOS)
|
| }
|
|
|
| +bool IsAccountConsistencyMirrorEnabled() {
|
| + return GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror;
|
| +}
|
| +
|
| bool IsExtensionsMultiAccount() {
|
| #if defined(OS_ANDROID) || defined(OS_IOS)
|
| NOTREACHED() << "Extensions are not enabled on Android or iOS";
|
| @@ -34,7 +41,7 @@ bool IsExtensionsMultiAccount() {
|
|
|
| return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kExtensionsMultiAccount) ||
|
| - IsAccountConsistencyMirrorEnabled();
|
| + GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror;
|
| }
|
|
|
| void EnableAccountConsistencyMirrorForTesting(base::CommandLine* command_line) {
|
| @@ -44,4 +51,11 @@ void EnableAccountConsistencyMirrorForTesting(base::CommandLine* command_line) {
|
| #endif
|
| }
|
|
|
| +#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
| +void EnableAccountConsistencyDiceForTesting(base::CommandLine* command_line) {
|
| + command_line->AppendSwitchASCII(switches::kAccountConsistency,
|
| + switches::kAccountConsistencyDice);
|
| +}
|
| +#endif
|
| +
|
| } // namespace switches
|
|
|