OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PASSWORD_MANAGER_CORE_COMMON_CREDENTIAL_MANAGER_TYPES_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_CREDENTIAL_MANAGER_TYPES_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_CREDENTIAL_MANAGER_TYPES_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_CREDENTIAL_MANAGER_TYPES_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <ostream> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
15 #include "url/origin.h" | 16 #include "url/origin.h" |
16 | 17 |
17 namespace autofill { | 18 namespace autofill { |
18 struct PasswordForm; | 19 struct PasswordForm; |
19 } | 20 } |
20 | 21 |
21 namespace password_manager { | 22 namespace password_manager { |
22 | 23 |
23 // Limit the size of the federations array that we pass to the browser to | 24 // Limit the size of the federations array that we pass to the browser to |
24 // something reasonably sane. | 25 // something reasonably sane. |
25 const size_t kMaxFederations = 50u; | 26 const size_t kMaxFederations = 50u; |
26 | 27 |
27 enum class CredentialType { | 28 enum class CredentialType { |
28 CREDENTIAL_TYPE_EMPTY = 0, | 29 CREDENTIAL_TYPE_EMPTY = 0, |
29 CREDENTIAL_TYPE_PASSWORD, | 30 CREDENTIAL_TYPE_PASSWORD, |
30 CREDENTIAL_TYPE_FEDERATED, | 31 CREDENTIAL_TYPE_FEDERATED, |
31 CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED | 32 CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED |
32 }; | 33 }; |
33 | 34 |
| 35 std::ostream& operator<<(std::ostream& os, CredentialType value); |
| 36 |
34 struct CredentialInfo { | 37 struct CredentialInfo { |
35 CredentialInfo(); | 38 CredentialInfo(); |
36 CredentialInfo(const autofill::PasswordForm& form, CredentialType form_type); | 39 CredentialInfo(const autofill::PasswordForm& form, CredentialType form_type); |
37 CredentialInfo(const CredentialInfo& other); | 40 CredentialInfo(const CredentialInfo& other); |
38 ~CredentialInfo(); | 41 ~CredentialInfo(); |
39 | 42 |
40 bool operator==(const CredentialInfo& rhs) const; | 43 bool operator==(const CredentialInfo& rhs) const; |
41 | 44 |
42 CredentialType type; | 45 CredentialType type; |
43 | 46 |
(...skipping 18 matching lines...) Expand all Loading... |
62 | 65 |
63 // Create a new autofill::PasswordForm object based on |info|, valid in the | 66 // Create a new autofill::PasswordForm object based on |info|, valid in the |
64 // context of |origin|. Returns an empty scoped_ptr for CREDENTIAL_TYPE_EMPTY. | 67 // context of |origin|. Returns an empty scoped_ptr for CREDENTIAL_TYPE_EMPTY. |
65 scoped_ptr<autofill::PasswordForm> CreatePasswordFormFromCredentialInfo( | 68 scoped_ptr<autofill::PasswordForm> CreatePasswordFormFromCredentialInfo( |
66 const CredentialInfo& info, | 69 const CredentialInfo& info, |
67 const GURL& origin); | 70 const GURL& origin); |
68 | 71 |
69 } // namespace password_manager | 72 } // namespace password_manager |
70 | 73 |
71 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_CREDENTIAL_MANAGER_TYPES_H_ | 74 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_CREDENTIAL_MANAGER_TYPES_H_ |
OLD | NEW |