File: autofill_payments_features.cc

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (377 lines) | stat: -rw-r--r-- 16,906 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/core/common/autofill_payments_features.h"

namespace autofill::features {

#if BUILDFLAG(IS_IOS)
// When enabled, save card fix flow values for missing cardholder name and
// expiry date won't be defaulted as detected on iOS.
BASE_FEATURE(kAutofillDisableDefaultSaveCardFixFlowDetection,
             "AutofillDisableDefaultSaveCardFixFlowDetection",
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// When enabled, cardholder and address names considered during the credit card
// upload flow will be cleared out if they contain characters considered invalid
// by Google Payments, such as numbers or various punctuation marks.
BASE_FEATURE(kAutofillDropNamesWithInvalidCharactersForCardUpload,
             "AutofillDropNamesWithInvalidCharactersForCardUpload",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, card category benefits offered by BMO will be shown in Autofill
// suggestions on the allowlisted merchant websites.
BASE_FEATURE(kAutofillEnableAllowlistForBmoCardCategoryBenefits,
             "AutofillEnableAllowlistForBmoCardCategoryBenefits",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, Chrome will have the ability to load and query the allowlist
// for checkout amount extraction, which will be used to check if the current
// URL is eligible for products that use the checkout amount extraction
// algorithm.
BASE_FEATURE(kAutofillEnableAmountExtractionAllowlistDesktop,
             "AutofillEnableAmountExtractionAllowlistDesktop",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, Chrome will extract the checkout amount from the checkout page
// of the allowlisted merchant websites.
BASE_FEATURE(kAutofillEnableAmountExtractionDesktop,
             "AutofillEnableAmountExtractionDesktop",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables testing of the result of checkout amount extraction on desktop.
// This flag will allow amount extraction to run on any website when a CC
// form is clicked. This flag should never be enabled.
BASE_FEATURE(kAutofillEnableAmountExtractionTesting,
             "AutofillEnableAmountExtractionTesting",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, buy now pay later (BNPL) in Autofill will be offered.
BASE_FEATURE(kAutofillEnableBuyNowPayLater,
             "AutofillEnableBuyNowPayLater",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, buy now pay later (BNPL) for Klarna in Autofill will be
// offered.
BASE_FEATURE(kAutofillEnableBuyNowPayLaterForKlarna,
             "AutofillEnableBuyNowPayLaterForKlarna",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, buy now pay later (BNPL) data will be synced to Chrome clients.
BASE_FEATURE(kAutofillEnableBuyNowPayLaterSyncing,
             "AutofillEnableBuyNowPayLaterSyncing",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, buy now pay later (BNPL) data for Klarna will be synced to
// Chrome clients.
BASE_FEATURE(kAutofillEnableBuyNowPayLaterSyncingForKlarna,
             "AutofillEnableBuyNowPayLaterSyncingForKlarna",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, card benefits offered by American Express will be shown in
// Payments Autofill UI.
BASE_FEATURE(kAutofillEnableCardBenefitsForAmericanExpress,
             "AutofillEnableCardBenefitsForAmericanExpress",
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
             base::FEATURE_DISABLED_BY_DEFAULT);
#else
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// When enabled, card benefits offered by BMO will be shown in Payments Autofill
// UI.
BASE_FEATURE(kAutofillEnableCardBenefitsForBmo,
             "AutofillEnableCardBenefitsForBmo",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, card benefits IPH will be shown in Payments Autofill UI.
BASE_FEATURE(kAutofillEnableCardBenefitsIph,
             "AutofillEnableCardBenefitsIph",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, card benefit source will be synced to Chrome clients.
BASE_FEATURE(kAutofillEnableCardBenefitsSourceSync,
             "AutofillEnableCardBenefitsSourceSync",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, Chrome will show metadata along with other card information
// when the virtual card is presented to users.
BASE_FEATURE(kAutofillEnableCardBenefitsSync,
             "AutofillEnableCardBenefitsSync",
#if BUILDFLAG(IS_IOS)
             base::FEATURE_DISABLED_BY_DEFAULT);
#else
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// When enabled, runtime retrieval of CVC along with card number and expiry
// from issuer for enrolled cards will be enabled during form fill.
BASE_FEATURE(kAutofillEnableCardInfoRuntimeRetrieval,
             "AutofillEnableCardInfoRuntimeRetrieval",
#if BUILDFLAG(IS_IOS)
             base::FEATURE_DISABLED_BY_DEFAULT);
#else
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// When enabled, we will store CVC for both local and server credit cards. This
// will also allow the users to autofill their CVCs on checkout pages.
BASE_FEATURE(kAutofillEnableCvcStorageAndFilling,
             "AutofillEnableCvcStorageAndFilling",
#if BUILDFLAG(IS_IOS)
             base::FEATURE_DISABLED_BY_DEFAULT);
#else
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// When enabled, will enhance CVV storage project. Provide better suggestion,
// resolve conflict with COF project and add logging.
BASE_FEATURE(kAutofillEnableCvcStorageAndFillingEnhancement,
             "AutofillEnableCvcStorageAndFillingEnhancement",
#if BUILDFLAG(IS_IOS)
             base::FEATURE_DISABLED_BY_DEFAULT);
#else
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// When enabled, this will enhance the CVV storage project. The enhancement will
// enable CVV storage suggestions for standalone CVC fields.
BASE_FEATURE(kAutofillEnableCvcStorageAndFillingStandaloneFormEnhancement,
             "AutofillEnableCvcStorageAndFillingStandaloneFormEnhancement",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, in-product help UI will be shown the first time a card added
// outside of Chrome appears in Autofill card suggestions."
BASE_FEATURE(kAutofillEnableDownstreamCardAwarenessIph,
             "AutofillEnableDownstreamCardAwarenessIph",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, card flat rate benefit will not be shown on merchants in the
// blocklist.
BASE_FEATURE(kAutofillEnableFlatRateCardBenefitsBlocklist,
             "AutofillEnableFlatRateCardBenefitsBlocklist",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, flat rate card benefits sourced from Curinos will be shown in
// Payments Autofill UI.
BASE_FEATURE(kAutofillEnableFlatRateCardBenefitsFromCurinos,
             "AutofillEnableFlatRateCardBenefitsFromCurinos",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, server card retrieval will begin with a risk-based check
// instead of jumping straight to CVC or biometric auth.
BASE_FEATURE(kAutofillEnableFpanRiskBasedAuthentication,
             "AutofillEnableFpanRiskBasedAuthentication",
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
             base::FEATURE_ENABLED_BY_DEFAULT);
#else
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

// When enabled, the Virtual Card enrollment bottom sheet uses the Java
// payments data manager and associated image fetcher to retrieve the cached
// card art images (when available on Android). When not enabled, the native
// payments data manager and associated image fetcher are used, where the image
// is not cached.
BASE_FEATURE(kAutofillEnableVirtualCardJavaPaymentsDataManager,
             "AutofillEnableVirtualCardJavaPaymentsDataManager",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, a form event will log to all of the parsed forms of the same
// type on a webpage. This means credit card form events will log to all credit
// card form types and address form events will log to all address form types."
// TODO(crbug.com/359934323): Clean up when launched
BASE_FEATURE(kAutofillEnableLogFormEventsToAllParsedFormTypes,
             "AutofillEnableLogFormEventsToAllParsedFormTypes",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, virtual card downstream enrollment will support multiple
// requests at a time.
BASE_FEATURE(kAutofillEnableMultipleRequestInVirtualCardDownstreamEnrollment,
             "AutofillEnableMultipleRequestInVirtualCardDownstreamEnrollment",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, the card benefits toggle in settings will show updated text.
BASE_FEATURE(kAutofillEnableNewCardBenefitsToggleText,
             "AutofillEnableNewCardBenefitsToggleText",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, card and IBAN autofill will be shown in new FOP style.
BASE_FEATURE(kAutofillEnableNewFopDisplayDesktop,
             "AutofillEnableNewFopDisplayDesktop",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, offers will be displayed in the Clank keyboard accessory during
// downstream.
BASE_FEATURE(kAutofillEnableOffersInClankKeyboardAccessory,
             "AutofillEnableOffersInClankKeyboardAccessory",
             base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_ANDROID)
// When enabled, the payment settings page will show a card promo and allow for
// card scans.
BASE_FEATURE(kAutofillEnablePaymentSettingsCardPromoAndScanCard,
             "AutofillEnablePaymentSettingsCardPromoAndScanCard",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, the payment settings page will save new cards to the payment
// server instead of locally.
BASE_FEATURE(kAutofillEnablePaymentSettingsServerCardSave,
             "AutofillEnablePaymentSettingsServerCardSave",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

// When enabled, risk data is prefetched during payments autofill flows to
// reduce user-perceived latency.
BASE_FEATURE(kAutofillEnablePrefetchingRiskDataForRetrieval,
             "AutofillEnablePrefetchingRiskDataForRetrieval",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, the 'Save and Fill' suggestion will be offered in the credit
// card dropdown menu for users who don't have any cards saved in Autofill.
BASE_FEATURE(kAutofillEnableSaveAndFill,
             "AutofillEnableSaveAndFill",
             base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_ANDROID)
// When enabled, save card securely message be displayed on upload card
// UI message.
BASE_FEATURE(kAutofillEnableShowSaveCardSecurelyMessage,
             "AutofillEnableShowSaveCardSecurelyMessage",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, Pix bank accounts are synced from Chrome Sync backend and
// stored in the local db.
BASE_FEATURE(kAutofillEnableSyncingOfPixBankAccounts,
             "AutofillEnableSyncingOfPixBankAccounts",
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_ANDROID)

// When enabled, Chrome will trigger 3DS authentication during a virtual card
// retrieval if a challenge is required, 3DS authentication is available for
// the card, and FIDO is not.
BASE_FEATURE(kAutofillEnableVcn3dsAuthentication,
             "AutofillEnableVcn3dsAuthentication",
             base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_IOS)
// When enabled, save card bottomsheet will be shown to save the card locally
// when the user has not previously rejected the offer to save the card.
BASE_FEATURE(kAutofillLocalSaveCardBottomSheet,
             "AutofillLocalSaveCardBottomSheet",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

// When enabled, if credit card upload save encounters a card with the same four
// digits as an existing server card but a different expiration date, it
// requires that CVC was found in the flow before offering to save/update the
// card.
BASE_FEATURE(kAutofillRequireCvcForPossibleCardUpdate,
             "AutofillRequireCvcForPossibleCardUpdate",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, Chrome will try to fetch payment account image resources again
// upon failure. The number of attempts is a controllable parameter. This is a
// kill-switch.
// TODO(crbug.com/40276036): Clean up after M139 branch (June 23, 2025).
BASE_FEATURE(kAutofillRetryImageFetchOnFailure,
             "AutofillRetryImageFetchOnFailure",
             base::FEATURE_ENABLED_BY_DEFAULT);

#if BUILDFLAG(IS_IOS)
// When enabled, save card bottomsheet will be shown to save the card to the
// server when the user has not previously rejected the offer to save the card,
// and both a valid expiry date and cardholder name are present.
BASE_FEATURE(kAutofillSaveCardBottomSheet,
             "AutofillSaveCardBottomSheet",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

// If enabled, we will store autofill server card data in shared storage.
BASE_FEATURE(kAutofillSharedStorageServerCardData,
             "AutofillSharedStorageServerCardData",
             base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_IOS)
// When enabled, manual fill view will be shown directly from form focusing
// events, if a virtual card has been retrieved previously.
BASE_FEATURE(kAutofillShowManualFillForVirtualCards,
             "AutofillShowManualFillForVirtualCards",
             base::FEATURE_ENABLED_BY_DEFAULT);
#endif

// Kill switch, when enabled, will prevent the display of the save card bubble
// within a tab modal pop-up window.
BASE_FEATURE(kAutofillSkipSaveCardForTabModalPopup,
             "AutofillSkipSaveCardForTabModalPopup",
             base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, adds a timeout on the network request for Unmask requests.
BASE_FEATURE(kAutofillUnmaskCardRequestTimeout,
             "AutofillUnmaskCardRequestTimeout",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, adds a timeout on the network request for UploadCard requests.
BASE_FEATURE(kAutofillUploadCardRequestTimeout,
             "AutofillUploadCardRequestTimeout",
             base::FEATURE_ENABLED_BY_DEFAULT);
const base::FeatureParam<int> kAutofillUploadCardRequestTimeoutMilliseconds{
    &kAutofillUploadCardRequestTimeout,
    "autofill_upload_card_request_timeout_milliseconds",
    /*default_value=*/6500};

// Controls offering credit card upload to Google Payments. Cannot ever be
// ENABLED_BY_DEFAULT because the feature state depends on the user's country.
// The set of launched countries is listed in autofill_experiments.cc, and this
// flag remains as a way to easily enable upload credit card save for testers,
// as well as enable non-fully-launched countries on a trial basis.
BASE_FEATURE(kAutofillUpstream,
             "AutofillUpstream",
             base::FEATURE_DISABLED_BY_DEFAULT);

// When enabled, adds a timeout on the network request for VcnEnroll requests.
BASE_FEATURE(kAutofillVcnEnrollRequestTimeout,
             "AutofillVcnEnrollRequestTimeout",
             base::FEATURE_ENABLED_BY_DEFAULT);
const base::FeatureParam<int> kAutofillVcnEnrollRequestTimeoutMilliseconds{
    &kAutofillVcnEnrollRequestTimeout,
    "autofill_vcn_enroll_request_timeout_milliseconds",
    /*default_value=*/6500};

// When enabled, updates the VCN strike database with different values of
// kExpiryTimeDelta as part of of the VCN strike optimization experiment.
// See go/vcn-strike-optimization-design.
BASE_FEATURE(kAutofillVcnEnrollStrikeExpiryTime,
             "AutofillVcnEnrollStrikeExpiryTime",
             base::FEATURE_DISABLED_BY_DEFAULT);
const base::FeatureParam<int> kAutofillVcnEnrollStrikeExpiryTimeDays{
    &kAutofillVcnEnrollStrikeExpiryTime, "autofill_vcn_strike_expiry_time_days",
    /*default_value=*/180};

#if BUILDFLAG(IS_ANDROID)
// When enabled, eWallet accounts are synced from the Google Payments servers
// and displayed on the payment methods settings page.
BASE_FEATURE(kAutofillSyncEwalletAccounts,
             "AutofillSyncEwalletAccounts",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_ANDROID)

// If enabled, the Autofill strike system will not block features. Intended for
// debugging/testing use only and should never be launched to users.
BASE_FEATURE(kDisableAutofillStrikeSystem,
             "DisableAutofillStrikeSystem",
             base::FEATURE_DISABLED_BY_DEFAULT);

bool ShouldShowImprovedUserConsentForCreditCardSave() {
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX)
  // The new user consent UI is fully launched on MacOS, Windows and Linux.
  return true;
#else
  // Chrome OS does not have the new UI.
  return false;
#endif
}

}  // namespace autofill::features