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 #include "ios/web/public/web_state/js/credential_util.h" | 5 #include "ios/web/public/web_state/js/credential_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "ios/web/public/web_state/credential.h" | 11 #include "ios/web/public/web_state/credential.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 #include "url/origin.h" | 13 #include "url/origin.h" |
14 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
15 namespace { | 19 namespace { |
16 | 20 |
17 // "type" value for a DictionaryValue representation of PasswordCredential. | 21 // "type" value for a DictionaryValue representation of PasswordCredential. |
18 const char* kPasswordCredentialType = "PasswordCredential"; | 22 const char* kPasswordCredentialType = "PasswordCredential"; |
19 | 23 |
20 // "type" value for a DictionaryValue representation of FederatedCredential. | 24 // "type" value for a DictionaryValue representation of FederatedCredential. |
21 const char* kFederatedCredentialType = "FederatedCredential"; | 25 const char* kFederatedCredentialType = "FederatedCredential"; |
22 | 26 |
23 } // namespace | 27 } // namespace |
24 | 28 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 break; | 102 break; |
99 default: | 103 default: |
100 NOTREACHED(); | 104 NOTREACHED(); |
101 } | 105 } |
102 value->SetString("id", credential.id); | 106 value->SetString("id", credential.id); |
103 value->SetString("name", credential.name); | 107 value->SetString("name", credential.name); |
104 value->SetString("avatarURL", credential.avatar_url.spec()); | 108 value->SetString("avatarURL", credential.avatar_url.spec()); |
105 } | 109 } |
106 | 110 |
107 } // web | 111 } // web |
OLD | NEW |