Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: components/autofill/core/browser/form_structure.cc

Issue 1671753004: [Autofill] Fill fields that have an autocomplete attributes even if not in a form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/form_structure.cc
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc
index feb1ddc7dbb1755bb0a175bc3a3ce69c7afa1b31..14127cc9cfdfe8c97f3a1b8042da8d16d2a35283 100644
--- a/components/autofill/core/browser/form_structure.cc
+++ b/components/autofill/core/browser/form_structure.cc
@@ -304,7 +304,8 @@ FormStructure::FormStructure(const FormData& form)
has_author_specified_sections_(false),
was_parsed_for_autocomplete_attributes_(false),
has_password_field_(false),
- is_form_tag_(form.is_form_tag) {
+ is_form_tag_(form.is_form_tag),
+ is_syntehtic_non_checkout_form(form.is_syntehtic_non_checkout_form) {
// Copy the form fields.
std::map<base::string16, size_t> unique_names;
for (const FormFieldData& field : form.fields) {
@@ -337,13 +338,14 @@ FormStructure::~FormStructure() {}
void FormStructure::DetermineHeuristicTypes() {
// First, try to detect field types based on each field's |autocomplete|
- // attribute value. If there is at least one form field that specifies an
- // autocomplete type hint, don't try to apply other heuristics to match fields
- // in this form.
+ // attribute value.
if (!was_parsed_for_autocomplete_attributes_)
ParseFieldTypesFromAutocompleteAttributes();
- if (active_field_count() >= kRequiredFieldsForPredictionRoutines) {
+ // Then, if there are enough active fields and if the form is not a synthetic
+ // non checkout form, run the heuristics and server prediction routines.
+ if (active_field_count() >= kRequiredFieldsForPredictionRoutines &&
+ !is_syntehtic_non_checkout_form) {
Mathieu 2016/02/05 18:39:06 I would change this to a combination !(is_form_tag
sebsg 2016/02/05 20:08:00 Done.
ServerFieldTypeMap field_type_map;
FormField::ParseFormFields(fields_.get(), is_form_tag_, &field_type_map);
for (size_t i = 0; i < field_count(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698