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_form_conversion_utils.h" | 5 #include "components/autofill/content/renderer/password_form_conversion_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 PasswordForm::Layout SequenceToLayout(base::StringPiece layout_sequence) { | 93 PasswordForm::Layout SequenceToLayout(base::StringPiece layout_sequence) { |
94 if (MatchesLoginAndSignupPattern(layout_sequence)) | 94 if (MatchesLoginAndSignupPattern(layout_sequence)) |
95 return PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; | 95 return PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; |
96 return PasswordForm::Layout::LAYOUT_OTHER; | 96 return PasswordForm::Layout::LAYOUT_OTHER; |
97 } | 97 } |
98 | 98 |
99 // Checks in a case-insensitive way if the autocomplete attribute for the given | 99 // Checks in a case-insensitive way if the autocomplete attribute for the given |
100 // |element| is present and has the specified |value_in_lowercase|. | 100 // |element| is present and has the specified |value_in_lowercase|. |
101 bool HasAutocompleteAttributeValue(const WebInputElement& element, | 101 bool HasAutocompleteAttributeValue(const WebInputElement& element, |
102 const char* value_in_lowercase) { | 102 const char* value_in_lowercase) { |
103 return LowerCaseEqualsASCII(element.getAttribute("autocomplete"), | 103 return base::LowerCaseEqualsASCII(element.getAttribute("autocomplete"), |
104 value_in_lowercase); | 104 value_in_lowercase); |
105 } | 105 } |
106 | 106 |
107 // Helper to determine which password is the main (current) one, and which is | 107 // Helper to determine which password is the main (current) one, and which is |
108 // the new password (e.g., on a sign-up or change password form), if any. | 108 // the new password (e.g., on a sign-up or change password form), if any. |
109 bool LocateSpecificPasswords(std::vector<WebInputElement> passwords, | 109 bool LocateSpecificPasswords(std::vector<WebInputElement> passwords, |
110 WebInputElement* current_password, | 110 WebInputElement* current_password, |
111 WebInputElement* new_password) { | 111 WebInputElement* new_password) { |
112 DCHECK(current_password && current_password->isNull()); | 112 DCHECK(current_password && current_password->isNull()); |
113 DCHECK(new_password && new_password->isNull()); | 113 DCHECK(new_password && new_password->isNull()); |
114 | 114 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 WebFormElementToFormData(web_form, | 486 WebFormElementToFormData(web_form, |
487 blink::WebFormControlElement(), | 487 blink::WebFormControlElement(), |
488 EXTRACT_NONE, | 488 EXTRACT_NONE, |
489 &password_form->form_data, | 489 &password_form->form_data, |
490 NULL /* FormFieldData */); | 490 NULL /* FormFieldData */); |
491 | 491 |
492 return password_form.Pass(); | 492 return password_form.Pass(); |
493 } | 493 } |
494 | 494 |
495 } // namespace autofill | 495 } // namespace autofill |
OLD | NEW |