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

Unified Diff: components/signin/core/common/profile_management_switches.cc

Issue 2923733003: [signin] Add DICe flow for account consistency requests. (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
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..5f6e80e830f3b52f9680f1e3e40ebce0b0c93a6d 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,8 @@ bool IsExtensionsMultiAccount() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kExtensionsMultiAccount) ||
- IsAccountConsistencyMirrorEnabled();
+ GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror ||
+ GetAccountConsistencyMethod() == AccountConsistencyMethod::kDice;
msarda 2017/06/07 13:06:31 Let's not enable yet multi-account extension for D
droger 2017/06/08 13:58:10 Ok. Filed crbug.com/731066 to track this.
}
void EnableAccountConsistencyMirrorForTesting(base::CommandLine* command_line) {
@@ -44,4 +52,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

Powered by Google App Engine
This is Rietveld 408576698