| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // True if the unique keys for the forms are the same. The unique key is | 289 // True if the unique keys for the forms are the same. The unique key is |
| 290 // (origin, username_element, username_value, password_element, signon_realm). | 290 // (origin, username_element, username_value, password_element, signon_realm). |
| 291 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, | 291 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, |
| 292 const PasswordForm& right); | 292 const PasswordForm& right); |
| 293 | 293 |
| 294 // A comparator for the unique key. | 294 // A comparator for the unique key. |
| 295 struct LessThanUniqueKey { | 295 struct LessThanUniqueKey { |
| 296 bool operator()(const PasswordForm* left, const PasswordForm* right) const; | 296 bool operator()(const PasswordForm* left, const PasswordForm* right) const; |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 // Map username to PasswordForm* for convenience. See password_form_manager.h. | |
| 300 using PasswordFormMap = std::map<base::string16, std::unique_ptr<PasswordForm>>; | |
| 301 | |
| 302 // Like PasswordFormMap, but with weak (not owned) pointers. | |
| 303 using ConstPasswordFormMap = std::map<base::string16, const PasswordForm*>; | |
| 304 | |
| 305 // For testing. | 299 // For testing. |
| 306 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 300 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
| 307 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); | 301 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); |
| 308 std::ostream& operator<<(std::ostream& os, PasswordForm* form); | 302 std::ostream& operator<<(std::ostream& os, PasswordForm* form); |
| 309 | 303 |
| 310 } // namespace autofill | 304 } // namespace autofill |
| 311 | 305 |
| 312 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 306 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
| OLD | NEW |