Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 if (!control_element.hasHTMLTagName("input")) | 178 if (!control_element.hasHTMLTagName("input")) |
| 179 continue; | 179 continue; |
| 180 | 180 |
| 181 // Only fill saved passwords into password fields and usernames into text | 181 // Only fill saved passwords into password fields and usernames into text |
| 182 // fields. | 182 // fields. |
| 183 const blink::WebInputElement input_element = | 183 const blink::WebInputElement input_element = |
| 184 control_element.toConst<blink::WebInputElement>(); | 184 control_element.toConst<blink::WebInputElement>(); |
| 185 if (input_element.isPasswordField() != is_password_field) | 185 if (input_element.isPasswordField() != is_password_field) |
| 186 continue; | 186 continue; |
| 187 | 187 |
| 188 // Avoid autofilling invisible password fields. | |
| 189 if (input_element.isPasswordField() && | |
| 190 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.
| |
| 191 continue; | |
| 192 } | |
| 193 | |
| 188 // For change password form with ambiguous or empty names keep only the | 194 // For change password form with ambiguous or empty names keep only the |
| 189 // first password field having |autocomplete='current-password'| attribute | 195 // first password field having |autocomplete='current-password'| attribute |
| 190 // set. Also make sure we avoid keeping password fields having | 196 // set. Also make sure we avoid keeping password fields having |
| 191 // |autocomplete='new-password'| attribute set. | 197 // |autocomplete='new-password'| attribute set. |
| 192 if (ambiguous_and_multiple_password_fields_with_autocomplete && | 198 if (ambiguous_and_multiple_password_fields_with_autocomplete && |
| 193 !HasAutocompleteAttributeValue(input_element, "current-password")) { | 199 !HasAutocompleteAttributeValue(input_element, "current-password")) { |
| 194 continue; | 200 continue; |
| 195 } | 201 } |
| 196 | 202 |
| 197 // Check for a non-unique match. | 203 // Check for a non-unique match. |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1525 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { | 1531 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { |
| 1526 agent_->DidStopLoading(); | 1532 agent_->DidStopLoading(); |
| 1527 } | 1533 } |
| 1528 | 1534 |
| 1529 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: | 1535 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: |
| 1530 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { | 1536 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { |
| 1531 agent_->LegacyDidStartProvisionalLoad(navigated_frame); | 1537 agent_->LegacyDidStartProvisionalLoad(navigated_frame); |
| 1532 } | 1538 } |
| 1533 | 1539 |
| 1534 } // namespace autofill | 1540 } // namespace autofill |
| OLD | NEW |