Skip to content

Commit

Permalink
[ConsentV2] Add flags for native dialog variation
Browse files Browse the repository at this point in the history
(cherry picked from commit cd717a4)

Bug: 1317466
Change-Id: I570facdb40c019e6e90b6f873bdcbc53f5f4589c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3591882
Reviewed-by: Mei Liang <meiliang@chromium.org>
Reviewed-by: Wei-Yin Chen <wychen@chromium.org>
Commit-Queue: Mei Liang <meiliang@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#993874}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3607050
Auto-Submit: Mei Liang <meiliang@chromium.org>
Commit-Queue: Wei-Yin Chen <wychen@chromium.org>
Cr-Commit-Position: refs/branch-heads/5005@{#159}
Cr-Branched-From: 5b4d945-refs/heads/main@{#992738}
  • Loading branch information
Mei Liang authored and Chromium LUCI CQ committed Apr 26, 2022
1 parent 548f2eb commit c9fabd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
31 changes: 6 additions & 25 deletions chrome/browser/about_flags.cc
Expand Up @@ -1507,35 +1507,16 @@ const FeatureEntry::FeatureVariation kNtpChromeCartModuleVariations[] = {
};

// The following are consent v2 variations in the Chrome Cart module.
const flags_ui::FeatureEntry::FeatureParam kDiscountConsentNtpStringChange[] = {
{commerce::kNtpChromeCartModuleDiscountConsentNtpVariationParam, "1"}};
const flags_ui::FeatureEntry::FeatureParam kDiscountConsentNtpInline[] = {
{commerce::kNtpChromeCartModuleDiscountConsentNtpVariationParam, "2"}};
const flags_ui::FeatureEntry::FeatureParam kDiscountConsentNtpDialog[] = {
{commerce::kNtpChromeCartModuleDiscountConsentNtpVariationParam, "3"}};
const flags_ui::FeatureEntry::FeatureParam
kDiscountConsentOnCartAndCheckoutPage[] = {
{commerce::kContextualConsentShowOnCartAndCheckoutPageParam, "true"}};
const flags_ui::FeatureEntry::FeatureParam kDiscountConsentOnSRP[] = {
{commerce::kContextualConsentShowOnSRPParam, "true"}};
const flags_ui::FeatureEntry::FeatureParam
kDiscountConsentOnNTPDialogAndCartCheckout[] = {
{commerce::kNtpChromeCartModuleDiscountConsentNtpVariationParam, "3"},
{commerce::kContextualConsentShowOnCartAndCheckoutPageParam, "true"}};
const flags_ui::FeatureEntry::FeatureParam kDiscountConsentNtpNativeDialog[] = {
{commerce::kNtpChromeCartModuleDiscountConsentNtpVariationParam, "4"}};

const FeatureEntry::FeatureVariation kDiscountConsentV2Variations[] = {
{"Changing string", kDiscountConsentNtpStringChange,
std::size(kDiscountConsentNtpStringChange), nullptr},
{"Inline Consent", kDiscountConsentNtpInline,
std::size(kDiscountConsentNtpInline), nullptr},
{"Dialog Consent", kDiscountConsentNtpDialog,
{"WebUi Dialog Consent", kDiscountConsentNtpDialog,
std::size(kDiscountConsentNtpDialog), nullptr},
{"Cart and Checkout Consent", kDiscountConsentOnCartAndCheckoutPage,
std::size(kDiscountConsentOnCartAndCheckoutPage), nullptr},
{"SRP Consent", kDiscountConsentOnSRP, std::size(kDiscountConsentOnSRP),
nullptr},
{"Cart, Checkout, and Dialog Consent",
kDiscountConsentOnNTPDialogAndCartCheckout,
std::size(kDiscountConsentOnNTPDialogAndCartCheckout), nullptr},
{"Native Dialog Consent", kDiscountConsentNtpNativeDialog,
std::size(kDiscountConsentNtpNativeDialog), nullptr},
};

const FeatureEntry::FeatureParam kNtpRecipeTasksModuleFakeData[] = {
Expand Down
3 changes: 2 additions & 1 deletion components/commerce/core/commerce_feature_list.h
Expand Up @@ -154,7 +154,8 @@ enum class DiscountConsentNtpVariation {
kStringChange = 1,
kInline = 2,
kDialog = 3,
kMaxValue = kDialog
kNativeDialog = 4,
kMaxValue = kNativeDialog
};

// Param indicates the ConsentV2 variation. See DiscountConsentNtpVariation
Expand Down

0 comments on commit c9fabd2

Please sign in to comment.