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

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

Issue 2716873002: More robust fill password fields on click. (Closed)
Patch Set: Created 3 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
« 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 1120b1e7543dca9938cbb06b27a56d944777685e..8c1f1556b02eceb89ce6f5d72e37bee2952a2a39 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -1432,6 +1432,17 @@ void PasswordAutofillAgent::GetFillableElementFromFormData(
if (elements)
elements->push_back(main_element);
}
+
+ // This is a fallback, if for some reasons elements for filling were not found
+ // (for example because they were renamed by JavaScript) then add fill data
+ // for |web_input_to_password_info_| in order to be able propose filling of
+ // password fields on click.
+ if (web_input_to_password_info_.empty()) {
+ PasswordInfo password_info;
+ password_info.fill_data = form_data;
+ password_info.key = key;
+ web_input_to_password_info_[blink::WebInputElement()] = password_info;
vabr (Chromium) 2017/02/24 20:10:36 Could you explain in a code comment, how the |pass
dvadym 2017/02/27 10:14:29 Yeah, your explanation is correct, I've updated th
+ }
}
void PasswordAutofillAgent::FocusedNodeHasChanged(const blink::WebNode& node) {
« 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