summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebIntent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/WebIntent.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebIntent.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/src/WebIntent.cpp b/Source/WebKit/chromium/src/WebIntent.cpp
index ce4e15bd6..67723bf93 100644
--- a/Source/WebKit/chromium/src/WebIntent.cpp
+++ b/Source/WebKit/chromium/src/WebIntent.cpp
@@ -32,12 +32,26 @@
#include "WebIntent.h"
#include "Intent.h"
+#include "MessagePort.h"
#include "PlatformMessagePortChannel.h"
#include "SerializedScriptValue.h"
#include <wtf/HashMap.h>
namespace WebKit {
+WebIntent::WebIntent(const WebString& action, const WebString& type, const WebString& data)
+{
+#if ENABLE(WEB_INTENTS)
+ WebCore::ExceptionCode ec = 0;
+ WebCore::MessagePortArray ports;
+ RefPtr<WebCore::Intent> intent = WebCore::Intent::create(action, type, WebCore::SerializedScriptValue::createFromWire(data), ports, ec);
+ if (ec)
+ return;
+
+ m_private = intent.release();
+#endif
+}
+
#if ENABLE(WEB_INTENTS)
WebIntent::WebIntent(const PassRefPtr<WebCore::Intent>& intent)
: m_private(intent)
@@ -130,6 +144,11 @@ WebMessagePortChannelArray* WebIntent::messagePortChannelsRelease() const
return webChannels;
}
+WebIntent::operator WebCore::Intent*() const
+{
+ return m_private.get();
+}
+
WebVector<WebString> WebIntent::extrasNames() const
{
#if ENABLE(WEB_INTENTS)