chromium/components/autofill/core/common/autofill_features.cc

// Copyright 2017 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_features.h"

#include "base/feature_list.h"
#include "build/chromeos_buildflags.h"

namespace autofill::features {

// LINT.IfChange(autofill_across_iframes_ios)
// Controls whether to flatten and fill cross-iframe forms on iOS.
// TODO(crbug.com/40266699) Remove once launched.
BASE_FEATURE();
// LINT.ThenChange(//components/autofill/ios/form_util/resources/autofill_form_features.ts:autofill_across_iframes_ios)

// Use the heuristic parser to detect unfillable numeric types in field labels
// and grant the heuristic precedence over non-override server predictions.
BASE_FEATURE();

// TODO(crbug.com/40151750): Remove this feature flag after the explicit save
// prompts for address profiles is complete.
// When enabled, address profile save problem will contain a dropdown for
// assigning a nickname to the address profile. Relevant only if the
// AutofillAddressProfileSavePrompt feature is enabled.
BASE_FEATURE();

// Feature flag to control the displaying of an ongoing hats survey that
// measures users perception of Autofill. Differently from other surveys,
// the Autofill user perception survey will not have a specific target
// number of answers where it will be fully stop, instead, it will run
// indefinitely. A target number of full answers exists, but per quarter. The
// goal is to have a go to place to understand how users are perceiving autofill
// across quarters.
BASE_FEATURE();

// If enabled, Autofill is informed about the caret position while showing a
// popup.
// TODO(crbug.com/339156167): Remove when launched.
BASE_FEATURE();

// If enabled, AutofillAgent's left-click handler tries to treat
// contenteditables appropriately.
// This is a kill switch.
// TODO(crbug.com/341695271): Remove when launched.
BASE_FEATURE();

// Same as `kAutofillAddressUserPerceptionSurvey` but for credit card forms.
BASE_FEATURE();

// If enabled, Autofill always sets the phone number as parsed by
// i18n::phonenumber.
// TODO(crbug.com/40220393): Cleanup when launched.
BASE_FEATURE();

// If enabled, the country calling code for nationally formatted phone numbers
// is inferred from the profile's country, if available.
// TODO(crbug.com/40220393): Cleanup when launched.
BASE_FEATURE();

// If enabled, label inference considers strings entirely made up of  '(', ')'
// and '-' as valid labels.
// TODO(crbug.com/40220393): Cleanup when launched.
BASE_FEATURE();

// If enabled, no prefix matching is applied to filter credit card number
// suggestions.
// TODO(crbug.com/338932642): Clean up if launched.
BASE_FEATURE();

// FormStructure::RetrieveFromCache used to preserve an AutofillField's
// is_autofilled from the cache of previously parsed forms. This makes little
// sense because the renderer sends us the autofill state and has the most
// recent information. Dropping the old behavior should not make any difference
// but to be sure, this is gated by a finch experiment.
// TODO(crbug.com/40871691) Cleanup when launched.
BASE_FEATURE();

// Kill switch for Autofill filling.
BASE_FEATURE();

// Kill switch for Autofill address import.
BASE_FEATURE();

// Kill switch for computing heuristics other than the active ones
// (GetActivePatternSource()).
BASE_FEATURE();

// When enabled, autofill will use the new ranking algorithm for address profile
// autofill suggestions.
BASE_FEATURE();
// The half life applied to the use count of profiles in the ranking formula.
const base::FeatureParam<int>
    kAutofillRankingFormulaAddressProfilesUsageHalfLife{};

// When enabled, autofill will use the new ranking algorithm for credit card
// autofill suggestions.
BASE_FEATURE();
// The half life applied to the use count.
const base::FeatureParam<int> kAutofillRankingFormulaCreditCardsUsageHalfLife{};
// The boost factor applied to ranking virtual cards.
const base::FeatureParam<int> kAutofillRankingFormulaVirtualCardBoost{};
// The half life applied to the virtual card boost.
const base::FeatureParam<int> kAutofillRankingFormulaVirtualCardBoostHalfLife{};

// When enabled, addresses of every country are considered eligible for account
// address storage.
BASE_FEATURE();

// Enables a new implementation for address field parsing that is based on
// backtracking.
BASE_FEATURE();

// When enabled, autofill displays an IPH informing users about using autofill
// from the context menu. The IPH will be attached to address fields with
// autocomplete="garbage".
// TODO(crbug.com/313587343) Remove once manual fallback IPH feature is
// launched.
BASE_FEATURE();

// Controls if the heuristic field parsing utilizes shared labels.
// TODO(crbug.com/40741721): Remove once shared labels are launched.
BASE_FEATURE();

// Controls if heuristic field parsing should be performed on email-only forms.
// TODO(crbug.com/40285735): Remove when/if launched.
BASE_FEATURE();

// Controls if heuristic field parsing should be performed on email-only forms
// without an enclosing form tag. This feature will only be launched once
// `kAutofillEnableEmailHeuristicOnlyAddressForms` rolls out.
// TODO(crbug.com/40285735): Remove when/if launched.
BASE_FEATURE();

// When true, use autocomplete=email as required signal for email fields on
// email-only forms, else accept a wider range of autocomplete values except for
// `off` and `false`.
const base::FeatureParam<bool> kAutofillEnableEmailHeuristicAutocompleteEmail{};

// Control if Autofill supports German transliteration.
// TODO(crbug.com/328968064): Remove when/if launched.
BASE_FEATURE();

// Enables a couple of improvements to credit card expiration date handling:
// - The autocomplete attribute values are rationalized with format strings
//   like MM/YY from placeholders and labels in mind.
// - more fill follow.
// TODO(crbug.com/40266396): Remove once launched.
BASE_FEATURE();

// Controls whether to save the first number in a form with multiple phone
// numbers instead of aborting the import.
// TODO(crbug.com/40742746) Remove once launched.
BASE_FEATURE();

// When enabled, the precedence is given to the field label over the name when
// they match different types. Applied only for parsing of address forms in
// Turkish.
// TODO(crbug.com/40735892): Remove once launched.
BASE_FEATURE();

// When enabled, focusing on a credit card number field that was traditionally
// autofilled will yield all credit card suggestions.
// TODO(crbug.com/354175563): Remove when launched.
BASE_FEATURE();

// If enabled, trunk prefix-related phone number types are added to the
// supported and matching types of |PhoneNumber|. Local heuristics for these
// types are enabled as well.
BASE_FEATURE();

// If enabled, only non-ad frames are extracted.
// Otherwise, non-ad frames as well as *visible* ad frames are extracted.
// "Extracted" means that FormFieldData::child_frames is populated, which is
// necessary for flattening these forms.
// The forms in those frames are extracted either way.
// TODO(crbug.com/40196220): Remove once launched.
BASE_FEATURE();

// When enabled, focusing on an autofilled field that was traditionally filled
// with address data (meaning filled with the value of their classified type)
// will yield field-by-field filling suggestions without prefix matching.
// TODO(crbug.com/339543182): Remove when launched.
BASE_FEATURE();

// Resets the autofill state of a field when JavaScript modifies its value.
// Also resets the AutofillState of the blink element to kAutofilled if the
// change was only a reformatting (inserting whitespaces and special
// characters).
// This feature should be enabled with
// blink::features::AllowJavaScriptToResetAutofillState.
BASE_FEATURE();

// Killswitch for not running logic in `form_util::ClearPreviewedElements` that
// force-sets the selectionrange of the focused element.
BASE_FEATURE();

// Killswitch for not trying to find a cached AutofillField from a FormFieldData
// by using FormFieldData::SameFieldAs, but only by comparing FieldGlobalIds.
BASE_FEATURE();

// Gives precedence to local heuristics if they indicate that a field is an
// EMAIL_ADDRESS field and the server believes that it is a USERNAME or
// SINGLE_USERNAME field.
//
// Imagine that  a web page has a field that admits both email address
// and username, but the server prediction only captures the username
// aspect.
// With this feature disabled, we predict the overall type to be USERNAME. If
// Password Manager has not results, it defaults to Autofill, which, in turn,
// defaults to Autocomplete because it cannot handle the USERNAME prediction.
// With this feature enabled, Password Manager is still given  precedence for
// showing username suggestions if it has any. However, if it does not, Autofill
// can now show email-related suggestions. Only if it does not have any will it
// fall back to Autocomplete.
//
// TODO: crbug.com/360791229 - clean up.
BASE_FEATURE();

// Makes Autofill try to import data from fields annotated with an unrecognized
// autocomplete HTML attribute. The default behavior doesn't allow that.
// TODO(crbug.com/347698797): Cleanup when launched.
BASE_FEATURE();

// Implements a model that suppresses suggestions after N times the user ignores
// the popup (i.e. doesn't select a suggestion from the popup).
// N depends on the parametrization of the feature.
BASE_FEATURE();

const base::FeatureParam<int> kSuggestionStrikeLimit{};

// Makes disused suggestion suppression logic ignore the first
// `kNumberOfIgnoredSuggestions` suggestions (in frecency order), so that the
// logic never returns an empty list after being passed a non-empty one.
BASE_FEATURE();

const base::FeatureParam<int> kNumberOfIgnoredSuggestions{};

// If enabled, we start forwarding submissions with source
// DOM_MUTATION_AFTER_AUTOFILL, even for non-password forms.
BASE_FEATURE();

// Unifies the tracking of the last interacted elements between FormTracker and
// AutofillAgent and fixes inconsistencies in this tracking.
BASE_FEATURE();

// Replaces blink::WebFormElementObserver usage in FormTracker by updated logic
// for tracking the disappearance of forms as well as other submission
// triggering events.
BASE_FEATURE();

// If enabled, FormFieldData::is_visible is a heuristic for actual visibility.
// Otherwise, it's an alias for FormFieldData::is_focusable.
// TODO(crbug.com/324199622) When abandoned, remove FormFieldData::is_visible.
BASE_FEATURE();

// If enabled, new heuristics are applied for disambiguating multiple possible
// types in a form field. Otherwise, only the already established heuristic for
// disambiguating address and credit card names is used.
BASE_FEATURE();

// If enabled, whenever form controls are removed from the DOM, the ChromeClient
// is informed about this. This enables Autofill to trigger a reparsing of
// forms.
BASE_FEATURE();

// Replaces cached web elements in AutofillAgent and FormTracker by their
// renderer ids.
BASE_FEATURE();

// Enables using the a custom address model for Australia, overriding the legacy
// one.
BASE_FEATURE();

// Enables using a custom address model for Canada, overriding the legacy one.
BASE_FEATURE();

// Enables using a custom address model for Germany, overriding the legacy one.
BASE_FEATURE();

// Enables using a custom address model for France, overriding the legacy one.
BASE_FEATURE();

// Enables using a custom address model for India, overriding the legacy one.
BASE_FEATURE();

// Enables using a custom address model for Italy, overriding the legacy one.
BASE_FEATURE();

// Enables using a custom address model for Poland, overriding the legacy one.
BASE_FEATURE();

// When enabled, Autofill will issues votes for EMAIL_ADDRESS field types on
// fields where the content matches a valid email format.
BASE_FEATURE();

// When enabled, all behaviours related to the on-device machine learning
// model for field type predictions will be guarded.
// TODO(crbug.com/40276177): Remove when launched.
BASE_FEATURE();

// When true, use the machine learning model as the active `HeuristicSource`,
// else use the source provided by `kAutofillParsingPatternActiveSource`.
const base::FeatureParam<bool> kAutofillModelPredictionsAreActive{};

// If enabled, a pre-filled field will only be overwritten if it's not
// classified as meaningfully pre-filled based on server predictions. If also
// flag `kAutofillSkipPreFilledFields` is enabled, a pre-filled field will only
// be overwritten if it's classified as a placeholder.
BASE_FEATURE();

// If enabled, a pre-filled field will not be filled.
BASE_FEATURE();

// This feature flag only exists for its feature parameter
// `kAutofillParsingPatternActiveSource`, controlling from which JSON file
// regexes are loaded.
// If the flag is disabled (which it should never be in practice), it behaves
// as if enabled with `kAutofillParsingPatternActiveSource` set to "default".
// TODO(crbug.com/40280853): Remove once there is a decision what to do about
// the different JSON files.
BASE_FEATURE();

// The specific pattern set from which regexes are loaded for the active
// predictions. One of "default", "experimental".
// This parameter is only supported in Chrome-branded builds. Non-Chrome branded
// builds default to the legacy patterns.
// TODO(crbug.com/40280853): Remove once there is a decision what to do about
// the different JSON files.
const base::FeatureParam<std::string> kAutofillParsingPatternActiveSource{};

// Enables detection of language from Translate.
// TODO(crbug.com/40158074): Cleanup when launched.
BASE_FEATURE();

// When enabled, we check whether a field's label or placeholder has the format
// of a valid email address. If it does, we use that as a signal that the field
// is of type EMAIL_ADDRESS.
// TODO(crbug.com/361560365): Clean up when launched.
BASE_FEATURE();

// If enabled, the placeholder is not used as a fallback during label inference.
// Instead, local heuristics treat it as a separate source in addition to the
// label. The placeholder is matched against the same regex as the label.
// Since placeholders are often used as example values, this should allow us to
// extract a more appropriate label instead.
// TODO(crbug.com/40222716): Remove once launched.
BASE_FEATURE();

// If the feature is enabled, paint checks over individual `PopupCellView`s (to
// verify that a user's cursor has been outside the cell before accepting it)
// are disabled.
BASE_FEATURE();

// If the feature is enabled, before triggering suggestion acceptance, the row
// view checks that a substantial portion of its content was visible for some
// minimum required period.
// TODO(crbug.com/337222641): During cleaning up, in the popup row view remove
// emitting of "Autofill.AcceptedSuggestionDesktopRowViewVisibleEnough".
BASE_FEATURE();

// TODO(crbug.com/334909042): Remove after cleanup.
// If the feature is enabled, the Autofill popup widget is initialized with
// `Widget::InitParams::z_order` set to `ui::ZOrderLevel::kSecuritySurface`,
// otherwise the `z_order` is not set and defined by the widget type (see
// `Widget::InitParams::EffectiveZOrderLevel()`). This param makes the popup
// display on top of all other windows, which potentially can negatively
// affect their functionality.
BASE_FEATURE();

// Controls whether Autofill may fill across origins.
// In payment forms, the cardholder name field is often on the merchant's origin
// while the credit card number and CVC are in iframes hosted by a payment
// service provider. By enabling the policy-controlled feature "shared-autofill"
// in those iframes, the merchant's website enable Autofill to fill the credit
// card number and CVC fields from the cardholder name field, even though this
// autofill operation crosses origins.
// TODO(crbug.com/1304721): Enable this feature.
BASE_FEATURE();

// If this feature is enabled, the AddressFieldParser does NOT try to parse
// address lines once it has found a street name and house number or other
// combinations of fields that indicate that an address form uses structured
// addresses. This should be the default in all countries with fully supported
// structured addresses. However, if a country is not sufficiently modeled,
// autofill may still do the right thing if it recognizes "Street name, house
// number, address line 2" as a sequence.
// TODO(crbug.com/40266693) Remove once launched.
BASE_FEATURE();

// Controls whether granular filling will be available in the autofill popup.
// TODO(crbug.com/40274514): Clean up when launched.
BASE_FEATURE();

// This variation controls whether more suggestive suggestion labels are shown
// or not.
// The feature variation exists to separate the granular filling feature into
// multiple sub-features. Thus, metrics can be evaluated separately for each
// sub-feature.
// TODO(crbug.com/40274514): Clean up when launched.
const base::FeatureParam<bool>
    kAutofillGranularFillingAvailableWithImprovedLabelsParam{};

// This variation controls whether the "Fill everything" button is displayed at
// the top or at the bottom. When at the top, it is displayed regardless of the
// filling mode. When at the bottom, it is displayed in all modes but the full
// form filling mode.
// The feature variation exists to separate the granular filling feature into
// multiple sub-features. Thus, metrics can be evaluated separately for each
// sub-feature.
// TODO(crbug.com/40274514): Clean up when launched.
const base::FeatureParam<bool>
    kAutofillGranularFillingAvailableWithFillEverythingAtTheBottomParam{};

// This variation controls whether the expand children suggestions control is
// hidden for non-selected/non-expanded suggestions (and the control shows up
// when any part of the suggestion row is selected/hovered).
// This adjustment in behavior is not a part of the originally approved
// functionality and only exists to investigate one of the hypothesises of
// the acceptance rate drop reasons, namely, user's potential confusion due to
// the newly introduced UI pattern.
// TODO(crbug.com/40274514): Clean up when launched.
const base::FeatureParam<bool>
    kAutofillGranularFillingAvailableWithExpandControlVisibleOnSelectionOnly{};

// Controls whether field filling through the context menu will be available for
// the unclassified fields.
// TODO(crbug.com/40285811): Clean up when launched.
BASE_FEATURE();

// Controls whether test address profiles will be present in the Autofill popup.
// TODO(crbug.com/40270486): Clean up when launched.
BASE_FEATURE();

// Allows silent profile updates even when the profile import requirements are
// not met.
BASE_FEATURE();

// Sends text change events for contenteditable elements. When this is off,
// only input elements and maybe textarea elements send text change events.
BASE_FEATURE();

// Causes Autofill to announce the Compose popup less assertively.
BASE_FEATURE();

// Controls an ablation study in which autofill for addresses and payment data
// can be suppressed.
BASE_FEATURE();
// The following parameters are only effective if the study is enabled.
// If "enabled_for_addresses" is true this means that the ablation study is
// enabled for addresses meaning that autofill may be disabled on some forms.
const base::FeatureParam<bool> kAutofillAblationStudyEnabledForAddressesParam{};
const base::FeatureParam<bool> kAutofillAblationStudyEnabledForPaymentsParam{};
// The ratio of ablation_weight_per_mille / 1000 determines the chance of
// autofill being disabled on a given combination of site * time_window * client
// session. E.g. an ablation_weight_per_mille = 10 means that there is a 1%
// ablation chance.
const base::FeatureParam<int> kAutofillAblationStudyAblationWeightPerMilleParam{};
// If not 0, the kAutofillAblationStudyAblationWeightPerMilleListXParam
// specify the ablation chances for sites that are on the respective list X.
// These parameters are different from
// kAutofillAblationStudyAblationWeightPerMilleParam which applies to all
// domains.
const base::FeatureParam<int>
    kAutofillAblationStudyAblationWeightPerMilleList1Param{};
const base::FeatureParam<int>
    kAutofillAblationStudyAblationWeightPerMilleList2Param{};
const base::FeatureParam<int>
    kAutofillAblationStudyAblationWeightPerMilleList3Param{};
const base::FeatureParam<int>
    kAutofillAblationStudyAblationWeightPerMilleList4Param{};
const base::FeatureParam<int>
    kAutofillAblationStudyAblationWeightPerMilleList5Param{};
const base::FeatureParam<int>
    kAutofillAblationStudyAblationWeightPerMilleList6Param{};
// If true, the ablation study runs as an A/A study (no behavioral changes) but
// clients are assigned to the respective groups.
const base::FeatureParam<bool> kAutofillAblationStudyIsDryRun{};
// Improves the selection of phone country codes by also considering address
// country codes / names.
// See GetStreetAddressForInput() in field_filling_address_util.cc for a details
// description.
// TODO(crbug.com/40249216). Clean up when launched.
BASE_FEATURE();

// Controls autofill popup style, if enabled it becomes more prominent,
// i.e. its shadow becomes more emphasized, position is also updated.
// TODO(crbug.com/40235454): Remove once the experiment is over.
BASE_FEATURE();
const base::FeatureParam<int> kAutofillMoreProminentPopupMaxOffsetToCenterParam{};

// Enable the feature by default, and set the enabled percentage as a feature
// param. We are logging information of field types, autofill status and
// forms with a defined sampling rate of 10% on sessions.
// Autofill FormSummary/FieldInfo UKM schema:
// https://docs.google.com/document/d/1ZH0JbL6bES3cD4KqZWsGR6n8I-rhnkx6no6nQOgYq5w/.
BASE_FEATURE();
const base::FeatureParam<int> kAutofillLogUKMEventsWithSamplingOnSessionRate{};

// Controls whether user tap on an element is needed to show autofill
// suggestions. If enabled, this flag would disable android autofill suggestions
// if the focus on an element is Javascript-originated.
// DidReceiveLeftMouseDownOrGestureTapInNode() will show suggestions if the
// focus change occurred as a result of a gesture. See crbug.com/730764 for why
// showing autofill suggestions as a result of JavaScript changing focus is
// enabled on WebView.
// TODO(crbug.com/40286775) Clean up autofill feature flag
// `kAutofillAndroidDisableSuggestionsOnJSFocus`
BASE_FEATURE();

// When enabled, FormFieldParser::MatchesRegexWithCache tries to avoid
// re-computing whether a regex matches an input string by caching the result.
// The result size is controlled by
// kAutofillEnableCacheForRegexMatchingCacheSizeParam.
BASE_FEATURE();
const base::FeatureParam<int>
    kAutofillEnableCacheForRegexMatchingCacheSizeParam{};

// When enabled, various deduplication related metrics are logged on startup
// and on import.
// TODO(crbug.com/325452461): Remove once rolled out.
BASE_FEATURE();

// When enabled, various deduplication related metrics are logged on startup
// and on import. Used only if `kAutofillLogDeduplicationMetrics` is enabled.
// TODO(crbug.com/325452461): Remove once rolled out.
BASE_FEATURE();

// When enabled, low-quality quasi duplicates of rank one are silently removed
// during the once-per-milestone deduplication routine.
// TODO(crbug.com/325450676): Remove when launched.
BASE_FEATURE();

// Currently, the importing logic offers new profile creation if the observed
// profile is non-mergeable with any existing profile. With this feature, low-
// quality tokens receive special treatment and can bypass this requirement.
// In particular, if the observed profile was autofilled, except for an edit in
// a single type, this qualifies for an update of the autofilled profile, in
// case the edited type has low-quality.
// TODO(crbug.com/325451601): Remove when launched.
BASE_FEATURE();

BASE_FEATURE();
const base::FeatureParam<std::string> kAutofillUKMExperimentalFieldsBucket0{};
const base::FeatureParam<std::string> kAutofillUKMExperimentalFieldsBucket1{};
const base::FeatureParam<std::string> kAutofillUKMExperimentalFieldsBucket2{};
const base::FeatureParam<std::string> kAutofillUKMExperimentalFieldsBucket3{};
const base::FeatureParam<std::string> kAutofillUKMExperimentalFieldsBucket4{};

// When enabled, `AutofillProfile` tracks the second and third last use date of
// each profile (instead of just the last use date).
// TODO(crbug.com/354706653): Remove when launched.
COMPONENT_EXPORT(AUTOFILL)
BASE_FEATURE(kAutofillTrackMultipleUseDates,
             "AutofillTrackMultipleUseDates",
             base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_ANDROID)
// Controls if Chrome Autofill UI surfaces ignore touch events if something is
// fully or partially obscuring the Chrome window.
BASE_FEATURE(kAutofillEnableSecurityTouchEventFilteringAndroid,
             "AutofillEnableSecurityTouchEventFilteringAndroid",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Controls the whether the Chrome may provide a virtual view structure for
// Android Autofill.
BASE_FEATURE(kAutofillVirtualViewStructureAndroid,
             "AutofillVirtualViewStructureAndroid",
             base::FEATURE_DISABLED_BY_DEFAULT);

#endif  // BUILDFLAG(IS_ANDROID)

namespace test {

// Testing tool that collects metrics during a run of the captured site tests
// and dumps the collected metrics into a specified output directory.
// For each test, a file named {test-name}.txt is created. It contains all the
// collected metrics in the following format.
// histogram-name-1
// bucket value
// ...
// histogram-name-2
// ...
// The set of metrics can be restricted using
// `kAutofillCapturedSiteTestsMetricsScraperMetricNames`.
// It is helpful in conjunction with `tools/captured_sites/metrics-scraper.py`.
BASE_FEATURE();
// Name of the directory to write the results into.
const base::FeatureParam<std::string>
    kAutofillCapturedSiteTestsMetricsScraperOutputDir{};
// A regex matching the histogram names that should be dumped. If not specified,
// the metrics of all histograms dumped.
const base::FeatureParam<std::string>
    kAutofillCapturedSiteTestsMetricsScraperHistogramRegex{};

// If enabled, Captured Site Tests will use 'AutofillFlow' utility to trigger
// the autofill action. This feature is for testing purposes and is not supposed
// to be launched.
BASE_FEATURE();

// If enabled, Autofill will not apply updates to address profiles based on data
// extracted from submitted forms. This feature is mostly for debugging and
// testing purposes and is not supposed to be launched.
BASE_FEATURE();

// If enabled, Autofill will not apply silent updates to the structure of
// addresses and names. This feature is mostly for debugging and testing
// purposes and is not supposed to be launched.
BASE_FEATURE();

// Kill switch for disabling suppressing suggestions based on the strike
// database.
BASE_FEATURE();

// Enables logging the content of chrome://autofill-internals to the terminal.
BASE_FEATURE();

// Allows passing a set of overrides for Autofill server predictions.
// Example command line to override server predictions manually:
// chrome --enable-features=AutofillOverridePredictions:spec/1_2_4-7_8_9
// This creates two manual overrides that supersede server predictions as
// follows:
// * The server prediction for the field with signature 2 in the form with
//   signature 1 is overridden to be 4 (NAME_MIDDLE).
// * The server prediction for the field with signature 8 in the form with
//   signature 7 is overridden to be 9 (EMAIL_ADDRESS).
//
// See components/autofill/core/browser/server_prediction_overrides.h for more
// examples and details on how to specify overrides.
BASE_FEATURE();

// The override specification in string form.
const base::FeatureParam<std::string> kAutofillOverridePredictionsSpecification{};

// The override specification using alternative_form_signature in string form.
const base::FeatureParam<std::string>
    kAutofillOverridePredictionsForAlternativeFormSignaturesSpecification{};

// Enables or Disables (mostly for hermetic testing) autofill server
// communication. The URL of the autofill server can further be controlled via
// the autofill-server-url param. The given URL should specify the complete
// autofill server API url up to the parent "directory" of the "query" and
// "upload" resources.
// i.e., https://other.autofill.server:port/tbproxy/af/
BASE_FEATURE();

// Controls attaching the autofill type predictions to their respective
// element in the DOM.
BASE_FEATURE();
// This variation controls whether the verbose version of the feature is used.
// In this version more information is attached to the respective DOM element,
// such as aria labels and descriptions and select element options values and
// texts.
const base::FeatureParam<bool> kAutofillShowTypePredictionsVerboseParam{};

// Autofill upload throttling limits uploading a form to the Autofill server
// more than once over a `kAutofillUploadThrottlingPeriodInDays` period.
// This feature is for testing purposes and is not supposed
// to be launched.
BASE_FEATURE();

}  // namespace test

}  // namespace autofill::features