Chromium Code Reviews| Index: components/autofill/content/renderer/form_cache.cc |
| diff --git a/components/autofill/content/renderer/form_cache.cc b/components/autofill/content/renderer/form_cache.cc |
| index 334afa94fa69d331cb1ba78b5411cc9ca74e2980..dd770bb55babb68a64604490e5e8002859765a01 100644 |
| --- a/components/autofill/content/renderer/form_cache.cc |
| +++ b/components/autofill/content/renderer/form_cache.cc |
| @@ -65,15 +65,21 @@ bool IsFormInteresting(const FormData& form, size_t num_editable_elements) { |
| // If the form has at least one field with an autocomplete attribute, it is a |
| // candidate for autofill. |
| + bool all_fields_are_passwords = true; |
| for (const FormFieldData& field : form.fields) { |
| if (!field.autocomplete_attribute.empty()) |
| return true; |
| + if (field.form_control_type != "password") |
|
Ilya Sherman
2016/02/09 22:33:39
Not related to this change, but it would be nice t
dvadym
2016/02/10 11:58:28
Yeah, I also was wondering why string used for thi
|
| + all_fields_are_passwords = false; |
| } |
| // If there are no autocomplete attributes, the form needs to have at least |
| // the required number of editable fields for the prediction routines to be a |
| // candidate for autofill. |
| - return num_editable_elements >= kRequiredFieldsForPredictionRoutines; |
| + return num_editable_elements >= kRequiredFieldsForPredictionRoutines || |
| + (all_fields_are_passwords && |
| + num_editable_elements >= |
| + kRequiredFieldsAllPasswordsForUploadAndPrediction); |
| } |
| } // namespace |