features.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_BASE_FEATURES_H_
  5. #define COMPONENTS_SYNC_BASE_FEATURES_H_
  6. #include "base/feature_list.h"
  7. #include "base/metrics/field_trial_params.h"
  8. namespace syncer {
  9. // Allows device registration within trusted vault server without having trusted
  10. // vault key. Effectively disabled if kSyncTrustedVaultPassphraseRecovery
  11. // is disabled.
  12. inline constexpr base::Feature kAllowSilentTrustedVaultDeviceRegistration{
  13. "AllowSilentTrustedVaultDeviceRegistration",
  14. base::FEATURE_ENABLED_BY_DEFAULT};
  15. // If enabled, EntitySpecifics will be cached in EntityMetadata in order to
  16. // prevent data loss caused by older clients dealing with unknown proto fields
  17. // (introduced later).
  18. inline constexpr base::Feature kCacheBaseEntitySpecificsInMetadata{
  19. "CacheBaseEntitySpecificsInMetadata", base::FEATURE_DISABLED_BY_DEFAULT};
  20. inline constexpr base::Feature kEnableSyncImmediatelyInFRE{
  21. "EnableSyncImmediatelyInFRE", base::FEATURE_ENABLED_BY_DEFAULT};
  22. // Causes Sync to ignore updates encrypted with keys that have been missing for
  23. // too long from this client; Sync will proceed normally as if those updates
  24. // didn't exist.
  25. inline constexpr base::Feature kIgnoreSyncEncryptionKeysLongMissing{
  26. "IgnoreSyncEncryptionKeysLongMissing", base::FEATURE_DISABLED_BY_DEFAULT};
  27. // The threshold for kIgnoreSyncEncryptionKeysLongMissing to start ignoring keys
  28. // (measured in number of GetUpdatesResponses messages).
  29. inline constexpr base::FeatureParam<int> kMinGuResponsesToIgnoreKey{
  30. &kIgnoreSyncEncryptionKeysLongMissing, "MinGuResponsesToIgnoreKey", 3};
  31. // When enabled, Sync machinery will read and writes password notes to the
  32. // `encrypted_notes_backup` field inside the PasswordSpecifics proto. Together
  33. // with the logic on the server. this protects against notes being overwritten
  34. // by legacy clients not supporting password notes.
  35. inline constexpr base::Feature kReadWritePasswordNotesBackupField{
  36. "ReadWritePasswordNotesBackupField", base::FEATURE_DISABLED_BY_DEFAULT};
  37. // Allows custom passphrase users to receive Wallet data for secondary accounts
  38. // while in transport-only mode.
  39. inline constexpr base::Feature
  40. kSyncAllowWalletDataInTransportModeWithCustomPassphrase{
  41. "SyncAllowAutofillWalletDataInTransportModeWithCustomPassphrase",
  42. base::FEATURE_DISABLED_BY_DEFAULT};
  43. #if BUILDFLAG(IS_ANDROID)
  44. inline constexpr base::Feature kSyncAndroidPromosWithAlternativeTitle{
  45. "SyncAndroidPromosWithAlternativeTitle", base::FEATURE_DISABLED_BY_DEFAULT};
  46. inline constexpr base::Feature kSyncAndroidPromosWithIllustration{
  47. "SyncAndroidPromosWithIllustration", base::FEATURE_DISABLED_BY_DEFAULT};
  48. inline constexpr base::Feature kSyncAndroidPromosWithSingleButton{
  49. "SyncAndroidPromosWithSingleButton", base::FEATURE_DISABLED_BY_DEFAULT};
  50. inline constexpr base::Feature kSyncAndroidPromosWithTitle{
  51. "SyncAndroidPromosWithTitle", base::FEATURE_DISABLED_BY_DEFAULT};
  52. #endif // BUILDFLAG(IS_ANDROID)
  53. // Controls whether to enable syncing of Autofill Wallet Usage Data.
  54. inline constexpr base::Feature kSyncAutofillWalletUsageData{
  55. "SyncAutofillWalletUsageData", base::FEATURE_DISABLED_BY_DEFAULT};
  56. // Causes the sync engine to count a quota for commits of data types that can
  57. // be committed by extension JS API. If the quota is depleted, an extra long
  58. // nudge delay is applied to that data type. As a result, more changes are
  59. // likely to get combined into one commit message.
  60. inline constexpr base::Feature kSyncExtensionTypesThrottling{
  61. "SyncExtensionTypesThrottling", base::FEATURE_ENABLED_BY_DEFAULT};
  62. // Sync requires policies to be loaded before starting.
  63. inline constexpr base::Feature kSyncRequiresPoliciesLoaded{
  64. "SyncRequiresPoliciesLoaded", base::FEATURE_DISABLED_BY_DEFAULT};
  65. // Max time to delay the sync startup while waiting for policies to load.
  66. inline constexpr base::FeatureParam<base::TimeDelta> kSyncPolicyLoadTimeout{
  67. &kSyncRequiresPoliciesLoaded, "SyncPolicyLoadTimeout", base::Seconds(10)};
  68. inline constexpr base::Feature kSyncResetPollIntervalOnStart{
  69. "SyncResetPollIntervalOnStart", base::FEATURE_DISABLED_BY_DEFAULT};
  70. // If enabled, interested data types, excluding Wallet and Offer, will be sent
  71. // to the Sync Server as part of DeviceInfo.
  72. inline constexpr base::Feature kSyncSendInterestedDataTypes = {
  73. "SyncSendInterestedDataTypes", base::FEATURE_ENABLED_BY_DEFAULT};
  74. #if BUILDFLAG(IS_CHROMEOS)
  75. // Whether warning should be shown in sync settings page when lacros
  76. // side-by-side mode is enabled.
  77. inline constexpr base::Feature kSyncSettingsShowLacrosSideBySideWarning{
  78. "SyncSettingsShowLacrosSideBySideWarning",
  79. base::FEATURE_ENABLED_BY_DEFAULT};
  80. // Whether explicit passphrase sharing between Ash and Lacros is enabled.
  81. inline constexpr base::Feature kSyncChromeOSExplicitPassphraseSharing{
  82. "SyncChromeOSExplicitPassphraseSharing", base::FEATURE_ENABLED_BY_DEFAULT};
  83. // Whether Apps toggle value is exposed by Ash to Lacros.
  84. inline constexpr base::Feature kSyncChromeOSAppsToggleSharing{
  85. "SyncChromeOSAppsToggleSharing", base::FEATURE_DISABLED_BY_DEFAULT};
  86. #endif // BUILDFLAG(IS_CHROMEOS)
  87. #if BUILDFLAG(IS_IOS)
  88. // Whether RPC is enabled.
  89. inline constexpr base::Feature kSyncTrustedVaultPassphraseiOSRPC{
  90. "SyncTrustedVaultPassphraseiOSRPC", base::FEATURE_ENABLED_BY_DEFAULT};
  91. #endif // BUILDFLAG(IS_IOS)
  92. // Whether the entry point to opt in to trusted vault in settings should be
  93. // shown.
  94. inline constexpr base::Feature kSyncTrustedVaultPassphrasePromo{
  95. "SyncTrustedVaultPassphrasePromo", base::FEATURE_DISABLED_BY_DEFAULT};
  96. // Keep this entry in sync with the equivalent name in
  97. // ChromeFeatureList.java.
  98. inline constexpr base::Feature kSyncTrustedVaultPassphraseRecovery{
  99. "SyncTrustedVaultPassphraseRecovery", base::FEATURE_ENABLED_BY_DEFAULT};
  100. // Specifies how long requests to vault service shouldn't be retried after
  101. // encountering transient error.
  102. inline constexpr base::FeatureParam<base::TimeDelta>
  103. kTrustedVaultServiceThrottlingDuration{
  104. &kSyncTrustedVaultPassphraseRecovery,
  105. "TrustedVaultServiceThrottlingDuration", base::Days(1)};
  106. // Enables logging a UMA metric that requires first communicating with the
  107. // trusted vault server, in order to verify that the local notion of the device
  108. // being registered is consistent with the server-side state.
  109. inline constexpr base::Feature kSyncTrustedVaultVerifyDeviceRegistration{
  110. "SyncTrustedVaultVerifyDeviceRegistration",
  111. base::FEATURE_DISABLED_BY_DEFAULT};
  112. // Triggers another device registration attempt if the device was registered
  113. // before this feature was introduced.
  114. inline constexpr base::Feature kSyncTrustedVaultRedoDeviceRegistration{
  115. "SyncTrustedVaultRedoDeviceRegistration",
  116. base::FEATURE_DISABLED_BY_DEFAULT};
  117. // If enabled, the device will register with FCM and listen to new
  118. // invalidations. Also, FCM token will be set in DeviceInfo, which signals to
  119. // the server that device listens to new invalidations.
  120. // The device will not subscribe to old invalidations for any data types except
  121. // Wallet and Offer, since that will be covered by the new system.
  122. // SyncSendInterestedDataTypes must be enabled for this to take effect.
  123. inline constexpr base::Feature kUseSyncInvalidations = {
  124. "UseSyncInvalidations", base::FEATURE_DISABLED_BY_DEFAULT};
  125. // If enabled, types related to Wallet and Offer will be included in interested
  126. // data types, and the device will listen to new invalidations for those types
  127. // (if they are enabled).
  128. // The device will not register for old invalidations at all.
  129. // UseSyncInvalidations must be enabled for this to take effect.
  130. inline constexpr base::Feature kUseSyncInvalidationsForWalletAndOffer = {
  131. "UseSyncInvalidationsForWalletAndOffer", base::FEATURE_DISABLED_BY_DEFAULT};
  132. // When enabled, optimization flags (single client and a list of FCM
  133. // registration tokens) will be disabled if during the current sync cycle
  134. // DeviceInfo has been updated.
  135. inline constexpr base::Feature
  136. kSkipInvalidationOptimizationsWhenDeviceInfoUpdated = {
  137. "SkipInvalidationOptimizationsWhenDeviceInfoUpdated",
  138. base::FEATURE_DISABLED_BY_DEFAULT};
  139. #if BUILDFLAG(IS_IOS)
  140. // Returns whether RPC is enabled.
  141. bool IsSyncTrustedVaultPassphraseiOSRPCEnabled();
  142. #endif // BUILDFLAG(IS_IOS)
  143. inline constexpr base::Feature kSyncEnableHistoryDataType = {
  144. "SyncEnableHistoryDataType", base::FEATURE_DISABLED_BY_DEFAULT};
  145. } // namespace syncer
  146. #endif // COMPONENTS_SYNC_BASE_FEATURES_H_