Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: Source/platform/exported/WebCredential.cpp

Issue 640263002: Credential Manager: Pass the correct credential type to the embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « Source/platform/credentialmanager/PlatformLocalCredential.h ('k') | Source/platform/exported/WebFederatedCredential.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698