Commit 49fb0fdf authored by Matthias Körber's avatar Matthias Körber Committed by Commit Bot

[Autofill] Maintain initial value in |FormStructure| cache for all types

Bug: 1091401, 1096990
Change-Id: Ic88dd8e0ac67ced35127fcdacca90749a6972669
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254142
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781205}
parent a5a06c29
......@@ -1084,7 +1084,10 @@ void FormStructure::RetrieveFromCache(
bool is_credit_card_field =
AutofillType(cached_field->second->Type().GetStorableType())
.group() == CREDIT_CARD;
if (should_keep_cached_value && is_credit_card_field) {
if (should_keep_cached_value &&
(is_credit_card_field ||
base::FeatureList::IsEnabled(
features::kAutofillKeepInitialFormValuesInCache))) {
field->value = cached_field->second->value;
value_from_dynamic_change_form_ = true;
} else if (field->value == cached_field->second->value) {
......
......@@ -54,7 +54,7 @@ const base::Feature kAutofillCreditCardAssist{
// Controls whether we download server credit cards to the ephemeral
// account-based storage when sync the transport is enabled.
const base::Feature kAutofillEnableAccountWalletStorage{
const base::Feature kAutofillEnableAccountWalletStorage {
"AutofillEnableAccountWalletStorage",
#if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_IOS)
// Wallet transport is only currently available on Win/Mac/Linux.
......@@ -106,6 +106,11 @@ const base::Feature kAutofillExtractAllDatalists{
const base::Feature kAutofillFixFillableFieldTypes{
"AutofillFixFillableFieldTypes", base::FEATURE_DISABLED_BY_DEFAULT};
// When enabled, Autofill keeps the initial field values in the |FormStructure|
// cache for all field types.
const base::Feature kAutofillKeepInitialFormValuesInCache{
"AutofillKeepCachedFormValues", base::FEATURE_ENABLED_BY_DEFAULT};
// When enabled, autofill suggestions are displayed in the keyboard accessory
// instead of the regular popup.
const base::Feature kAutofillKeyboardAccessory{
......
......@@ -36,6 +36,7 @@ extern const base::Feature kAutofillEnforceMinRequiredFieldsForQuery;
extern const base::Feature kAutofillEnforceMinRequiredFieldsForUpload;
extern const base::Feature kAutofillExtractAllDatalists;
extern const base::Feature kAutofillFixFillableFieldTypes;
extern const base::Feature kAutofillKeepInitialFormValuesInCache;
extern const base::Feature kAutofillKeyboardAccessory;
extern const base::Feature kAutofillPruneSuggestions;
extern const base::Feature kAutofillMetadataUploads;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment