[Autofill] Do not discard form data after dynamic *credit card* form submission
This cl is mostly similar wtih 1137021 but apply only to credit card form.
Description from 1137021:
Prior to this change form data were being discarded after a dynamic form
submission. This was because the dynamically changed form was being added
to the cache with its user entered/autofilled values. At the time of
submission, form data were being discarded as they were thought to be the
initial values of the fields at page load. This CL changes
AutofillHandler::OnFormsSeen (which is called on dynamic form changes) to
attempt to find a previously cached version of the form first. Prior to
addition to the cache, form values are overridden by the cached values.
This prevents those values from getting confused with the initial form
values at the time of submission.
Bug: 947312
Change-Id: If50377ecba76bd931c545ecb347ce1b681959c41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545210
Commit-Queue: Hao Zhang <[email protected]>
Reviewed-by: Bret Sepulveda <[email protected]>
Reviewed-by: Parastoo Geranmayeh <[email protected]>
Reviewed-by: Fabio Tirelo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#648023}
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 4f0ec675..2c26f27 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -290,6 +290,9 @@
extern const char kEnableAutofillImportNonFocusableCreditCardFormsName[];
extern const char kEnableAutofillImportNonFocusableCreditCardFormsDescription[];
+extern const char kEnableAutofillImportDynamicFormsName[];
+extern const char kEnableAutofillImportDynamicFormsDescription[];
+
extern const char kEnableAutofillLocalCardMigrationShowFeedbackName[];
extern const char kEnableAutofillLocalCardMigrationShowFeedbackDescription[];