#include "components/commerce/core/commerce_feature_list.h"
#include <unordered_map>
#include <unordered_set>
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "build/buildflag.h"
#if !BUILDFLAG(IS_ANDROID)
#include "components/commerce/core/commerce_heuristics_data.h"
#endif
#include "components/commerce/core/commerce_heuristics_data_metrics_helper.h"
#include "components/commerce/core/pref_names.h"
#include "third_party/re2/src/re2/re2.h"
namespace commerce {
namespace {
CountryLocaleMap;
const CountryLocaleMap& GetAllowedCountryToLocaleMap() { … }
constexpr base::FeatureParam<std::string> kRulePartnerMerchantPattern{ … };
constexpr base::FeatureParam<std::string> kCouponPartnerMerchantPattern{ … };
const re2::RE2& GetRulePartnerMerchantPattern() { … }
const re2::RE2& GetCouponPartnerMerchantPattern() { … }
}
namespace switches {
const char kEnableChromeCart[] = …;
}
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
#if BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kCommerceMerchantViewerRegionLaunched,
"CommerceMerchantViewerRegionLaunched",
base::FEATURE_ENABLED_BY_DEFAULT);
#else
BASE_FEATURE(…);
#endif
BASE_FEATURE(…);
BASE_FEATURE(…);
#if BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kCommercePriceTrackingRegionLaunched,
"CommercePriceTrackingRegionLaunched",
base::FEATURE_ENABLED_BY_DEFAULT);
#else
BASE_FEATURE(…);
#endif
BASE_FEATURE(…);
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(…);
#else
BASE_FEATURE(kPriceInsightsRegionLaunched,
"PriceInsightsRegionLaunched",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
const char kPriceInsightsDelayChipParam[] = …;
const base::FeatureParam<bool> kPriceInsightsDelayChip{ … };
const char kPriceInsightsChipLabelExpandOnHighPriceParam[] = …;
const base::FeatureParam<bool> kPriceInsightsChipLabelExpandOnHighPrice{ … };
const char kPriceInsightsShowFeedbackParam[] = …;
const base::FeatureParam<bool> kPriceInsightsShowFeedback{ … };
const char kPriceInsightsUseCacheParam[] = …;
const base::FeatureParam<bool> kPriceInsightsUseCache{ … };
const char kProductSpecsMigrateToMultiSpecificsParam[] = …;
const base::FeatureParam<bool> kProductSpecsMigrateToMultiSpecifics{ … };
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
const char kDiscountOnShoppyPageParam[] = …;
const base::FeatureParam<bool> kDiscountOnShoppyPage{ … };
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(…);
#else
BASE_FEATURE(kEnableDiscountInfoApiRegionLaunched,
"EnableDiscountInfoApiRegionLaunched",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
BASE_FEATURE(…);
const char kHistoryClustersBehaviorParam[] = …;
const base::FeatureParam<int> kHistoryClustersBehavior{ … };
const char kMerchantWideBehaviorParam[] = …;
const base::FeatureParam<int> kMerchantWideBehavior{ … };
const char kNonMerchantWideBehaviorParam[] = …;
const base::FeatureParam<int> kNonMerchantWideBehavior{ … };
BASE_FEATURE(…);
const base::FeatureParam<bool> kDeleteAllMerchantsOnClearBrowsingHistory{ … };
BASE_FEATURE(…);
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_IOS)
BASE_FEATURE(…);
#else
BASE_FEATURE(kShoppingListRegionLaunched,
"ShoppingListRegionLaunched",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
#if BUILDFLAG(IS_IOS)
BASE_FEATURE(kPriceInsightsIos,
"PriceInsightsIos",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPriceInsightsHighPriceIos,
"PriceInsightsHighPrice",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
const char kRetailCouponsWithCodeParam[] = …;
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
const char kParcelTrackingTestDataParam[] = …;
const char kParcelTrackingTestDataParamDelivered[] = …;
const char kParcelTrackingTestDataParamInProgress[] = …;
const char kParcelTrackingTestDataParamOutForDelivery[] = …;
const char kNtpChromeCartModuleDiscountConsentNtpVariationParam[] = …;
const base::FeatureParam<int> kNtpChromeCartModuleDiscountConsentNtpVariation{ … };
const char kNtpChromeCartModuleDiscountConsentReshowTimeParam[] = …;
const base::FeatureParam<base::TimeDelta>
kNtpChromeCartModuleDiscountConsentReshowTime{ … };
const char kNtpChromeCartModuleDiscountConsentMaxDismissalCountParam[] = …;
const base::FeatureParam<int>
kNtpChromeCartModuleDiscountConsentMaxDismissalCount{ … };
const char kNtpChromeCartModuleDiscountConsentStringChangeContentParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentStringChangeContent{ … };
const char kNtpChromeCartModuleDiscountConsentInlineShowCloseButtonParam[] = …;
const base::FeatureParam<bool>
kNtpChromeCartModuleDiscountConsentInlineShowCloseButton{ … };
const char
kNtpChromeCartModuleDiscountConsentNtpStepOneUseStaticContentParam[] = …;
const base::FeatureParam<bool>
kNtpChromeCartModuleDiscountConsentNtpStepOneUseStaticContent{ … };
const char kNtpChromeCartModuleDiscountConsentNtpStepOneStaticContentParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentNtpStepOneStaticContent{ … };
const char kNtpChromeCartModuleDiscountConsentNtpStepOneContentOneCartParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentNtpStepOneContentOneCart{ … };
const char kNtpChromeCartModuleDiscountConsentNtpStepOneContentTwoCartsParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentNtpStepOneContentTwoCarts{ … };
const char
kNtpChromeCartModuleDiscountConsentNtpStepOneContentThreeCartsParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentNtpStepOneContentThreeCarts{ … };
const char kNtpChromeCartModuleDiscountConsentNtpStepTwoContentParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentNtpStepTwoContent{ … };
const char
kNtpChromeCartModuleDiscountConsentInlineStepTwoDifferentColorParam[] = …;
const base::FeatureParam<bool>
kNtpChromeCartModuleDiscountConsentInlineStepTwoDifferentColor{ … };
const char kNtpChromeCartModuleDiscountConsentNtpDialogContentTitleParam[] = …;
const base::FeatureParam<std::string>
kNtpChromeCartModuleDiscountConsentNtpDialogContentTitle{ … };
const char kContextualConsentShowOnCartAndCheckoutPageParam[] = …;
const base::FeatureParam<bool> kContextualConsentShowOnCartAndCheckoutPage{ … };
const char kContextualConsentShowOnSRPParam[] = …;
const base::FeatureParam<bool> kContextualConsentShowOnSRP{ … };
const char kCommerceHintAndroidHeuristicsImprovementParam[] = …;
const char kCodeBasedRuleDiscountParam[] = …;
const base::FeatureParam<bool> kCodeBasedRuleDiscount{ … };
const char kCodeBasedRuleDiscountCouponDeletionTimeParam[] = …;
const base::FeatureParam<base::TimeDelta>
kCodeBasedRuleDiscountCouponDeletionTime{ … };
const char kProductSpecificationsSetValidForClusteringTimeParam[] = …;
const base::FeatureParam<base::TimeDelta>
kProductSpecificationsSetValidForClusteringTime{ … };
const char kProductSpecificationsUseServerClusteringParam[] = …;
const base::FeatureParam<bool> kProductSpecificationsUseServerClustering{ … };
const char kProductSpecificationsEnableQualityLoggingParam[] = …;
const base::FeatureParam<bool> kProductSpecificationsEnableQualityLogging{ … };
const char kRevertIconOnFailureParam[] = …;
const base::FeatureParam<bool> kRevertIconOnFailure{ … };
bool IsPartnerMerchant(const GURL& url) { … }
bool IsRuleDiscountPartnerMerchant(const GURL& url) { … }
bool IsCouponDiscountPartnerMerchant(const GURL& url) { … }
bool IsCartDiscountFeatureEnabled() { … }
bool IsCouponWithCodeEnabled() { … }
bool IsFakeDataEnabled() { … }
bool isContextualConsentEnabled() { … }
bool IsShoppingListAllowedForEnterprise(PrefService* prefs) { … }
bool IsEnabledForCountryAndLocale(const base::Feature& feature,
std::string country,
std::string locale) { … }
bool IsRegionLockedFeatureEnabled(const base::Feature& feature,
const base::Feature& feature_region_launched,
const std::string& country_code,
const std::string& locale) { … }
#if !BUILDFLAG(IS_ANDROID)
base::TimeDelta GetDiscountFetchDelay() { … }
bool IsNoDiscountMerchant(const GURL& url) { … }
#endif
}