| 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> |
| 11 | 11 |
| 12 #include "base/containers/scoped_ptr_map.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 13 #include "components/autofill/core/common/form_data.h" | 15 #include "components/autofill/core/common/form_data.h" |
| 14 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 15 | 17 |
| 16 namespace autofill { | 18 namespace autofill { |
| 17 | 19 |
| 18 // The PasswordForm struct encapsulates information about a login form, | 20 // The PasswordForm struct encapsulates information about a login form, |
| 19 // which can be an HTML form or a dialog with username/password text fields. | 21 // which can be an HTML form or a dialog with username/password text fields. |
| 20 // | 22 // |
| 21 // The Web Data database stores saved username/passwords and associated form | 23 // The Web Data database stores saved username/passwords and associated form |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 275 |
| 274 // Equality operators for testing. | 276 // Equality operators for testing. |
| 275 bool operator==(const PasswordForm& form) const; | 277 bool operator==(const PasswordForm& form) const; |
| 276 bool operator!=(const PasswordForm& form) const; | 278 bool operator!=(const PasswordForm& form) const; |
| 277 | 279 |
| 278 PasswordForm(); | 280 PasswordForm(); |
| 279 ~PasswordForm(); | 281 ~PasswordForm(); |
| 280 }; | 282 }; |
| 281 | 283 |
| 282 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 284 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
| 283 typedef std::map<base::string16, PasswordForm*> PasswordFormMap; | 285 typedef ScopedPtrMap<base::string16, scoped_ptr<PasswordForm>> PasswordFormMap; |
| 284 | 286 |
| 287 // Like PasswordFormMap, but with weak (not owned) pointers. |
| 285 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; | 288 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; |
| 286 | 289 |
| 287 // For testing. | 290 // For testing. |
| 288 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 291 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
| 289 std::ostream& operator<<(std::ostream& os, const autofill::PasswordForm& form); | 292 std::ostream& operator<<(std::ostream& os, const autofill::PasswordForm& form); |
| 290 std::ostream& operator<<(std::ostream& os, autofill::PasswordForm* form); | 293 std::ostream& operator<<(std::ostream& os, autofill::PasswordForm* form); |
| 291 | 294 |
| 292 } // namespace autofill | 295 } // namespace autofill |
| 293 | 296 |
| 294 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 297 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
| OLD | NEW |