[WK2] Support multiple URLs for WebApp meta tag
[framework/web/webkit-efl.git] / Source / WebKit2 / WebProcess / WebPage / WebPage.cpp
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)