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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // Return true if we consider this form to be a change password form | 273 // Return true if we consider this form to be a change password form |
274 // without username field. We use only client heuristics, so it could | 274 // without username field. We use only client heuristics, so it could |
275 // include signup forms. | 275 // include signup forms. |
276 bool IsPossibleChangePasswordFormWithoutUsername() const; | 276 bool IsPossibleChangePasswordFormWithoutUsername() const; |
277 | 277 |
278 // Equality operators for testing. | 278 // Equality operators for testing. |
279 bool operator==(const PasswordForm& form) const; | 279 bool operator==(const PasswordForm& form) const; |
280 bool operator!=(const PasswordForm& form) const; | 280 bool operator!=(const PasswordForm& form) const; |
281 | 281 |
282 PasswordForm(); | 282 PasswordForm(); |
| 283 PasswordForm(const PasswordForm& other); |
283 ~PasswordForm(); | 284 ~PasswordForm(); |
284 }; | 285 }; |
285 | 286 |
286 // True if the unique keys for the forms are the same. The unique key is | 287 // True if the unique keys for the forms are the same. The unique key is |
287 // (origin, username_element, username_value, password_element, signon_realm). | 288 // (origin, username_element, username_value, password_element, signon_realm). |
288 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, | 289 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, |
289 const PasswordForm& right); | 290 const PasswordForm& right); |
290 | 291 |
291 // A comparator for the unique key. | 292 // A comparator for the unique key. |
292 struct LessThanUniqueKey { | 293 struct LessThanUniqueKey { |
293 bool operator()(const PasswordForm* left, const PasswordForm* right) const; | 294 bool operator()(const PasswordForm* left, const PasswordForm* right) const; |
294 }; | 295 }; |
295 | 296 |
296 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 297 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
297 using PasswordFormMap = std::map<base::string16, scoped_ptr<PasswordForm>>; | 298 using PasswordFormMap = std::map<base::string16, scoped_ptr<PasswordForm>>; |
298 | 299 |
299 // Like PasswordFormMap, but with weak (not owned) pointers. | 300 // Like PasswordFormMap, but with weak (not owned) pointers. |
300 using ConstPasswordFormMap = std::map<base::string16, const PasswordForm*>; | 301 using ConstPasswordFormMap = std::map<base::string16, const PasswordForm*>; |
301 | 302 |
302 // For testing. | 303 // For testing. |
303 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 304 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
304 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); | 305 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); |
305 std::ostream& operator<<(std::ostream& os, PasswordForm* form); | 306 std::ostream& operator<<(std::ostream& os, PasswordForm* form); |
306 | 307 |
307 } // namespace autofill | 308 } // namespace autofill |
308 | 309 |
309 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 310 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |