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_CONTENT_COMMON_CREDENTIAL_MANAGER_TYPES_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_TYPES_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_TYPES_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_TYPES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
| 15 namespace autofill { |
| 16 struct PasswordForm; |
| 17 } |
| 18 |
15 namespace password_manager { | 19 namespace password_manager { |
16 | 20 |
17 // Limit the size of the federations array that we pass to the browser to | 21 // Limit the size of the federations array that we pass to the browser to |
18 // something reasonably sane. | 22 // something reasonably sane. |
19 const size_t kMaxFederations = 50u; | 23 const size_t kMaxFederations = 50u; |
20 | 24 |
21 enum CredentialType { | 25 enum CredentialType { |
22 CREDENTIAL_TYPE_UNKNOWN = 0, | 26 CREDENTIAL_TYPE_UNKNOWN = 0, |
23 CREDENTIAL_TYPE_LOCAL, | 27 CREDENTIAL_TYPE_LOCAL, |
24 CREDENTIAL_TYPE_FEDERATED, | 28 CREDENTIAL_TYPE_FEDERATED, |
25 CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED | 29 CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED |
26 }; | 30 }; |
27 | 31 |
28 struct CredentialInfo { | 32 struct CredentialInfo { |
29 CredentialInfo(); | 33 CredentialInfo(); |
30 CredentialInfo(const base::string16& id, | 34 CredentialInfo(const base::string16& id, |
31 const base::string16& name, | 35 const base::string16& name, |
32 const GURL& avatar); | 36 const GURL& avatar); |
| 37 CredentialInfo(const autofill::PasswordForm& form); |
33 ~CredentialInfo(); | 38 ~CredentialInfo(); |
34 | 39 |
35 CredentialType type; | 40 CredentialType type; |
36 | 41 |
37 // An identifier (username, email address, etc). Corresponds to | 42 // An identifier (username, email address, etc). Corresponds to |
38 // WebCredential's id property. | 43 // WebCredential's id property. |
39 base::string16 id; | 44 base::string16 id; |
40 | 45 |
41 // An user-friendly name ("John Doe"). Corresponds to WebCredential's name | 46 // An user-friendly name ("John Doe"). Corresponds to WebCredential's name |
42 // property. | 47 // property. |
43 base::string16 name; | 48 base::string16 name; |
44 | 49 |
45 // The address of a user's avatar. Corresponds to WebCredential's avatar | 50 // The address of a user's avatar. Corresponds to WebCredential's avatar |
46 // property. | 51 // property. |
47 GURL avatar; | 52 GURL avatar; |
48 | 53 |
49 // Corresponds to WebLocalCredential's password property. | 54 // Corresponds to WebLocalCredential's password property. |
50 base::string16 password; | 55 base::string16 password; |
51 | 56 |
52 // Corresponds to WebFederatedCredential's federation property, which is an | 57 // Corresponds to WebFederatedCredential's federation property, which is an |
53 // origin serialized as a URL (e.g. "https://example.com/"). | 58 // origin serialized as a URL (e.g. "https://example.com/"). |
54 GURL federation; | 59 GURL federation; |
55 }; | 60 }; |
56 | 61 |
57 } // namespace password_manager | 62 } // namespace password_manager |
58 | 63 |
59 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_TYPES_H
_ | 64 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_TYPES_H
_ |
OLD | NEW |