| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_WEB_PUBLIC_WEB_STATE_CREDENTIAL_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_CREDENTIAL_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_STATE_CREDENTIAL_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_CREDENTIAL_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 #include "url/origin.h" |
| 10 | 11 |
| 11 namespace web { | 12 namespace web { |
| 12 | 13 |
| 13 // Indicates the specific type of a Credential object. | 14 // Indicates the specific type of a Credential object. |
| 14 enum CredentialType { | 15 enum CredentialType { |
| 15 CREDENTIAL_TYPE_EMPTY = 0, | 16 CREDENTIAL_TYPE_EMPTY = 0, |
| 16 CREDENTIAL_TYPE_PASSWORD, | 17 CREDENTIAL_TYPE_PASSWORD, |
| 17 CREDENTIAL_TYPE_FEDERATED, | 18 CREDENTIAL_TYPE_FEDERATED, |
| 18 CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED | 19 CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED |
| 19 }; | 20 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 // A human-understandable name corresponding to the credential. | 33 // A human-understandable name corresponding to the credential. |
| 33 base::string16 name; | 34 base::string16 name; |
| 34 | 35 |
| 35 // The URL of the user's avatar. | 36 // The URL of the user's avatar. |
| 36 GURL avatar_url; | 37 GURL avatar_url; |
| 37 | 38 |
| 38 // The password for a local credential. | 39 // The password for a local credential. |
| 39 base::string16 password; | 40 base::string16 password; |
| 40 | 41 |
| 41 // The federation URL for a federated credential. | 42 // The federation URL for a federated credential. |
| 42 GURL federation_url; | 43 url::Origin federation_origin; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 // Determines whether two credentials are equal. | 46 // Determines whether two credentials are equal. |
| 46 bool CredentialsEqual(const web::Credential& credential1, | 47 bool CredentialsEqual(const web::Credential& credential1, |
| 47 const web::Credential& credential2); | 48 const web::Credential& credential2); |
| 48 | 49 |
| 49 } // namespace web | 50 } // namespace web |
| 50 | 51 |
| 51 #endif // IOS_WEB_PUBLIC_WEB_STATE_CREDENTIAL_H_ | 52 #endif // IOS_WEB_PUBLIC_WEB_STATE_CREDENTIAL_H_ |
| OLD | NEW |