Remove deprecated old Reader code
authorChanghyup Jwa <ch.jwa@samsung.com>
Thu, 23 Aug 2012 02:38:59 +0000 (11:38 +0900)
committerJongseok Yang <js45.yang@samsung.com>
Thu, 30 Aug 2012 04:41:30 +0000 (13:41 +0900)
[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

15 files changed:
Source/WTF/wtf/Platform.h
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/efl/ewk/ewk_view.h
Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.cpp
Source/WebKit2/UIProcess/API/C/efl/tizen/WKPageTizen.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view.h
Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index e5f71db..9c9be9d 100644 (file)
 #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) */
index e672505..0802b33 100755 (executable)
@@ -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)
index 18e30b8..80cfa27 100755 (executable)
@@ -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.
index 8b40ba3..b3e47e4 100755 (executable)
@@ -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());
index 7717b55..ad9bc8c 100755 (executable)
@@ -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
index e894d35..3a53df9 100755 (executable)
 #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<Ewk_View_Callback_Context*>(functionContext);
-
-    if (!reader || error) {
-        delete context;
-        return;
-    }
-
-    WKRetainPtr<WKStringRef> urlKey(AdoptWK, WKStringCreateWithUTF8CString("url"));
-    WKRetainPtr<WKStringRef> htmlKey(AdoptWK, WKStringCreateWithUTF8CString("html"));
-    WKStringRef urlString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(reader, urlKey.get()));
-    WKStringRef htmlString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(reader, htmlKey.get()));
-    ASSERT(urlString);
-    ASSERT(htmlString);
-
-    int htmlLength = WKStringGetMaximumUTF8CStringSize(htmlString);
-    ASSERT(htmlLength);
-    OwnArrayPtr<char> html = adoptArrayPtr(new char[htmlLength]);
-    WKStringGetUTF8CString(htmlString, html.get(), htmlLength);
-
-    ASSERT(context->readerCallback);
-
-    int urlLength = WKStringGetMaximumUTF8CStringSize(urlString);
-    if (urlLength) {
-        OwnArrayPtr<char> 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)
 {
index fcd28a0..b3f71c9 100755 (executable)
@@ -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);
 
index ecd05ab..766c57e 100755 (executable)
@@ -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
 
index 19c4fc6..214614a 100755 (executable)
@@ -441,9 +441,6 @@ void WebPageProxy::close()
 #if PLATFORM(GTK)
     invalidateCallbackMap(m_printFinishedCallbacks);
 #endif
-#if ENABLE(TIZEN_READER)
-    invalidateCallbackMap(m_dictionaryCallbacks);
-#endif
 
     Vector<WebEditCommandProxy*> 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<WebEditCommandProxy*> editCommandVector;
     copyToVector(m_editCommandSet, editCommandVector);
index 7421d03..6967765 100755 (executable)
@@ -178,9 +178,6 @@ typedef GenericCallback<WKBooleanRef> BooleanCallback;
 typedef GenericCallback<WKUInt32Ref> WebStorageQuotaCallback;
 #endif
 #endif
-#if ENABLE(TIZEN_READER)
-typedef GenericCallback<WKDictionaryRef> DictionaryCallback;
-#endif
 
 #if PLATFORM(GTK)
 typedef GenericCallback<WKErrorRef> PrintFinishedCallback;
@@ -834,10 +831,6 @@ public:
 #endif
 
     void printMainFrame();
-#if ENABLE(TIZEN_READER)
-void checkPageForReader(PassRefPtr<DictionaryCallback>);
-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<uint64_t, RefPtr<WebStorageQuotaCallback> > m_quotaCallbacks;
 #endif
-#if ENABLE(TIZEN_READER)
-    HashMap<uint64_t, RefPtr<DictionaryCallback> > m_dictionaryCallbacks;
-#endif
 
     HashSet<WebEditCommandProxy*> m_editCommandSet;
 
index d8466ad..4a65281 100755 (executable)
@@ -373,9 +373,6 @@ messages -> WebPageProxy {
     SaveRecentSearches(WTF::String name, Vector<String> searchItems)
     LoadRecentSearches(WTF::String name) -> (Vector<String> 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
index 521b00f..8f5f3eb 100755 (executable)
@@ -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<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::CheckPageForReader(callbackID), m_pageID);
-}
-
-void WebPageProxy::showReaderForArticle(const String& readerUrl, const String& readerHtml, uint64_t callbackID)
-{
-    RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
-    if (!callback)
-        return;
-
-    if (readerHtml.isEmpty()) {
-        callback->performCallbackWithReturnValue(0);
-        return;
-    }
-
-    RefPtr<MutableDictionary> readerData = MutableDictionary::create();
-    readerData->set("url", RefPtr<WebString>(WebString::create(readerUrl)).get());
-    readerData->set("html", RefPtr<WebString>(WebString::create(readerHtml)).get());
-    callback->performCallbackWithReturnValue(readerData.get());
-}
-#endif
-
 void WebPageProxy::initializeTizenClient(const WKPageTizenClient* client)
 {
     m_tizenClient.initialize(client);
index 568dcb2..34042ff 100755 (executable)
@@ -666,10 +666,6 @@ public:
     void getFocusedInputElementDataList(Vector<String>&);
 #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);
index 1958f71..1d37813 100755 (executable)
@@ -356,10 +356,6 @@ messages -> WebPage {
     GetFocusedInputElementDataList() -> (Vector<WTF::String> options)
 #endif
 
-#if ENABLE(TIZEN_READER)
-    CheckPageForReader(uint64_t callbackID)
-#endif
-
 #if ENABLE(TIZEN_RECORDING_SURFACE_SET)
     RecordingSurfaceSetEnableSet(bool enable)
 #endif
index ef09c8b..b64a9a5 100755 (executable)
@@ -613,12 +613,6 @@ void WebPage::getFocusedInputElementDataList(Vector<String>& 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)