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

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

Issue 2881033003: [Password Manager] Send a request to the store if user clicks on an undetected password field (Closed)
Patch Set: Rebase Created 3 years, 7 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
« no previous file with comments | « chrome/renderer/autofill/password_autofill_agent_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d0cf6994e2d3de919b10346b6d4e1f89d77e29a6..dfa8d4eac5c4a9318f5d32539ac181b99030a9a1 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -886,6 +886,13 @@ bool PasswordAutofillAgent::FindPasswordInfoForElement(
if (!element.IsPasswordField()) {
*username_element = element;
} else {
+ // If there is a password field, but a request to the store hasn't been sent
+ // yet, then do fetch saved credentials now.
+ if (!sent_request_to_store_) {
+ SendPasswordForms(false);
+ return false;
+ }
+
WebInputToPasswordInfoMap::iterator iter =
web_input_to_password_info_.find(element);
if (iter != web_input_to_password_info_.end()) {
@@ -1224,10 +1231,11 @@ void PasswordAutofillAgent::SendPasswordForms(bool only_visible) {
rep.SetPathStr("");
password_forms.back().signon_realm =
password_forms.back().origin.ReplaceComponents(rep).spec();
- sent_request_to_store_ = true;
}
- if (!password_forms.empty())
+ if (!password_forms.empty()) {
+ sent_request_to_store_ = true;
GetPasswordManagerDriver()->PasswordFormsParsed(password_forms);
+ }
}
}
« no previous file with comments | « chrome/renderer/autofill/password_autofill_agent_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698