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

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

Issue 1670763006: Autofill server-side heuristics for 2 fields password form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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 bb8c3bd798804492192cb8a055d209d730ee9b3d..f0e8c5f50806672ac67872736b6e278d1df78f54 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
@@ -581,6 +584,8 @@ void FormStructure::UpdateAutofillCount() {
bool FormStructure::ShouldBeParsed() const {
if (active_field_count() < kRequiredFieldsForPredictionRoutines &&
+ (!all_fields_are_passwords() ||
+ active_field_count() < kRequiredFieldsForFormsWithOnlyPasswordFields) &&
!has_author_specified_types_) {
return false;
}
« no previous file with comments | « components/autofill/core/browser/form_structure.h ('k') | components/autofill/core/browser/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698