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

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

Issue 2923733003: [signin] Add DICe flow for account consistency requests. (Closed)
Patch Set: fix style 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..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
« no previous file with comments | « components/signin/core/common/profile_management_switches.h ('k') | components/signin/core/common/signin_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698