From 42595bba36de3c8067816597be6dae51210d2314 Mon Sep 17 00:00:00 2001 From: oisupov Date: Fri, 17 Jan 2025 00:53:35 +0400 Subject: [PATCH] Add zcash shielded feature flag to chrome://flags Resolves https://github.com/brave/brave-browser/issues/43343 --- browser/about_flags.cc | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/browser/about_flags.cc b/browser/about_flags.cc index ec5befc05f5a..20a6ca30aeae 100644 --- a/browser/about_flags.cc +++ b/browser/about_flags.cc @@ -25,6 +25,7 @@ #include "brave/components/brave_rewards/common/features.h" #include "brave/components/brave_shields/core/common/features.h" #include "brave/components/brave_vpn/common/buildflags/buildflags.h" +#include "brave/components/brave_wallet/common/buildflags.h" #include "brave/components/brave_wallet/common/features.h" #include "brave/components/de_amp/common/features.h" #include "brave/components/debounce/core/common/features.h" @@ -86,6 +87,22 @@ #define EXPAND_FEATURE_ENTRIES(...) __VA_ARGS__, +const flags_ui::FeatureEntry::FeatureParam + kZCashShieldedTransactionsDisabled[] = { + {"zcash_shielded_transactions_enabled", "false"}}; +#if BUILDFLAG(ENABLE_ORCHARD) +const flags_ui::FeatureEntry::FeatureParam kZCashShieldedTransactionsEnabled[] = + {{"zcash_shielded_transactions_enabled", "true"}}; +#endif // BUILDFLAG(ENABLE_ORCHARD) +const flags_ui::FeatureEntry::FeatureVariation kZCashFeatureVariations[] = { + {"- Shielded support disabled", kZCashShieldedTransactionsDisabled, + std::size(kZCashShieldedTransactionsDisabled), nullptr}, +#if BUILDFLAG(ENABLE_ORCHARD) + {"- Shielded support enabled", kZCashShieldedTransactionsEnabled, + std::size(kZCashShieldedTransactionsEnabled), nullptr} +#endif // BUILDFLAG(ENABLE_ORCHARD) +}; + #define SPEEDREADER_FEATURE_ENTRIES \ IF_BUILDFLAG( \ ENABLE_SPEEDREADER, \ @@ -156,14 +173,11 @@ FEATURE_VALUE_TYPE( \ brave_wallet::features::kNativeBraveWalletFeature), \ }, \ - { \ - "brave-wallet-zcash", \ - "Enable BraveWallet ZCash support", \ - "Zcash support for native Brave Wallet", \ - kOsDesktop | kOsAndroid, \ - FEATURE_VALUE_TYPE( \ - brave_wallet::features::kBraveWalletZCashFeature), \ - }, \ + {"brave-wallet-zcash", "Enable BraveWallet ZCash support", \ + "Zcash support for native Brave Wallet", kOsDesktop | kOsAndroid, \ + FEATURE_WITH_PARAMS_VALUE_TYPE( \ + brave_wallet::features::kBraveWalletZCashFeature, \ + kZCashFeatureVariations, "BraveWalletZCash")}, \ { \ "brave-wallet-bitcoin", \ "Enable Brave Wallet Bitcoin support", \