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

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

Issue 2946693002: Use GN buildflags and features to configure account consistency (Closed)
Patch Set: fix 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 ad3303d8be1d4df84147a30fd157c3f5c544172d..61dd356e6c09194ed81fea3e13269d2bd5b68147 100644
--- a/components/signin/core/common/profile_management_switches.cc
+++ b/components/signin/core/common/profile_management_switches.cc
@@ -9,12 +9,13 @@
#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 {
AccountConsistencyMethod GetAccountConsistencyMethod() {
-#if defined(OS_ANDROID) || defined(OS_IOS)
+#if BUILDFLAG(ENABLE_MIRROR)
// Mirror is enabled on Android and iOS.
return AccountConsistencyMethod::kMirror;
#else
@@ -22,10 +23,14 @@ AccountConsistencyMethod GetAccountConsistencyMethod() {
std::string method = cmd->GetSwitchValueASCII(switches::kAccountConsistency);
if (method == switches::kAccountConsistencyMirror)
return AccountConsistencyMethod::kMirror;
+
+#if BUILDFLAG(ENABLE_DICE_SUPPORT)
if (method == switches::kAccountConsistencyDice)
return AccountConsistencyMethod::kDice;
+#endif
+
return AccountConsistencyMethod::kDisabled;
-#endif // defined(OS_ANDROID) || defined(OS_IOS)
+#endif // BUILDFLAG(ENABLE_MIRROR)
}
bool IsAccountConsistencyMirrorEnabled() {
@@ -49,13 +54,13 @@ bool IsExtensionsMultiAccount() {
}
void EnableAccountConsistencyMirrorForTesting(base::CommandLine* command_line) {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#if !BUILDFLAG(ENABLE_MIRROR)
command_line->AppendSwitchASCII(switches::kAccountConsistency,
switches::kAccountConsistencyMirror);
#endif
}
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#if BUILDFLAG(ENABLE_DICE_SUPPORT)
void EnableAccountConsistencyDiceForTesting(base::CommandLine* command_line) {
command_line->AppendSwitchASCII(switches::kAccountConsistency,
switches::kAccountConsistencyDice);
« 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