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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 773823002: PasswordManager should trigger autofill for new forms + old PasswordFromManagers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't duplicate the blacklist & generation IPC Created 6 years 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/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index dfa7bf7b1472aa2ec418ddde85ba474ede6f6a1d..50473bedbf340803dd8ef5bd0af504bc31883a61 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -995,6 +995,12 @@ void PasswordAutofillAgent::OnFillPasswordForm(
if (form_data.password_field.name.empty())
break;
+ // We might have already filled this form if there are two <form> elements
+ // with identical markup.
+ if (login_to_password_info_.find(username_element) !=
+ login_to_password_info_.end())
+ continue;
+
// Get pointer to password element. (We currently only support single
// password forms).
password_element =
@@ -1011,11 +1017,6 @@ void PasswordAutofillAgent::OnFillPasswordForm(
base::Unretained(&gatekeeper_)))) {
usernames_usage_ = OTHER_POSSIBLE_USERNAME_SELECTED;
}
- // We might have already filled this form if there are two <form> elements
- // with identical markup.
- if (login_to_password_info_.find(username_element) !=
- login_to_password_info_.end())
- continue;
PasswordInfo password_info;
password_info.fill_data = form_data;
« no previous file with comments | « chrome/test/data/password/dynamic_password_form.html ('k') | components/password_manager/core/browser/password_form_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698