Chromium Code Reviews| 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 bb8c3bd798804492192cb8a055d209d730ee9b3d..2375995848fd89a4c91414ae2625f7c83ff5212e 100644 |
| --- a/components/autofill/core/browser/form_structure.cc |
| +++ b/components/autofill/core/browser/form_structure.cc |
| @@ -305,7 +305,8 @@ FormStructure::FormStructure(const FormData& form) |
| was_parsed_for_autocomplete_attributes_(false), |
| has_password_field_(false), |
| is_form_tag_(form.is_form_tag), |
| - is_formless_checkout_(form.is_formless_checkout) { |
| + is_formless_checkout_(form.is_formless_checkout), |
| + all_fields_are_passwords_(true) { |
| // Copy the form fields. |
| std::map<base::string16, size_t> unique_names; |
| for (const FormFieldData& field : form.fields) { |
| @@ -320,6 +321,8 @@ FormStructure::FormStructure(const FormData& form) |
| if (field.form_control_type == "password") |
| has_password_field_ = true; |
| + else |
| + all_fields_are_passwords_ = false; |
| // Generate a unique name for this field by appending a counter to the name. |
| // Make sure to prepend the counter with a non-numeric digit so that we are |
| @@ -580,7 +583,10 @@ void FormStructure::UpdateAutofillCount() { |
| } |
| bool FormStructure::ShouldBeParsed() const { |
| - if (active_field_count() < kRequiredFieldsForPredictionRoutines && |
| + if ((active_field_count() < |
| + kRequiredFieldsAllPasswordsForUploadAndPrediction || |
|
Ilya Sherman
2016/02/09 22:33:39
This logic is implicitly assuming that kRequiredFi
dvadym
2016/02/10 11:58:28
Done, I've rewritten it as negation to condition f
|
| + (!all_fields_are_passwords() && |
| + active_field_count() < kRequiredFieldsForPredictionRoutines)) && |
| !has_author_specified_types_) { |
| return false; |
| } |