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

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

Issue 17341006: [Password Autofill] Don't fill fields with autocomplete="off". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 ab36e6efeca09923c1e8d1a676e147f2414d0aa7..a7ee567ea3e0d0dd627da641c9aa44200ac6a906 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -180,8 +180,10 @@ void FillForm(FormElements* fe, const FormData& data) {
for (FormInputElementMap::iterator it = fe->input_elements.begin();
it != fe->input_elements.end(); ++it) {
WebKit::WebInputElement element = it->second;
- if (!IsElementEditable(element))
- continue; // Don't fill uneditable fields.
+
+ // Don't fill uneditable fields or fields with autocomplete disabled.
+ if (!IsElementEditable(element) || !element.autoComplete())
+ continue;
// TODO(tkent): Check maxlength and pattern.
element.setValue(data_map[it->first]);
« 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