Skip to content

Commit

Permalink
[Metadata] Feature flag to enable server side stretching of card arts
Browse files Browse the repository at this point in the history
Currently, the server (SCS image hosting service) can't return images of
an exact dimension because it has to maintain aspect ratio.

In future when the server is able to stretch images and return images of
exact dimensions, this flag can be flipped to use it on the clients.

(cherry picked from commit d6bfcb5)

Bug: 1458068
Change-Id: I10ea1454a00d7c5b0fa5f49cb33c0db2a0e242ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4647729
Commit-Queue: Vishwas Uppoor <vishwasuppoor@google.com>
Reviewed-by: Siyu An <siyua@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1162731}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4655161
Cr-Commit-Position: refs/branch-heads/5845@{#220}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
Vishwas Uppoor authored and Chromium LUCI CQ committed Jun 29, 2023
1 parent 2b4b326 commit b3a0f0a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10325,6 +10325,14 @@ const FeatureEntry kFeatureEntries[] = {
kOsAll,
FEATURE_VALUE_TYPE(
autofill::features::kAutofillEnableNewCardArtAndNetworkImages)},

{"autofill-enable-card-art-server-side-stretching",
flag_descriptions::kAutofillEnableCardArtServerSideStretchingName,
flag_descriptions::kAutofillEnableCardArtServerSideStretchingDescription,
kOsAll,
FEATURE_VALUE_TYPE(
autofill::features::kAutofillEnableCardArtServerSideStretching)},

{"autofill-upstream-use-alternate-secure-data-type",
flag_descriptions::kAutofillUpstreamUseAlternateSecureDataTypeName,
flag_descriptions::kAutofillUpstreamUseAlternateSecureDataTypeDescription,
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/flag-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@
"owners": [ "vishwasuppoor", "siyua" ],
"expiry_milestone": 120
},
{
"name": "autofill-enable-card-art-server-side-stretching",
"owners": ["vishwasuppoor@google.com", "alexandertekle@google.com"],
"expiry_milestone": 122
},
{
"name": "autofill-enable-card-product-name",
"owners": [ "vishwasuppoor", "siyua" ],
Expand Down
7 changes: 7 additions & 0 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ const char kAutofillEnableCardArtImageDescription[] =
"When enabled, card product images (instead of network icons) will be "
"shown in Payments Autofill UI.";

const char kAutofillEnableCardArtServerSideStretchingName[] =
"Enable server side stretching of card art images";
const char kAutofillEnableCardArtServerSideStretchingDescription[] =
"When enabled, the server will stretch (if necessary) and return card art "
"images of the exact required dimensions. The client side resizing of "
"images will not be required.";

const char kAutofillEnableCardProductNameName[] =
"Enable showing card product name";
const char kAutofillEnableCardProductNameDescription[] =
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ extern const char
extern const char kAutofillEnableCardArtImageName[];
extern const char kAutofillEnableCardArtImageDescription[];

extern const char kAutofillEnableCardArtServerSideStretchingName[];
extern const char kAutofillEnableCardArtServerSideStretchingDescription[];

extern const char kAutofillEnableCardProductNameName[];
extern const char kAutofillEnableCardProductNameDescription[];

Expand Down
6 changes: 6 additions & 0 deletions components/autofill/core/common/autofill_payments_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ BASE_FEATURE(kAutofillEnableCardArtImage,
"AutofillEnableCardArtImage",
base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, server will return card art images of the exact required
// dimension.
BASE_FEATURE(kAutofillEnableCardArtServerSideStretching,
"AutofillEnableCardArtServerSideStretching",
base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, card product name (instead of issuer network) will be shown in
// Payments Autofill UI.
BASE_FEATURE(kAutofillEnableCardProductName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace features {
BASE_DECLARE_FEATURE(kAutofillAlwaysReturnCloudTokenizedCard);
BASE_DECLARE_FEATURE(kAutofillAutoTriggerManualFallbackForCards);
BASE_DECLARE_FEATURE(kAutofillEnableCardArtImage);
BASE_DECLARE_FEATURE(kAutofillEnableCardArtServerSideStretching);
BASE_DECLARE_FEATURE(kAutofillEnableCardProductName);
BASE_DECLARE_FEATURE(kAutofillEnableCvcStorageAndFilling);
BASE_DECLARE_FEATURE(kAutofillEnableEmailOtpForVcnYellowPath);
Expand Down
4 changes: 4 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62328,6 +62328,8 @@ from previous Chrome versions.
<int value="-762687134" label="ExperimentalCrostiniUI:enabled"/>
<int value="-762541013" label="enable-bluetooth-spp-in-serial-api"/>
<int value="-761870200" label="CaptureModeDemoTools:disabled"/>
<int value="-760729135"
label="AutofillEnableCardArtServerSideStretching:disabled"/>
<int value="-759830869" label="enable-tab-discarding"/>
<int value="-758999727" label="ContentIndexingNTP:disabled"/>
<int value="-758917191" label="AccountIdMigration:enabled"/>
Expand Down Expand Up @@ -62656,6 +62658,8 @@ from previous Chrome versions.
<int value="-594076614" label="PluginVmShowCameraPermissions:disabled"/>
<int value="-593536514" label="ExperimentalTabController:enabled"/>
<int value="-593079381" label="component-updater"/>
<int value="-592776252"
label="AutofillEnableCardArtServerSideStretching:enabled"/>
<int value="-592628080" label="DnsProxyEnableDOH:disabled"/>
<int value="-592148755" label="RoundedWindows:enabled"/>
<int value="-591874964" label="LiteVideo:enabled"/>
Expand Down

0 comments on commit b3a0f0a

Please sign in to comment.