| 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..bb8c3bd798804492192cb8a055d209d730ee9b3d 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_formless_checkout_(form.is_formless_checkout) {
|
| // Copy the form fields.
|
| std::map<base::string16, size_t> unique_names;
|
| for (const FormFieldData& field : form.fields) {
|
| @@ -337,13 +338,15 @@ 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 we are dealing with either a
|
| + // proper <form> or a <form>-less checkout, run the heuristics and server
|
| + // prediction routines.
|
| + if (active_field_count() >= kRequiredFieldsForPredictionRoutines &&
|
| + (is_form_tag_ || is_formless_checkout_)) {
|
| ServerFieldTypeMap field_type_map;
|
| FormField::ParseFormFields(fields_.get(), is_form_tag_, &field_type_map);
|
| for (size_t i = 0; i < field_count(); ++i) {
|
|
|