Changeset 127422 in webkit


Ignore:
Timestamp:
Sep 3, 2012 7:48:45 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Add ewk_settings.
https://bugs.webkit.org/show_bug.cgi?id=91206

Patch by Eunmi Lee <eunmi15.lee@samsung.com> on 2012-09-03
Reviewed by Gyuyoung Kim.

Add the ewk_settings which wraps the WKPreferencesRef.
The ewk_settings will be created by the ewk_view and it will be
destroyed when the ewk_view is destroyed. I make each view to have
its own group to make one ewk_settings sets preferences only for
one ewk_view.
The application can get the ewk_settings from ewk_view using
ewk_view_settings_get() API.

  • UIProcess/API/efl/EWebKit2.h:
  • UIProcess/API/efl/ewk_settings.cpp: Added.

(ewk_settings_enable_scripts_set):
(ewk_settings_enable_scripts_get):
(ewk_settings_auto_load_images_set):
(ewk_settings_auto_load_images_get):

  • UIProcess/API/efl/ewk_settings.h: Added.
  • UIProcess/API/efl/ewk_settings_private.h: Added.

(_Ewk_Settings):
(_Ewk_Settings::_Ewk_Settings):

  • UIProcess/API/efl/ewk_view.cpp:

(_Ewk_View_Private_Data):
(_ewk_view_initialize):
(ewk_view_settings_get):

  • UIProcess/API/efl/ewk_view.h:
  • UIProcess/API/efl/tests/test_ewk2_settings.cpp: Added.

(TEST_F):

  • UIProcess/API/efl/tests/test_ewk2_view.cpp:

(TEST_F):

Location:
trunk/Source/WebKit2
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r127420 r127422  
     12012-09-03  Eunmi Lee  <eunmi15.lee@samsung.com>
     2
     3        [EFL][WK2] Add ewk_settings.
     4        https://bugs.webkit.org/show_bug.cgi?id=91206
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Add the ewk_settings which wraps the WKPreferencesRef.
     9        The ewk_settings will be created by the ewk_view and it will be
     10        destroyed when the ewk_view is destroyed. I make each view to have
     11        its own group to make one ewk_settings sets preferences only for
     12        one ewk_view.
     13        The application can get the ewk_settings from ewk_view using
     14        ewk_view_settings_get() API.
     15
     16        * UIProcess/API/efl/EWebKit2.h:
     17        * UIProcess/API/efl/ewk_settings.cpp: Added.
     18        (ewk_settings_enable_scripts_set):
     19        (ewk_settings_enable_scripts_get):
     20        (ewk_settings_auto_load_images_set):
     21        (ewk_settings_auto_load_images_get):
     22        * UIProcess/API/efl/ewk_settings.h: Added.
     23        * UIProcess/API/efl/ewk_settings_private.h: Added.
     24        (_Ewk_Settings):
     25        (_Ewk_Settings::_Ewk_Settings):
     26        * UIProcess/API/efl/ewk_view.cpp:
     27        (_Ewk_View_Private_Data):
     28        (_ewk_view_initialize):
     29        (ewk_view_settings_get):
     30        * UIProcess/API/efl/ewk_view.h:
     31        * UIProcess/API/efl/tests/test_ewk2_settings.cpp: Added.
     32        (TEST_F):
     33        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
     34        (TEST_F):
     35
    1362012-09-03  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    237
  • trunk/Source/WebKit2/PlatformEfl.cmake

    r127195 r127422  
    6161    UIProcess/API/efl/ewk_navigation_policy_decision.cpp
    6262    UIProcess/API/efl/ewk_popup_menu_item.cpp
     63    UIProcess/API/efl/ewk_settings.cpp
    6364    UIProcess/API/efl/ewk_url_request.cpp
    6465    UIProcess/API/efl/ewk_url_response.cpp
     
    215216    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_navigation_policy_decision.h"
    216217    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu_item.h"
     218    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_settings.h"
    217219    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_request.h"
    218220    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_response.h"
     
    280282    test_ewk2_eina_shared_string
    281283    test_ewk2_intents
     284    test_ewk2_settings
    282285    test_ewk2_view
    283286)
  • trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h

    r126866 r127422  
    4040#include "ewk_navigation_policy_decision.h"
    4141#include "ewk_popup_menu_item.h"
     42#include "ewk_settings.h"
    4243#include "ewk_url_request.h"
    4344#include "ewk_url_response.h"
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

    r127390 r127422  
    3333#include "WKURL.h"
    3434#include "WebContext.h"
     35#include "WebPageGroup.h"
    3536#include "WebPopupItem.h"
    3637#include "WebPopupMenuProxyEfl.h"
     
    4243#include "ewk_popup_menu_item_private.h"
    4344#include "ewk_private.h"
     45#include "ewk_settings_private.h"
    4446#include "ewk_view_find_client_private.h"
    4547#include "ewk_view_form_client_private.h"
     
    5456#include <WebCore/Cursor.h>
    5557#include <WebCore/EflScreenUtilities.h>
     58#include <WebKit2/WKPageGroup.h>
    5659#include <wtf/text/CString.h>
    5760
     
    8992    LoadingResourcesMap loadingResourcesMap;
    9093    Ewk_Back_Forward_List* backForwardList;
     94    OwnPtr<Ewk_Settings> settings;
    9195
    9296    WebPopupMenuProxyEfl* popupMenuProxy;
     
    686690    priv->pageClient = PageClientImpl::create(ewkView);
    687691
    688     priv->pageProxy = toImpl(ewk_context_WKContext_get(context))->createWebPage(priv->pageClient.get(), toImpl(pageGroupRef));
     692    if (pageGroupRef)
     693        priv->pageProxy = toImpl(ewk_context_WKContext_get(context))->createWebPage(priv->pageClient.get(), toImpl(pageGroupRef));
     694    else
     695        priv->pageProxy = toImpl(ewk_context_WKContext_get(context))->createWebPage(priv->pageClient.get(), WebPageGroup::create().get());
    689696#if USE(COORDINATED_GRAPHICS)
    690697    priv->pageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
     
    695702
    696703    priv->backForwardList = ewk_back_forward_list_new(toAPI(priv->pageProxy->backForwardList()));
     704    priv->settings = adoptPtr(new Ewk_Settings(WKPageGroupGetPreferences(WKPageGetPageGroup(toAPI(priv->pageProxy.get())))));
    697705
    698706#if USE(COORDINATED_GRAPHICS)
     
    850858
    851859    return true;
     860}
     861
     862Ewk_Settings* ewk_view_settings_get(const Evas_Object* ewkView)
     863{
     864    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
     865    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
     866
     867    return priv->settings.get();
    852868}
    853869
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h

    r126866 r127422  
    7474#include "ewk_download_job.h"
    7575#include "ewk_intent.h"
     76#include "ewk_settings.h"
    7677#include "ewk_url_request.h"
    7778#include "ewk_url_response.h"
     
    357358
    358359/**
     360 * Gets the Ewk_Settings of this view.
     361 *
     362 * @param o view object to get Ewk_Settings
     363 *
     364 * @return the Ewk_Settings of this view or @c NULL on failure
     365 */
     366EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
     367
     368/**
    359369 * Delivers a Web intent to the view's main frame.
    360370 *
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp

    r127397 r127422  
    237237    EXPECT_FALSE(ewk_view_popup_menu_select(webView(), 0));
    238238}
     239
     240TEST_F(EWK2UnitTestBase, ewk_view_settings_get)
     241{
     242    Ewk_Settings* settings = ewk_view_settings_get(webView());
     243    ASSERT_TRUE(settings);
     244    ASSERT_EQ(settings, ewk_view_settings_get(webView()));
     245}
Note: See TracChangeset for help on using the changeset viewer.