[WK2] Support multiple URLs for WebApp meta tag
authorJihye Kang <jye.kang@samsung.com>
Fri, 22 Mar 2013 08:58:07 +0000 (17:58 +0900)
committerGerrit Code Review <gerrit2@kim11>
Tue, 26 Mar 2013 13:58:04 +0000 (22:58 +0900)
[Title] Support multiple URLs for WebApp meta tag
[Issue#] N/A
[Problem] Provide a last icon url only
[Cause]
[Solution] Provide an API to get list of icon data which is the set of icon size and urls for WebApp meta tag
- void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, void *user_data) is added.
- Ewk_Web_App_Icon_Data type is added.
Following EAPIs are added
- ewk_view_web_application_icon_urls_get()
- ewk_web_application_icon_data_size_get()
- ewk_web_application_icon_data_url_get()

Change-Id: I51076ddf1fcf9dcb919d9a633a74e13436108c52

15 files changed:
Source/WebKit2/PlatformTizen.cmake
Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.cpp
Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.h
Source/WebKit2/UIProcess/API/efl/EWebKit2.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view.h
Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data_private.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

index 47b2914..0e07a16 100755 (executable)
@@ -94,6 +94,7 @@ LIST(APPEND WebKit2StaticForDebug_SOURCES
     UIProcess/API/efl/ewk_view_notification_provider.cpp
     UIProcess/API/efl/ewk_view_tizen_client.cpp
     UIProcess/API/efl/ewk_view_ui_client.cpp
+    UIProcess/API/efl/ewk_web_application_icon_data.cpp
 
     UIProcess/API/efl/tizen/ClipboardHelper.cpp
     UIProcess/API/efl/tizen/Drag.cpp
index 23c7231..9a04dd7 100644 (file)
@@ -109,6 +109,13 @@ void WKPageGetWebAppIconURL(WKPageRef page, void* context, WKPageGetWebAppIconUR
 #endif
 }
 
+void WKPageGetWebAppIconURLs(WKPageRef page, void* context, WKPageGetWebAppIconURLsFunction callback)
+{
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+    toImpl(page)->getWebAppIconURLs(DictionaryCallback::create(context, callback));
+#endif
+}
+
 void WKPageExecuteCommandWithArgument(WKPageRef page, WKStringRef command, WKStringRef argument)
 {
     toImpl(page)->executeEditCommandWithArgument(toImpl(command)->string(), toImpl(argument)->string());
index 17c09d9..cbf4a84 100644 (file)
@@ -94,6 +94,8 @@ typedef void (*WKPageGetWebAppCapableFunction)(WKBooleanRef capable, WKErrorRef,
 WK_EXPORT void WKPageGetWebAppCapable(WKPageRef page, void* context, WKPageGetWebAppCapableFunction function);
 typedef void (*WKPageGetWebAppIconURLFunction)(WKStringRef iconURL, WKErrorRef, void*);
 WK_EXPORT void WKPageGetWebAppIconURL(WKPageRef page, void* context, WKPageGetWebAppIconURLFunction function);
+typedef void (*WKPageGetWebAppIconURLsFunction)(WKDictionaryRef iconURLs, WKErrorRef, void*);
+WK_EXPORT void WKPageGetWebAppIconURLs(WKPageRef page, void* context, WKPageGetWebAppIconURLsFunction function);
 // #endif
 
 WK_EXPORT void WKPageExecuteCommandWithArgument(WKPageRef page, WKStringRef command, WKStringRef argument);
index 9852054..7b9dc89 100755 (executable)
@@ -64,5 +64,6 @@
 #include "ewk_text_checker.h"
 #include "ewk_text_style.h"
 #include "ewk_user_media.h"
+#include "ewk_web_application_icon_data.h"
 
 #endif // EWebKit2_h
index 90fd731..25686f7 100755 (executable)
 #include <WebCore/ContentSecurityPolicy.h>
 #endif
 
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+#include "WKDictionary.h"
+#include "ewk_web_application_icon_data_private.h"
+#endif
+
 #endif // #if OS(TIZEN)
 
 using namespace WebKit;
@@ -231,6 +236,7 @@ struct _Ewk_View_Private_Data {
     const char* encoding;
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     const char* webAppIconURL;
+    Eina_List* webAppIconURLs;
 #endif
 
     OwnPtr<Ewk_View_Callback_Context> alertContext;
@@ -381,6 +387,7 @@ struct _Ewk_View_Callback_Context {
     union {
         Ewk_Web_App_Capable_Get_Callback webAppCapableCallback;
         Ewk_Web_App_Icon_URL_Get_Callback webAppIconURLCallback;
+        Ewk_Web_App_Icon_URLs_Get_Callback webAppIconURLsCallback;
 #if ENABLE(TIZEN_WEB_STORAGE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
         Ewk_Web_Storage_Quota_Get_Callback webStorageQuotaCallback;
 #endif
@@ -1179,6 +1186,11 @@ static void _ewk_view_priv_del(Ewk_View_Private_Data* priv)
     eina_stringshare_del(priv->encoding);
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     eina_stringshare_del(priv->webAppIconURL);
+    if (priv->webAppIconURLs) {
+        void* data = 0;
+        EINA_LIST_FREE(priv->webAppIconURLs, data)
+            ewkWebAppIconDataDelete(static_cast<Ewk_Web_App_Icon_Data*>(data));
+    }
 #endif
 
     if (priv->authChallenge)
@@ -3140,6 +3152,7 @@ unsigned long ewkViewIsSearchProviderInstalled(Evas_Object* ewkView, const char*
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
 bool ewkViewGetStandaloneStatus(Evas_Object* ewkView)
 {
+    TIZEN_LOGI("webapp,metatag,standalone");
     bool standalone = true;
     evas_object_smart_callback_call(ewkView, "webapp,metatag,standalone", (void*)&standalone);
     return standalone;
@@ -4242,6 +4255,7 @@ static void didGetWebAppCapable(WKBooleanRef capable, WKErrorRef, void* context)
 
     ASSERT(webAppContext->webAppCapableCallback);
 
+    TIZEN_LOGI("webAppCapableCallback exist. capable(%b)", capable);
     if (capable)
         webAppContext->webAppCapableCallback(toImpl(capable)->value(), webAppContext->userData);
     else
@@ -4270,6 +4284,37 @@ static void didGetWebAppIconURL(WKStringRef iconURL, WKErrorRef, void* context)
 
     delete webAppContext;
 }
+
+static void didGetWebAppIconURLs(WKDictionaryRef iconURLs, WKErrorRef, void* context)
+{
+    EINA_SAFETY_ON_NULL_RETURN(iconURLs);
+    EINA_SAFETY_ON_NULL_RETURN(context);
+
+    Ewk_View_Callback_Context* webAppContext = static_cast<Ewk_View_Callback_Context*>(context);
+
+    EWK_VIEW_SD_GET_OR_RETURN(webAppContext->ewkView, smartData);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
+
+    ASSERT(webAppContext->webAppIconURLsCallback);
+
+    if (priv->webAppIconURLs) {
+        void* data = 0;
+        EINA_LIST_FREE(priv->webAppIconURLs, data)
+            ewkWebAppIconDataDelete(static_cast<Ewk_Web_App_Icon_Data*>(data));
+    }
+
+    WKRetainPtr<WKArrayRef> wkKeys(AdoptWK, WKDictionaryCopyKeys(iconURLs));
+    size_t iconURLCount = WKArrayGetSize(wkKeys.get());
+    for (size_t i = 0; i < iconURLCount; i++) {
+        WKStringRef urlRef = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
+        WKStringRef sizeRef = static_cast<WKStringRef>(WKDictionaryGetItemForKey(iconURLs, urlRef));
+        priv->webAppIconURLs = eina_list_append(priv->webAppIconURLs, ewkWebAppIconDataCreate(sizeRef, urlRef));
+    }
+    TIZEN_LOGI("webAppIconURLsCallback exist. found %d icon urls", iconURLCount);
+
+    webAppContext->webAppIconURLsCallback(priv->webAppIconURLs, webAppContext->userData);
+    delete webAppContext;
+}
 #endif
 
 Eina_Bool ewk_view_web_application_capable_get(Evas_Object* ewkView, Ewk_Web_App_Capable_Get_Callback callback, void* userData)
@@ -4279,6 +4324,7 @@ Eina_Bool ewk_view_web_application_capable_get(Evas_Object* ewkView, Ewk_Web_App
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
 
+    TIZEN_LOGI("callback(%d), userData(%d)", callback, userData);
     Ewk_View_Callback_Context* context = new Ewk_View_Callback_Context;
     context->webAppCapableCallback = callback;
     context->ewkView = ewkView;
@@ -4312,6 +4358,30 @@ Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* ewkView, Ewk_Web_Ap
 #endif
 }
 
+Eina_Bool ewk_view_web_application_icon_urls_get(Evas_Object* ewkView, Ewk_Web_App_Icon_URLs_Get_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+    EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
+
+    TIZEN_LOGI("callback(%d), userData(%d)", callback, userData);
+    Ewk_View_Callback_Context* context = new Ewk_View_Callback_Context;
+    context->webAppIconURLsCallback = callback;
+    context->ewkView = ewkView;
+    context->userData = userData;
+
+    WKPageGetWebAppIconURLs(toAPI(priv->pageClient->page()), context, didGetWebAppIconURLs);
+
+    return true;
+#else
+    UNUSED_PARAM(ewkView);
+    UNUSED_PARAM(callback);
+    UNUSED_PARAM(userData);
+    return 0;
+#endif
+}
+
 Eina_Bool ewk_view_command_execute(Evas_Object* ewkView, const char* command, const char* value)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
index 20056f7..63b837f 100644 (file)
 #include "ewk_enums.h"
 //#endif
 
+// #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+#include "ewk_web_application_icon_data.h"
+// #endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -235,6 +239,14 @@ typedef void (*Ewk_Web_App_Capable_Get_Callback)(Eina_Bool capable, void* user_d
  * @param user_data user_data will be passsed when ewk_view_web_app_icon_get is called
  */
 typedef void (*Ewk_Web_App_Icon_URL_Get_Callback)(const char* icon_url, void* user_data);
+
+/**
+ * Callback for ewk_view_web_app_icon_urls_get.
+ *
+ * @param icon_urls list of Ewk_Web_App_Icon_Data for web app
+ * @param user_data user_data will be passsed when ewk_view_web_app_icon_urls_get is called
+ */
+typedef void (*Ewk_Web_App_Icon_URLs_Get_Callback)(Eina_List *icon_urls, void *user_data);
 // #endif
 
 /**
@@ -1006,6 +1018,17 @@ EAPI Eina_Bool ewk_view_web_application_capable_get(Evas_Object* o, Ewk_Web_App_
 EAPI Eina_Bool ewk_view_web_application_icon_url_get(Evas_Object* o, Ewk_Web_App_Icon_URL_Get_Callback callback, void* user_data);
 
 /**
+ * Requests for getting web application icon list of Ewk_Web_App_Icon_Data.
+ *
+ * @param callback result callback to get web application icon urls
+ * @param user_data user_data will be passed when result_callback is called
+ *    -I.e., user data will be kept until callback is called
+ *
+ * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_view_web_application_icon_urls_get(Evas_Object *o, Ewk_Web_App_Icon_URLs_Get_Callback callback, void *user_data);
+
+/**
  * Executes editor command.
  *
  * @param o view object to execute command
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data.cpp
new file mode 100644 (file)
index 0000000..f649b4a
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "ewk_web_application_icon_data.h"
+
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+#include "WKString.h"
+#include <Eina.h>
+
+struct _Ewk_Web_App_Icon_Data {
+    CString size;
+    CString url;
+
+    _Ewk_Web_App_Icon_Data(WKStringRef sizeRef, WKStringRef urlRef)
+    {
+        size = toImpl(sizeRef)->string().utf8();
+        url = toImpl(urlRef)->string().utf8();
+    }
+};
+
+Ewk_Web_App_Icon_Data* ewkWebAppIconDataCreate(WKStringRef sizeRef, WKStringRef urlRef)
+{
+    return new Ewk_Web_App_Icon_Data(sizeRef, urlRef);
+}
+
+void ewkWebAppIconDataDelete(Ewk_Web_App_Icon_Data* iconData)
+{
+    delete iconData;
+}
+#endif
+
+EAPI const char* ewk_web_application_icon_data_size_get(Ewk_Web_App_Icon_Data* data)
+{
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+    EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
+
+    TIZEN_LOGI("size: %s", data->size.data());
+    return data->size.data();
+#else
+    UNUSED_PARAM(data);
+#endif
+}
+
+EAPI const char* ewk_web_application_icon_data_url_get(Ewk_Web_App_Icon_Data* data)
+{
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+    EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
+
+    TIZEN_LOGI("url: %s", data->url.data());
+    return data->url.data();
+#else
+    UNUSED_PARAM(data);
+#endif
+}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data.h b/Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data.h
new file mode 100644 (file)
index 0000000..b21819e
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ewk_web_application_icon_data_h
+#define ewk_web_application_icon_data_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// Creates a type name for _Ewk_Web_App_Icon_Data.
+typedef struct _Ewk_Web_App_Icon_Data Ewk_Web_App_Icon_Data;
+
+/**
+ * Requests for getting icon size string of Ewk_Web_App_Icon_Data.
+ *
+ * @param icon_data Ewk_Web_App_Icon_Data object to get icon size
+ *
+ * @return icon size string of requested icon data
+ */
+EAPI const char *ewk_web_application_icon_data_size_get(Ewk_Web_App_Icon_Data *data);
+
+/**
+ * Requests for getting icon url string of Ewk_Web_App_Icon_Data.
+ *
+ * @param icon_data Ewk_Web_App_Icon_Data object to get icon url
+ *
+ * @return icon url string of requested icon data
+ */
+EAPI const char *ewk_web_application_icon_data_url_get(Ewk_Web_App_Icon_Data *data);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_web_application_icon_data_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_web_application_icon_data_private.h
new file mode 100644 (file)
index 0000000..c894baa
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ewk_web_application_icon_data_private_h
+#define ewk_web_application_icon_data_private_h
+
+#if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+#include <WebKit2/WKBase.h>
+
+/// Creates a type name for _Ewk_Web_App_Icon_Data.
+typedef struct _Ewk_Web_App_Icon_Data Ewk_Web_App_Icon_Data;
+
+Ewk_Web_App_Icon_Data* ewkWebAppIconDataCreate(WKStringRef iconSize, WKStringRef iconURL);
+void ewkWebAppIconDataDelete(Ewk_Web_App_Icon_Data* iconData);
+
+#endif // ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
+
+#endif // ewk_web_application_icon_data_private_h
index 10ce9d9..44d5a3d 100755 (executable)
@@ -473,6 +473,7 @@ void WebPageProxy::close()
 
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     invalidateCallbackMap(m_booleanCallbacks);
+    invalidateCallbackMap(m_dictionaryCallbacks);
 #endif
     invalidateCallbackMap(m_voidCallbacks);
     invalidateCallbackMap(m_dataCallbacks);
@@ -2962,12 +2963,6 @@ void WebPageProxy::getWebAppCapable(PassRefPtr<BooleanCallback> prpCallback)
 void WebPageProxy::didGetWebAppCapable(const bool capable, uint64_t callbackID)
 {
     RefPtr<BooleanCallback> callback = m_booleanCallbacks.take(callbackID);
-    if (!callback) {
-        // FIXME: Log error or assert.
-        // this can validly happen if a load invalidated the callback, though
-        return;
-    }
-
     m_booleanCallbacks.remove(callbackID);
     callback->performCallbackWithReturnValue(WebBoolean::create(capable).leakRef());
 }
@@ -2997,6 +2992,30 @@ void WebPageProxy::didGetWebAppIconURL(const String& iconURL, uint64_t callbackI
     m_stringCallbacks.remove(callbackID);
     callback->performCallbackWithReturnValue(iconURL.impl());
 }
+
+void WebPageProxy::getWebAppIconURLs(PassRefPtr<DictionaryCallback> prpCallback)
+{
+    RefPtr<DictionaryCallback> callback = prpCallback;
+    if (!isValid()) {
+        callback->invalidate();
+        return;
+    }
+
+    uint64_t callbackID = callback->callbackID();
+    m_dictionaryCallbacks.set(callbackID, callback.get());
+    process()->send(Messages::WebPage::GetWebAppIconURLs(callbackID), m_pageID);
+}
+
+void WebPageProxy::didGetWebAppIconURLs(const StringPairVector& iconURLs, uint64_t callbackID)
+{
+    RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
+    ImmutableDictionary::MapType iconURLList;
+    size_t iconURLCount = iconURLs.stringPairVector().size();
+    for (size_t i = 0; i < iconURLCount; ++i)
+        iconURLList.set(iconURLs.stringPairVector()[i].first, WebString::create(iconURLs.stringPairVector()[i].second));
+
+    callback->performCallbackWithReturnValue(ImmutableDictionary::adopt(iconURLList).get());
+}
 #endif
 
 void WebPageProxy::setMediaVolume(float volume)
@@ -4072,6 +4091,7 @@ void WebPageProxy::processDidCrash()
 
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     invalidateCallbackMap(m_booleanCallbacks);
+    invalidateCallbackMap(m_dictionaryCallbacks);
 #endif
     invalidateCallbackMap(m_voidCallbacks);
     invalidateCallbackMap(m_dataCallbacks);
index e18efbf..fa89756 100755 (executable)
@@ -206,6 +206,7 @@ typedef GenericCallback<WKStringRef, StringImpl*> StringCallback;
 typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback;
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
 typedef GenericCallback<WKBooleanRef> BooleanCallback;
+typedef GenericCallback<WKDictionaryRef> DictionaryCallback;
 #endif
 #if ENABLE(TIZEN_WEB_STORAGE)
 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
@@ -903,6 +904,7 @@ void recordingSurfaceSetEnableSet(bool enable);
     void getStandaloneStatus(bool& standalone);
     void getWebAppCapable(PassRefPtr<BooleanCallback>);
     void getWebAppIconURL(PassRefPtr<StringCallback>);
+    void getWebAppIconURLs(PassRefPtr<DictionaryCallback>);
 #endif
 
     void setMediaVolume(float);
@@ -1181,6 +1183,7 @@ private:
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     void didGetWebAppCapable(const bool capable, uint64_t callbackID);
     void didGetWebAppIconURL(const String& iconURL, uint64_t callbackID);
+    void didGetWebAppIconURLs(const StringPairVector& iconURLs, uint64_t callbackID);
 #endif
 #if ENABLE(TIZEN_ICON_DATABASE)
     void didReceiveIcon();
@@ -1406,6 +1409,7 @@ private:
 
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     HashMap<uint64_t, RefPtr<BooleanCallback> > m_booleanCallbacks;
+    HashMap<uint64_t, RefPtr<DictionaryCallback> > m_dictionaryCallbacks;
 #endif
     HashMap<uint64_t, RefPtr<VoidCallback> > m_voidCallbacks;
     HashMap<uint64_t, RefPtr<DataCallback> > m_dataCallbacks;
index 822ef4e..3878e96 100755 (executable)
@@ -133,6 +133,7 @@ messages -> WebPageProxy {
     GetStandaloneStatus() -> (bool standalone)
     DidGetWebAppCapable(bool capable, uint64_t callbackID)
     DidGetWebAppIconURL(WTF::String iconURL, uint64_t callbackID)
+    DidGetWebAppIconURLs(WebKit::StringPairVector iconURLs, uint64_t callbackID)
 #endif
 
 #if ENABLE(TIZEN_ICON_DATABASE)
index 60f45c5..1e978b1 100755 (executable)
@@ -3541,6 +3541,20 @@ void WebPage::getWebAppIconURL(uint64_t callbackID)
 
     send(Messages::WebPageProxy::DidGetWebAppIconURL(iconURL, callbackID));
 }
+
+void WebPage::getWebAppIconURLs(uint64_t callbackID)
+{
+    RefPtr<WebCore::NodeList> nodeList = mainFrame()->document()->getElementsByTagName("link");
+    Vector<std::pair<String, String> > iconURLs;
+
+    for (unsigned i = 0; i < nodeList->length(); i++) {
+        WebCore::HTMLLinkElement* linkElement = static_cast<WebCore::HTMLLinkElement*>(nodeList->item(i));
+        if (linkElement->rel() == "apple-touch-icon" || linkElement->rel() == "apple-touch-icon-precomposed")
+            iconURLs.append(pair<String, String>(linkElement->href().string(), linkElement->iconSizes()));
+    }
+
+    send(Messages::WebPageProxy::DidGetWebAppIconURLs(iconURLs, callbackID));
+}
 #endif
 
 void WebPage::setMediaVolume(float volume)
index 44eaa42..3e5f4fd 100755 (executable)
@@ -650,6 +650,7 @@ public:
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     void getWebAppCapable(uint64_t callbackID);
     void getWebAppIconURL(uint64_t callbackID);
+    void getWebAppIconURLs(uint64_t callbackID);
 #endif
 
     void setMediaVolume(float);
index 2d10c5e..a684281 100755 (executable)
@@ -268,6 +268,7 @@ messages -> WebPage {
 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
     GetWebAppCapable(uint64_t callbackID)
     GetWebAppIconURL(uint64_t callbackID)
+    GetWebAppIconURLs(uint64_t callbackID)
 #endif
 
     # Media