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

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

Issue 1072813002: Avoid considering readonly password elements in password form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated as per review comments Created 5 years, 8 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/test/data/password/password_form_with_password_readonly.html ('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_form_conversion_utils.cc
diff --git a/components/autofill/content/renderer/password_form_conversion_utils.cc b/components/autofill/content/renderer/password_form_conversion_utils.cc
index 7ad5814273126fa24f9014b298a63b3ed370cebd..0c85b9a73e4ef3e42bf5bd81f0f1448103a00d34 100644
--- a/components/autofill/content/renderer/password_form_conversion_utils.cc
+++ b/components/autofill/content/renderer/password_form_conversion_utils.cc
@@ -254,7 +254,12 @@ void GetPasswordForm(
layout_sequence.push_back('N');
}
- if (input_element->isPasswordField()) {
+ // If the password field is readonly, the page is likely using a virtual
+ // keyboard and bypassing the password field value (see http://crbug.com/475488)
vabr (Chromium) 2015/04/10 10:45:38 nit: Also, a full-stop (".") is missing after the
vabr (Chromium) 2015/04/10 10:45:38 nit: Here the comment ran over the 80 characters p
ramya.v 2015/04/13 03:01:44 Done.
ramya.v 2015/04/13 03:01:44 Done.
+ // There is nothing Chrome can do to fill passwords for now.
+ if (input_element->isPasswordField() && (!input_element->isReadOnly() ||
+ HasAutocompleteAttributeValue(*input_element, "current_password") ||
+ HasAutocompleteAttributeValue(*input_element, "new-password"))) {
passwords.push_back(*input_element);
// If we have not yet considered any element to be the username so far,
// provisionally select the input element just before the first password
« no previous file with comments | « chrome/test/data/password/password_form_with_password_readonly.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698