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

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: Added more handling. 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..dabe513cd490b0bd9b7f79ec29c5e52cbe6702c3 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() &&
+ IsInputElementHidden((blink::WebInputElement*)&input_element)) {
vabr (Chromium) 2015/10/20 16:40:22 Please use IsWebNodeVisible. That will also get ri
Pritam Nikam 2015/10/22 09:00:08 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698