| 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 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
| 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // has implemented some form of autofill. | 109 // has implemented some form of autofill. |
| 110 base::string16 username_value; | 110 base::string16 username_value; |
| 111 | 111 |
| 112 // This member is populated in cases where we there are multiple input | 112 // This member is populated in cases where we there are multiple input |
| 113 // elements that could possibly be the username. Used when our heuristics for | 113 // elements that could possibly be the username. Used when our heuristics for |
| 114 // determining the username are incorrect. Optional. | 114 // determining the username are incorrect. Optional. |
| 115 // | 115 // |
| 116 // When parsing an HTML form, this is typically empty. | 116 // When parsing an HTML form, this is typically empty. |
| 117 std::vector<base::string16> other_possible_usernames; | 117 std::vector<base::string16> other_possible_usernames; |
| 118 | 118 |
| 119 // The name of the password input element, Optional (improves scoring). | 119 // The name of the input element corresponding to the current password. |
| 120 // Optional (improves scoring). |
| 120 // | 121 // |
| 121 // When parsing an HTML form, this must always be set. | 122 // When parsing an HTML form, this will always be set, unless it is a sign-up |
| 123 // form or a change password form that does not ask for the current password. |
| 124 // In these two cases the |new_password_element| will always be set. |
| 122 base::string16 password_element; | 125 base::string16 password_element; |
| 123 | 126 |
| 124 // The password. Required. | 127 // The current password. Must be non-empty for PasswordForm instances that are |
| 128 // meant to be persisted to the password store. |
| 125 // | 129 // |
| 126 // When parsing an HTML form, this is typically empty. | 130 // When parsing an HTML form, this is typically empty. |
| 127 base::string16 password_value; | 131 base::string16 password_value; |
| 128 | 132 |
| 129 // False if autocomplete is set to "off" for the password input element; | 133 // False if autocomplete is set to "off" for the password input element; |
| 130 // True otherwise. | 134 // True otherwise. |
| 131 bool password_autocomplete_set; | 135 bool password_autocomplete_set; |
| 132 | 136 |
| 133 // If the form was a change password form, the name of the | 137 // If the form was a sign-up or a change password form, the name of the input |
| 134 // 'old password' input element. Optional. | 138 // element corresponding to the new password. Optional, and not persisted. |
| 135 base::string16 old_password_element; | 139 base::string16 new_password_element; |
| 136 | 140 |
| 137 // The old password. Optional. | 141 // The new password. Optional, and not persisted. |
| 138 base::string16 old_password_value; | 142 base::string16 new_password_value; |
| 139 | 143 |
| 140 // Whether or not this login was saved under an HTTPS session with a valid | 144 // Whether or not this login was saved under an HTTPS session with a valid |
| 141 // SSL cert. We will never match or autofill a PasswordForm where | 145 // SSL cert. We will never match or autofill a PasswordForm where |
| 142 // ssl_valid == true with a PasswordForm where ssl_valid == false. This means | 146 // ssl_valid == true with a PasswordForm where ssl_valid == false. This means |
| 143 // passwords saved under HTTPS will never get autofilled onto an HTTP page. | 147 // passwords saved under HTTPS will never get autofilled onto an HTTP page. |
| 144 // When importing, this should be set to true if the page URL is HTTPS, thus | 148 // When importing, this should be set to true if the page URL is HTTPS, thus |
| 145 // giving it "the benefit of the doubt" that the SSL cert was valid when it | 149 // giving it "the benefit of the doubt" that the SSL cert was valid when it |
| 146 // was saved. Default to false. | 150 // was saved. Default to false. |
| 147 bool ssl_valid; | 151 bool ssl_valid; |
| 148 | 152 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 220 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
| 217 typedef std::map<base::string16, PasswordForm*> PasswordFormMap; | 221 typedef std::map<base::string16, PasswordForm*> PasswordFormMap; |
| 218 | 222 |
| 219 // For testing. | 223 // For testing. |
| 220 std::ostream& operator<<(std::ostream& os, | 224 std::ostream& operator<<(std::ostream& os, |
| 221 const autofill::PasswordForm& form); | 225 const autofill::PasswordForm& form); |
| 222 | 226 |
| 223 } // namespace autofill | 227 } // namespace autofill |
| 224 | 228 |
| 225 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 229 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
| OLD | NEW |