| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 if (method == switches::kAccountConsistencyDice) | 25 if (method == switches::kAccountConsistencyDice) |
| 26 return AccountConsistencyMethod::kDice; | 26 return AccountConsistencyMethod::kDice; |
| 27 return AccountConsistencyMethod::kDisabled; | 27 return AccountConsistencyMethod::kDisabled; |
| 28 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 28 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool IsAccountConsistencyMirrorEnabled() { | 31 bool IsAccountConsistencyMirrorEnabled() { |
| 32 return GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror; | 32 return GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror; |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool IsAccountConsistencyDiceEnabled() { |
| 36 return GetAccountConsistencyMethod() == AccountConsistencyMethod::kDice; |
| 37 } |
| 38 |
| 35 bool IsExtensionsMultiAccount() { | 39 bool IsExtensionsMultiAccount() { |
| 36 #if defined(OS_ANDROID) || defined(OS_IOS) | 40 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 37 NOTREACHED() << "Extensions are not enabled on Android or iOS"; | 41 NOTREACHED() << "Extensions are not enabled on Android or iOS"; |
| 38 // Account consistency is enabled on Android and iOS. | 42 // Account consistency is enabled on Android and iOS. |
| 39 return false; | 43 return false; |
| 40 #endif | 44 #endif |
| 41 | 45 |
| 42 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 46 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 43 switches::kExtensionsMultiAccount) || | 47 switches::kExtensionsMultiAccount) || |
| 44 GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror; | 48 GetAccountConsistencyMethod() == AccountConsistencyMethod::kMirror; |
| 45 } | 49 } |
| 46 | 50 |
| 47 void EnableAccountConsistencyMirrorForTesting(base::CommandLine* command_line) { | 51 void EnableAccountConsistencyMirrorForTesting(base::CommandLine* command_line) { |
| 48 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 52 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 49 command_line->AppendSwitchASCII(switches::kAccountConsistency, | 53 command_line->AppendSwitchASCII(switches::kAccountConsistency, |
| 50 switches::kAccountConsistencyMirror); | 54 switches::kAccountConsistencyMirror); |
| 51 #endif | 55 #endif |
| 52 } | 56 } |
| 53 | 57 |
| 54 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 58 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 55 void EnableAccountConsistencyDiceForTesting(base::CommandLine* command_line) { | 59 void EnableAccountConsistencyDiceForTesting(base::CommandLine* command_line) { |
| 56 command_line->AppendSwitchASCII(switches::kAccountConsistency, | 60 command_line->AppendSwitchASCII(switches::kAccountConsistency, |
| 57 switches::kAccountConsistencyDice); | 61 switches::kAccountConsistencyDice); |
| 58 } | 62 } |
| 59 #endif | 63 #endif |
| 60 | 64 |
| 61 } // namespace switches | 65 } // namespace switches |
| OLD | NEW |