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

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 2583493003: Password Manager: skip non-text fields from consideration for filling. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/password/ambiguous_password_form.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/content/renderer/password_autofill_agent.h" 5 #include "components/autofill/content/renderer/password_autofill_agent.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 continue; 170 continue;
171 } 171 }
172 172
173 if (!control_element.hasHTMLTagName("input")) 173 if (!control_element.hasHTMLTagName("input"))
174 continue; 174 continue;
175 175
176 // Only fill saved passwords into password fields and usernames into text 176 // Only fill saved passwords into password fields and usernames into text
177 // fields. 177 // fields.
178 const blink::WebInputElement input_element = 178 const blink::WebInputElement input_element =
179 control_element.toConst<blink::WebInputElement>(); 179 control_element.toConst<blink::WebInputElement>();
180 if (input_element.isPasswordField() != is_password_field) 180 if (!input_element.isTextField() ||
181 input_element.isPasswordField() != is_password_field)
181 continue; 182 continue;
182 183
183 // For change password form with ambiguous or empty names keep only the 184 // For change password form with ambiguous or empty names keep only the
184 // first password field having |autocomplete='current-password'| attribute 185 // first password field having |autocomplete='current-password'| attribute
185 // set. Also make sure we avoid keeping password fields having 186 // set. Also make sure we avoid keeping password fields having
186 // |autocomplete='new-password'| attribute set. 187 // |autocomplete='new-password'| attribute set.
187 if (ambiguous_and_multiple_password_fields_with_autocomplete && 188 if (ambiguous_and_multiple_password_fields_with_autocomplete &&
188 !HasAutocompleteAttributeValue(input_element, "current-password")) { 189 !HasAutocompleteAttributeValue(input_element, "current-password")) {
189 continue; 190 continue;
190 } 191 }
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 PasswordAutofillAgent::GetPasswordManagerDriver() { 1501 PasswordAutofillAgent::GetPasswordManagerDriver() {
1501 if (!password_manager_driver_) { 1502 if (!password_manager_driver_) {
1502 render_frame()->GetRemoteInterfaces()->GetInterface( 1503 render_frame()->GetRemoteInterfaces()->GetInterface(
1503 mojo::GetProxy(&password_manager_driver_)); 1504 mojo::GetProxy(&password_manager_driver_));
1504 } 1505 }
1505 1506
1506 return password_manager_driver_; 1507 return password_manager_driver_;
1507 } 1508 }
1508 1509
1509 } // namespace autofill 1510 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/test/data/password/ambiguous_password_form.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698