summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebIntentData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/WebIntentData.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebIntentData.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/WebIntentData.cpp b/Source/WebKit2/UIProcess/WebIntentData.cpp
index 37695a4fe..96128dbe2 100644
--- a/Source/WebKit2/UIProcess/WebIntentData.cpp
+++ b/Source/WebKit2/UIProcess/WebIntentData.cpp
@@ -28,6 +28,11 @@
#if ENABLE(WEB_INTENTS)
+#include "ImmutableArray.h"
+#include "ImmutableDictionary.h"
+#include "WebString.h"
+#include "WebURL.h"
+
namespace WebKit {
WebIntentData::WebIntentData(const IntentData& store)
@@ -41,6 +46,29 @@ PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const
return WebSerializedScriptValue::adopt(dataCopy);
}
+PassRefPtr<ImmutableArray> WebIntentData::suggestions() const
+{
+ const size_t numSuggestions = m_store.suggestions.size();
+ Vector<RefPtr<APIObject> > wkSuggestions(numSuggestions);
+ for (unsigned i = 0; i < numSuggestions; ++i)
+ wkSuggestions[i] = WebURL::create(m_store.suggestions[i]);
+ return ImmutableArray::adopt(wkSuggestions);
+}
+
+String WebIntentData::extra(const String& key) const
+{
+ return m_store.extras.get(key);
+}
+
+PassRefPtr<ImmutableDictionary> WebIntentData::extras() const
+{
+ ImmutableDictionary::MapType wkExtras;
+ HashMap<String, String>::const_iterator end = m_store.extras.end();
+ for (HashMap<String, String>::const_iterator it = m_store.extras.begin(); it != end; ++it)
+ wkExtras.set(it->first, WebString::create(it->second));
+ return ImmutableDictionary::adopt(wkExtras);
+}
+
} // namespace WebKit
#endif // ENABLE(WEB_INTENTS)