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

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

Issue 1408423003: [Password Manager] Ignore autofilling invisible password fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses Vaclav's inputs. Created 5 years, 2 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
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 86c6bf030441a42d79d909db4e88f4b92f65b96e..e049dfeaf5a3a786b0c6b6c1c30a672f702e4eae 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -185,6 +185,12 @@ bool FindFormInputElement(
if (input_element.isPasswordField() != is_password_field)
continue;
+ // Avoid autofilling invisible password fields.
+ if (input_element.isPasswordField() &&
+ !form_util::IsWebNodeVisible(input_element)) {
+ continue;
+ }
+
// For change password form with ambiguous or empty names keep only the
// first password field having |autocomplete='current-password'| attribute
// set. Also make sure we avoid keeping password fields having
« no previous file with comments | « chrome/test/data/password/password_form.html ('k') | components/autofill/content/renderer/password_form_conversion_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698