From 9577d4fee6358021e6422386fdf38e26b40d6191 Mon Sep 17 00:00:00 2001 From: Changhyup Jwa Date: Thu, 23 Aug 2012 11:38:59 +0900 Subject: [PATCH] Remove deprecated old Reader code [Title] Remove deprecated old Reader code [Issue#] N/A [Problem] Deprecated [Cause] It was remained for browser build only. WebKit's Reader API is not used in browser anymore. [Solution] Remove Reader API set Conflicts: Source/WebKit2/UIProcess/API/efl/ewk_view.cpp Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp Source/WebKit2/WebProcess/WebPage/WebPage.h Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp Change-Id: I59be0f6e3c6fba5bf9df44388c07746c4f2e67c8 --- Source/WTF/wtf/Platform.h | 1 - Source/WebKit/efl/ewk/ewk_view.cpp | 47 ----------------- Source/WebKit/efl/ewk/ewk_view.h | 15 ------ .../UIProcess/API/C/efl/tizen/WKPageTizen.cpp | 7 --- .../UIProcess/API/C/efl/tizen/WKPageTizen.h | 4 -- Source/WebKit2/UIProcess/API/efl/ewk_view.cpp | 60 ---------------------- Source/WebKit2/UIProcess/API/efl/ewk_view.h | 27 ---------- .../WebKit2/UIProcess/API/efl/ewk_view_private.h | 2 +- Source/WebKit2/UIProcess/WebPageProxy.cpp | 6 --- Source/WebKit2/UIProcess/WebPageProxy.h | 10 ---- Source/WebKit2/UIProcess/WebPageProxy.messages.in | 3 -- Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp | 35 ------------- Source/WebKit2/WebProcess/WebPage/WebPage.h | 4 -- .../WebKit2/WebProcess/WebPage/WebPage.messages.in | 4 -- .../WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp | 6 --- 15 files changed, 1 insertion(+), 230 deletions(-) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index e5f71db..9c9be9d 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -331,7 +331,6 @@ #define ENABLE_TIZEN_MEMORY_CONTROLLER 1 /* Krzysztof Czech(k.czech@samsung.com) : */ #define ENABLE_TIZEN_SUPPORT_RSS_LINK_PARSING 1 /* Jaesick Chang(jaesik.chang@samsung.com), Ryuan Choi(ryuan.choi@samsung.com) (WebKit1), KueHwan Sihn, Eunmi Lee(eunmi15.lee@samsung.com) (WebKit2): RSS Link Parsing patches */ #define ENABLE_TIZEN_EDITABLE_LINK_ACTIVE_SET 1 /* Who is owner ? */ -#define ENABLE_TIZEN_READER 1 /* Changhyup Jwa(ch.jwa@samsung.com) : Reader feature */ #define ENABLE_TIZEN_TEXT_ENCODING 1 /* Łukasz Ślachciak(l.slachciak@samsung.com) : */ #define ENABLE_TIZEN_DROPDOWN_SUPPORT 1 /* Gyuyoung Kim(gyuyoung.kim@samsung.com) : */ #define ENABLE_TIZEN_WEAK_ZOOM_VIEWPORT 1 /* JungJik Lee(jungjik.lee@samsung.com) */ diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index e672505..0802b33 100755 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -514,9 +514,6 @@ struct _Ewk_View_Private_Data { #if ENABLE(TIZEN_GEOLOCATION) Eina_Bool geolocation:1; #endif -#if ENABLE(TIZEN_READER) - Eina_Bool enableReader: 1; -#endif #if ENABLE(TIZEN_EDITABLE_LINK_ACTIVE_SET) Eina_Bool editableLinkBehavior:1; #endif @@ -1276,9 +1273,6 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) priv->settings.domTimerInterval = priv->pageSettings->defaultMinDOMTimerInterval(); -#if ENABLE(TIZEN_READER) - priv->settings.enableReader = true; -#endif #if ENABLE(TIZEN_PLUGIN_PARENT_WINDOW) priv->settings.parentWindow = 0; #endif @@ -6231,33 +6225,6 @@ Eina_Bool ewk_view_setting_custom_header_add(Evas_Object* ewkView, const char* n #endif } -Eina_Bool ewk_view_setting_enable_reader_get(const Evas_Object* ewkView) -{ -#if ENABLE(TIZEN_READER) - EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false); - EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); - return priv->settings.enableReader; -#else - LOG_ERROR("TIZEN_READER is disabled. \n"); - return false; -#endif -} - -Eina_Bool ewk_view_setting_enable_reader_set(Evas_Object* ewkView, Eina_Bool enable) -{ -#if ENABLE(TIZEN_READER) - EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false); - EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); - enable = !!enable; - if (priv->settings.enableReader != enable) - priv->settings.enableReader = enable; - return true; -#else - LOG_ERROR("TIZEN_READER is disabled. \n"); - return false; -#endif -} - /** * Get amount of plugins * @@ -6921,20 +6888,6 @@ ewk_view_smart_selection_rect_get(Evas_Object* ewkView, int x, int y, Eina_Recta return false; } -Eina_Bool -ewk_view_reader_article_get(Evas_Object* ewkView, char** url, char** html) -{ -#if ENABLE(TIZEN_READER) - EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false); - EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); - - return false; -#else - LOG_ERROR("TIZEN_READER is disabled. \n"); - return false; -#endif -} - void ewk_view_screenshot_contents(const Evas_Object* ewkView, cairo_t* cr, const Eina_Rectangle* area) { #if ENABLE(TIZEN_EFL_EXT_API) diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h index 18e30b8..80cfa27 100755 --- a/Source/WebKit/efl/ewk/ewk_view.h +++ b/Source/WebKit/efl/ewk/ewk_view.h @@ -2320,21 +2320,6 @@ EAPI Eina_Bool ewk_view_setting_encoding_detector_set(Evas_Object *o, Eina_Bo EAPI Eina_Bool ewk_view_setting_editable_link_active_set(Evas_Object *o, Eina_Bool clickable); /* #endif */ -/* #if ENABLE(TIZEN_READER) */ -EINA_DEPRECATED EAPI Eina_Bool ewk_view_setting_enable_reader_get(const Evas_Object *o); -EINA_DEPRECATED EAPI Eina_Bool ewk_view_setting_enable_reader_set(Evas_Object *o, Eina_Bool enable); -/** - * Call Reader::showArticle() and get the result of article extraction - * - * @param o view object to get scaled bounding box value - * @param url url string which is newly allocated - should be freed by caller - * @param html article html string which is newly allocated - should be freed by caller - * - * @return EINA_TRUE if article extracted successfully - */ -EAPI Eina_Bool ewk_view_reader_article_get(Evas_Object *o, char **url, char **html); -/* #endif */ - /* #if ENABLE(TIZEN_GEOLOCATION) */ /** * Gets if the geolocation feature is enabled. diff --git a/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.cpp b/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.cpp index 8b40ba3..b3e47e4 100755 --- a/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.cpp +++ b/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.cpp @@ -120,13 +120,6 @@ void WKPageGetWebAppIconURL(WKPageRef page, void* context, WKPageGetWebAppIconUR #endif } -void WKPageCheckReaderArticle(WKPageRef page, void* context, WKPageGetReaderFunction callback) -{ -#if ENABLE(TIZEN_READER) - toImpl(page)->checkPageForReader(DictionaryCallback::create(context, callback)); -#endif -} - void WKPageExecuteCommandWithArgument(WKPageRef page, WKStringRef command, WKStringRef argument) { toImpl(page)->executeEditCommandWithArgument(toImpl(command)->string(), toImpl(argument)->string()); diff --git a/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.h b/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.h index 7717b55..ad9bc8c 100755 --- a/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.h +++ b/Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.h @@ -113,10 +113,6 @@ typedef void (*WKPageGetWebAppIconURLFunction)(WKStringRef iconURL, WKErrorRef, WK_EXPORT void WKPageGetWebAppIconURL(WKPageRef page, void* context, WKPageGetWebAppIconURLFunction function); // #endif -/* WK2 Reader APIs and callback */ -typedef void (*WKPageGetReaderFunction)(WKDictionaryRef reader, WKErrorRef error, void* functionContext); -WK_EXPORT void WKPageCheckReaderArticle(WKPageRef page, void* context, WKPageGetReaderFunction callback); - WK_EXPORT void WKPageExecuteCommandWithArgument(WKPageRef page, WKStringRef command, WKStringRef argument); #ifdef __cplusplus diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index e894d35..3a53df9 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -106,10 +106,6 @@ #include "ewk_view_notification_provider.h" #endif -#if ENABLE(TIZEN_READER) -#include "WKDictionary.h" -#endif - #if ENABLE(TIZEN_WEBKIT2_POPUP) #include "WebPopupItem.h" #include "WebPopupMenuProxyEfl.h" @@ -290,9 +286,6 @@ struct _Ewk_View_Callback_Context { Ewk_View_Rss_Items_Get_Callback rssItemsGetCallback; Ewk_Web_App_Capable_Get_Callback webAppCapableCallback; Ewk_Web_App_Icon_URL_Get_Callback webAppIconURLCallback; -#if ENABLE(TIZEN_READER) - Ewk_View_Reader_Callback readerCallback; -#endif // #if ENABLE(TIZEN_READER) #if ENABLE(TIZEN_WEB_STORAGE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT) Ewk_Web_Storage_Quota_Get_Callback webStorageQuotaCallback; #endif @@ -2468,59 +2461,6 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView) return true; } -#if ENABLE(TIZEN_READER) -static void getReaderCallback(WKDictionaryRef reader, WKErrorRef error, void* functionContext) -{ - EINA_SAFETY_ON_NULL_RETURN(functionContext); - Ewk_View_Callback_Context* context = static_cast(functionContext); - - if (!reader || error) { - delete context; - return; - } - - WKRetainPtr urlKey(AdoptWK, WKStringCreateWithUTF8CString("url")); - WKRetainPtr htmlKey(AdoptWK, WKStringCreateWithUTF8CString("html")); - WKStringRef urlString = static_cast(WKDictionaryGetItemForKey(reader, urlKey.get())); - WKStringRef htmlString = static_cast(WKDictionaryGetItemForKey(reader, htmlKey.get())); - ASSERT(urlString); - ASSERT(htmlString); - - int htmlLength = WKStringGetMaximumUTF8CStringSize(htmlString); - ASSERT(htmlLength); - OwnArrayPtr html = adoptArrayPtr(new char[htmlLength]); - WKStringGetUTF8CString(htmlString, html.get(), htmlLength); - - ASSERT(context->readerCallback); - - int urlLength = WKStringGetMaximumUTF8CStringSize(urlString); - if (urlLength) { - OwnArrayPtr url = adoptArrayPtr(new char[urlLength]); - WKStringGetUTF8CString(urlString, url.get(), urlLength); - context->readerCallback(context->ewkView, url.get(), html.get(), context->userData); - } else { - context->readerCallback(context->ewkView, "", html.get(), context->userData); - } - - delete context; -} -#endif - -void ewk_view_reader_article_check(Evas_Object* ewkView, Ewk_View_Reader_Callback callback, void* userData) -{ -#if ENABLE(TIZEN_READER) - EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); - EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); - EINA_SAFETY_ON_NULL_RETURN(callback); - - Ewk_View_Callback_Context* context = new Ewk_View_Callback_Context; - context->readerCallback = callback; - context->ewkView = ewkView; - context->userData = userData; - WKPageCheckReaderArticle(toAPI(priv->pageClient->page()), context, getReaderCallback); -#endif -} - #if ENABLE(TIZEN_WEBKIT2_TILED_AC) void ewk_view_mark_for_sync(Evas_Object* ewkView) { diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h index fcd28a0..b3f71c9 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h @@ -241,9 +241,6 @@ struct _Ewk_Popup_Menu_Item { //#endif // #if OS(TIZEN) -// #if ENABLE(TIZEN_READER) -typedef struct _Ewk_View_Reader_Data Ewk_View_Reader_Data; -// #endif // #if ENABLE(TIZEN_MM_PLAYER) typedef struct _Ewk_View_Html5_Video_Data Ewk_View_Html5_Video_Data; // #endif @@ -392,18 +389,6 @@ typedef enum _Ewk_Http_Method Ewk_Http_Method; */ typedef void (*Ewk_View_Rss_Items_Get_Callback)(Evas_Object* o, const Eina_List* items, void* user_data); -// #if ENABLE(TIZEN_READER) -/** - * @brief ewk_view reader callback. - * - * @param o view object to get reader article - * @param url base url of reader article - * @param html reader article - * @param user_data user data - */ -typedef void (*Ewk_View_Reader_Callback)(Evas_Object* o, const char* url, const char* html, void* user_data); -// #endif - /** * \enum EwkFindOptions * @brief Provides option to find word @@ -592,18 +577,6 @@ EAPI double ewk_view_text_zoom_get(const Evas_Object* o); */ EAPI Eina_Bool ewk_view_text_zoom_set(Evas_Object* o, double text_zoom_factor); -// #if ENABLE(TIZEN_READER) -/** - * Checks it is possible to parse article html for reader in the current webpage. - * If it is possible to parse reader article, it calls callback with parsed html. - * - * @param o view object to check reader article - * @param callback callback to get reader article - * @param user_data user data - */ -EAPI void ewk_view_reader_article_check(Evas_Object* o, Ewk_View_Reader_Callback callback, void* user_data); -// #endif - EAPI void ewk_view_suspend(Evas_Object* o); EAPI void ewk_view_resume(Evas_Object* o); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h index ecd05ab..766c57e 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h @@ -30,7 +30,7 @@ #include "PlatformString.h" #endif -#if ENABLE(TIZEN_READER) || ENABLE(TIZEN_MM_PLAYER) +#if ENABLE(TIZEN_MM_PLAYER) #include "WKString.h" #endif diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp index 19c4fc6..214614a 100755 --- a/Source/WebKit2/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp @@ -441,9 +441,6 @@ void WebPageProxy::close() #if PLATFORM(GTK) invalidateCallbackMap(m_printFinishedCallbacks); #endif -#if ENABLE(TIZEN_READER) - invalidateCallbackMap(m_dictionaryCallbacks); -#endif Vector editCommandVector; copyToVector(m_editCommandSet, editCommandVector); @@ -3705,9 +3702,6 @@ void WebPageProxy::processDidCrash() #if PLATFORM(GTK) invalidateCallbackMap(m_printFinishedCallbacks); #endif -#if ENABLE(TIZEN_READER) - invalidateCallbackMap(m_dictionaryCallbacks); -#endif Vector editCommandVector; copyToVector(m_editCommandSet, editCommandVector); diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index 7421d03..6967765 100755 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -178,9 +178,6 @@ typedef GenericCallback BooleanCallback; typedef GenericCallback WebStorageQuotaCallback; #endif #endif -#if ENABLE(TIZEN_READER) -typedef GenericCallback DictionaryCallback; -#endif #if PLATFORM(GTK) typedef GenericCallback PrintFinishedCallback; @@ -834,10 +831,6 @@ public: #endif void printMainFrame(); -#if ENABLE(TIZEN_READER) -void checkPageForReader(PassRefPtr); -void showReaderForArticle(const String& readerUrl, const String& readerHtml, uint64_t callbackID); -#endif #if ENABLE(TIZEN_RECORDING_SURFACE_SET) void recordingSurfaceSetEnableSet(bool enable); @@ -1262,9 +1255,6 @@ private: #if ENABLE(TIZEN_WEB_STORAGE) HashMap > m_quotaCallbacks; #endif -#if ENABLE(TIZEN_READER) - HashMap > m_dictionaryCallbacks; -#endif HashSet m_editCommandSet; diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in index d8466ad..4a65281 100755 --- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in @@ -373,9 +373,6 @@ messages -> WebPageProxy { SaveRecentSearches(WTF::String name, Vector searchItems) LoadRecentSearches(WTF::String name) -> (Vector result) -#if ENABLE(TIZEN_READER) - ShowReaderForArticle(WTF::String readerUrl, WTF::String readerHtml, uint64_t callbackID) -#endif #if ENABLE(TIZEN_WEBKIT_PASTEBOARD) WriteDataToClipboardWithType(WTF::String data, uint64_t type) #endif diff --git a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp index 521b00f..8f5f3eb 100755 --- a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp @@ -46,9 +46,6 @@ #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2) #include "WebContextMenuProxy.h" #endif -#if ENABLE(TIZEN_READER) -#include "MutableDictionary.h" -#endif using namespace WebCore; #endif @@ -385,38 +382,6 @@ void WebPageProxy::updateScrollbar(const IntPoint& scrollPosition) } #endif -#if ENABLE(TIZEN_READER) -void WebPageProxy::checkPageForReader(PassRefPtr prpCallback) -{ - RefPtr callback = prpCallback; - if (!isValid()) { - callback->invalidate(); - return; - } - - uint64_t callbackID = callback->callbackID(); - m_dictionaryCallbacks.set(callbackID, callback.get()); - process()->send(Messages::WebPage::CheckPageForReader(callbackID), m_pageID); -} - -void WebPageProxy::showReaderForArticle(const String& readerUrl, const String& readerHtml, uint64_t callbackID) -{ - RefPtr callback = m_dictionaryCallbacks.take(callbackID); - if (!callback) - return; - - if (readerHtml.isEmpty()) { - callback->performCallbackWithReturnValue(0); - return; - } - - RefPtr readerData = MutableDictionary::create(); - readerData->set("url", RefPtr(WebString::create(readerUrl)).get()); - readerData->set("html", RefPtr(WebString::create(readerHtml)).get()); - callback->performCallbackWithReturnValue(readerData.get()); -} -#endif - void WebPageProxy::initializeTizenClient(const WKPageTizenClient* client) { m_tizenClient.initialize(client); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 568dcb2..34042ff 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -666,10 +666,6 @@ public: void getFocusedInputElementDataList(Vector&); #endif -#if ENABLE(TIZEN_READER) - void checkPageForReader(uint64_t callbackID); -#endif - #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL) void scrollOverflow(const WebCore::FloatPoint&, bool& scrolled); void setPressedNodeAtPoint(const WebCore::IntPoint&, bool& pressed); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 1958f71..1d37813 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -356,10 +356,6 @@ messages -> WebPage { GetFocusedInputElementDataList() -> (Vector options) #endif -#if ENABLE(TIZEN_READER) - CheckPageForReader(uint64_t callbackID) -#endif - #if ENABLE(TIZEN_RECORDING_SURFACE_SET) RecordingSurfaceSetEnableSet(bool enable) #endif diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index ef09c8b..b64a9a5 100755 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -613,12 +613,6 @@ void WebPage::getFocusedInputElementDataList(Vector& optionList) } #endif -#if ENABLE(TIZEN_READER) -void WebPage::checkPageForReader(uint64_t callbackID) -{ -} -#endif - #if ENABLE(TIZEN_WEBKIT2_HIT_TEST) #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) static IntRect getFocusedRect(HitTestResult hitTestResult, Page* page) -- 2.7.4