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 <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "components/autofill/core/common/form_data.h" | 14 #include "components/autofill/core/common/form_data.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 #include "url/origin.h" | 16 #include "url/origin.h" |
17 | 17 |
18 namespace autofill { | 18 namespace autofill { |
19 | 19 |
20 // The PasswordForm struct encapsulates information about a login form, | 20 // The PasswordForm struct encapsulates information about a login form, |
21 // 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. |
22 // | 22 // |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // (origin, username_element, username_value, password_element, signon_realm). | 296 // (origin, username_element, username_value, password_element, signon_realm). |
297 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, | 297 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, |
298 const PasswordForm& right); | 298 const PasswordForm& right); |
299 | 299 |
300 // A comparator for the unique key. | 300 // A comparator for the unique key. |
301 struct LessThanUniqueKey { | 301 struct LessThanUniqueKey { |
302 bool operator()(const PasswordForm* left, const PasswordForm* right) const; | 302 bool operator()(const PasswordForm* left, const PasswordForm* right) const; |
303 }; | 303 }; |
304 | 304 |
305 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 305 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
306 using PasswordFormMap = std::map<base::string16, scoped_ptr<PasswordForm>>; | 306 using PasswordFormMap = std::map<base::string16, std::unique_ptr<PasswordForm>>; |
307 | 307 |
308 // Like PasswordFormMap, but with weak (not owned) pointers. | 308 // Like PasswordFormMap, but with weak (not owned) pointers. |
309 using ConstPasswordFormMap = std::map<base::string16, const PasswordForm*>; | 309 using ConstPasswordFormMap = std::map<base::string16, const PasswordForm*>; |
310 | 310 |
311 // For testing. | 311 // For testing. |
312 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 312 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
313 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); | 313 std::ostream& operator<<(std::ostream& os, const PasswordForm& form); |
314 std::ostream& operator<<(std::ostream& os, PasswordForm* form); | 314 std::ostream& operator<<(std::ostream& os, PasswordForm* form); |
315 | 315 |
316 } // namespace autofill | 316 } // namespace autofill |
317 | 317 |
318 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 318 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |