OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |