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

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: 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 e301934db586c958ef57714d8f59cbf7f53f2320..dc8e9af6d4633fad38c7b8cdb645c0320770ae39 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -886,6 +886,11 @@ 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);
dvadym 2017/05/16 12:13:48 Nit: We could make return from this function. If n
kolos1 2017/05/17 09:05:30 Done.
+
WebInputToPasswordInfoMap::iterator iter =
web_input_to_password_info_.find(element);
if (iter != web_input_to_password_info_.end()) {
@@ -1224,10 +1229,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