| 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 21 matching lines...) Expand all Loading... |
| 32 KURL icon_url = ParseStringAsURL(data.iconURL(), exception_state); | 32 KURL icon_url = ParseStringAsURL(data.iconURL(), exception_state); |
| 33 KURL provider_url = ParseStringAsURL(data.provider(), exception_state); | 33 KURL provider_url = ParseStringAsURL(data.provider(), exception_state); |
| 34 if (exception_state.HadException()) | 34 if (exception_state.HadException()) |
| 35 return nullptr; | 35 return nullptr; |
| 36 return new FederatedCredential(data.id(), provider_url, data.name(), | 36 return new FederatedCredential(data.id(), provider_url, data.name(), |
| 37 icon_url); | 37 icon_url); |
| 38 } | 38 } |
| 39 | 39 |
| 40 FederatedCredential::FederatedCredential( | 40 FederatedCredential::FederatedCredential( |
| 41 WebFederatedCredential* web_federated_credential) | 41 WebFederatedCredential* web_federated_credential) |
| 42 : SiteBoundCredential(web_federated_credential->GetPlatformCredential()) {} | 42 : CredentialUserData(web_federated_credential->GetPlatformCredential()) {} |
| 43 | 43 |
| 44 FederatedCredential::FederatedCredential(const String& id, | 44 FederatedCredential::FederatedCredential(const String& id, |
| 45 const KURL& provider, | 45 const KURL& provider, |
| 46 const String& name, | 46 const String& name, |
| 47 const KURL& icon) | 47 const KURL& icon) |
| 48 : SiteBoundCredential( | 48 : CredentialUserData( |
| 49 PlatformFederatedCredential::Create(id, | 49 PlatformFederatedCredential::Create(id, |
| 50 SecurityOrigin::Create(provider), | 50 SecurityOrigin::Create(provider), |
| 51 name, | 51 name, |
| 52 icon)) {} | 52 icon)) {} |
| 53 | 53 |
| 54 const String FederatedCredential::provider() const { | 54 const String FederatedCredential::provider() const { |
| 55 return static_cast<PlatformFederatedCredential*>(platform_credential_.Get()) | 55 return static_cast<PlatformFederatedCredential*>(platform_credential_.Get()) |
| 56 ->Provider() | 56 ->Provider() |
| 57 ->ToString(); | 57 ->ToString(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| OLD | NEW |