| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 : base::ASCIIToUTF16(kDummyUsernameField) | 122 : base::ASCIIToUTF16(kDummyUsernameField) |
| 123 : field.name; | 123 : field.name; |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool IsUnownedPasswordFormVisible(blink::WebFrame* frame, | 126 bool IsUnownedPasswordFormVisible(blink::WebFrame* frame, |
| 127 const blink::WebInputElement& input_element, | 127 const blink::WebInputElement& input_element, |
| 128 const GURL& action, | 128 const GURL& action, |
| 129 const GURL& origin, | 129 const GURL& origin, |
| 130 const FormData& form_data, | 130 const FormData& form_data, |
| 131 const FormsPredictionsMap& form_predictions) { | 131 const FormsPredictionsMap& form_predictions) { |
| 132 if (!input_element.isNull() && form_util::IsWebNodeVisible(input_element)) | 132 if (!input_element.isNull() && form_util::IsWebElementVisible(input_element)) |
| 133 return true; | 133 return true; |
| 134 | 134 |
| 135 std::unique_ptr<PasswordForm> unowned_password_form( | 135 std::unique_ptr<PasswordForm> unowned_password_form( |
| 136 CreatePasswordFormFromUnownedInputElements(*frame, nullptr, | 136 CreatePasswordFormFromUnownedInputElements(*frame, nullptr, |
| 137 &form_predictions)); | 137 &form_predictions)); |
| 138 if (!unowned_password_form) | 138 if (!unowned_password_form) |
| 139 return false; | 139 return false; |
| 140 std::vector<blink::WebFormControlElement> control_elements = | 140 std::vector<blink::WebFormControlElement> control_elements = |
| 141 form_util::GetUnownedAutofillableFormFieldElements( | 141 form_util::GetUnownedAutofillableFormFieldElements( |
| 142 frame->document().all(), nullptr); | 142 frame->document().all(), nullptr); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // |autocomplete='new-password'| attribute set. | 195 // |autocomplete='new-password'| attribute set. |
| 196 if (ambiguous_and_multiple_password_fields_with_autocomplete && | 196 if (ambiguous_and_multiple_password_fields_with_autocomplete && |
| 197 !HasAutocompleteAttributeValue(input_element, "current-password")) { | 197 !HasAutocompleteAttributeValue(input_element, "current-password")) { |
| 198 continue; | 198 continue; |
| 199 } | 199 } |
| 200 | 200 |
| 201 // Check for a non-unique match. | 201 // Check for a non-unique match. |
| 202 if (found_input) { | 202 if (found_input) { |
| 203 // For change password form keep only the first password field entry. | 203 // For change password form keep only the first password field entry. |
| 204 if (does_password_field_has_ambigous_or_empty_name) { | 204 if (does_password_field_has_ambigous_or_empty_name) { |
| 205 if (!form_util::IsWebNodeVisible((*result)[field_name])) { | 205 if (!form_util::IsWebElementVisible((*result)[field_name])) { |
| 206 // If a previously chosen field was invisible then take the current | 206 // If a previously chosen field was invisible then take the current |
| 207 // one. | 207 // one. |
| 208 (*result)[field_name] = input_element; | 208 (*result)[field_name] = input_element; |
| 209 } | 209 } |
| 210 continue; | 210 continue; |
| 211 } | 211 } |
| 212 | 212 |
| 213 found_input = false; | 213 found_input = false; |
| 214 break; | 214 break; |
| 215 } | 215 } |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 PasswordAutofillAgent::GetPasswordManagerDriver() { | 1602 PasswordAutofillAgent::GetPasswordManagerDriver() { |
| 1603 if (!password_manager_driver_) { | 1603 if (!password_manager_driver_) { |
| 1604 render_frame()->GetRemoteInterfaces()->GetInterface( | 1604 render_frame()->GetRemoteInterfaces()->GetInterface( |
| 1605 mojo::MakeRequest(&password_manager_driver_)); | 1605 mojo::MakeRequest(&password_manager_driver_)); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 return password_manager_driver_; | 1608 return password_manager_driver_; |
| 1609 } | 1609 } |
| 1610 | 1610 |
| 1611 } // namespace autofill | 1611 } // namespace autofill |
| OLD | NEW |