Chromium Code Reviews| Index: Source/platform/exported/WebCredential.cpp |
| diff --git a/Source/platform/exported/WebCredential.cpp b/Source/platform/exported/WebCredential.cpp |
| index 7f01394a32b0675c463d6ac81869a7ed35bb50f5..be8bfcba01ea51f491a4293f33c12da92c5e06e8 100644 |
| --- a/Source/platform/exported/WebCredential.cpp |
| +++ b/Source/platform/exported/WebCredential.cpp |
| @@ -6,14 +6,34 @@ |
| #include "public/platform/WebCredential.h" |
| #include "platform/credentialmanager/PlatformCredential.h" |
| +#include "public/platform/WebFederatedCredential.h" |
| +#include "public/platform/WebLocalCredential.h" |
| namespace blink { |
| +WebCredential WebCredential::create(PlatformCredential* credential) |
| +{ |
| + ASSERT(credential->isLocal() || credential->isFederated()); |
| + |
| + if (credential->isLocal()) { |
| + WebLocalCredential local(credential); |
| + return local; |
| + } |
| + |
| + WebFederatedCredential federated(credential); |
| + return federated; |
|
kenneth.r.christiansen
2014/10/09 13:34:02
Wouldn´t it be better to add this in an if as well
|
| +} |
| + |
| WebCredential::WebCredential(const WebString& id, const WebString& name, const WebURL& avatarURL) |
| : m_platformCredential(PlatformCredential::create(id, name, avatarURL)) |
| { |
| } |
| +WebCredential::WebCredential(const WebCredential& other) |
| +{ |
| + assign(other); |
| +} |
| + |
| void WebCredential::assign(const WebCredential& other) |
| { |
| m_platformCredential = other.m_platformCredential; |
| @@ -50,4 +70,14 @@ WebURL WebCredential::avatarURL() const |
| return m_platformCredential->avatarURL(); |
| } |
| +bool WebCredential::isLocalCredential() const |
| +{ |
| + return m_platformCredential->isLocal(); |
| +} |
| + |
| +bool WebCredential::isFederatedCredential() const |
| +{ |
| + return m_platformCredential->isFederated(); |
| +} |
| + |
| } // namespace blink |