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 #include "modules/credentialmanager/FederatedCredential.h" | 5 #include "modules/credentialmanager/FederatedCredential.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "modules/credentialmanager/FederatedCredentialData.h" | 8 #include "modules/credentialmanager/FederatedCredentialData.h" |
9 #include "platform/credentialmanager/PlatformFederatedCredential.h" | 9 #include "platform/credentialmanager/PlatformFederatedCredential.h" |
10 #include "platform/weborigin/SecurityOrigin.h" | 10 #include "platform/weborigin/SecurityOrigin.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 KURL iconURL = parseStringAsURL(data.iconURL(), exceptionState); | 31 KURL iconURL = parseStringAsURL(data.iconURL(), exceptionState); |
32 KURL providerURL = parseStringAsURL(data.provider(), exceptionState); | 32 KURL providerURL = parseStringAsURL(data.provider(), exceptionState); |
33 if (exceptionState.hadException()) | 33 if (exceptionState.hadException()) |
34 return nullptr; | 34 return nullptr; |
35 return new FederatedCredential(data.id(), providerURL, data.name(), iconURL)
; | 35 return new FederatedCredential(data.id(), providerURL, data.name(), iconURL)
; |
36 } | 36 } |
37 | 37 |
38 FederatedCredential::FederatedCredential(WebFederatedCredential* webFederatedCre
dential) | 38 FederatedCredential::FederatedCredential(WebFederatedCredential* webFederatedCre
dential) |
39 : Credential(webFederatedCredential->platformCredential()) | 39 : Credential(webFederatedCredential->getPlatformCredential()) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 FederatedCredential::FederatedCredential(const String& id, const KURL& provider,
const String& name, const KURL& icon) | 43 FederatedCredential::FederatedCredential(const String& id, const KURL& provider,
const String& name, const KURL& icon) |
44 : Credential(PlatformFederatedCredential::create(id, SecurityOrigin::create(
provider), name, icon)) | 44 : Credential(PlatformFederatedCredential::create(id, SecurityOrigin::create(
provider), name, icon)) |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 const String FederatedCredential::provider() const | 48 const String FederatedCredential::provider() const |
49 { | 49 { |
50 return static_cast<PlatformFederatedCredential*>(m_platformCredential.get())
->provider()->toString(); | 50 return static_cast<PlatformFederatedCredential*>(m_platformCredential.get())
->provider()->toString(); |
51 } | 51 } |
52 | 52 |
53 } // namespace blink | 53 } // namespace blink |
OLD | NEW |