Title: [136504] trunk/Source/WebKit2
Revision
136504
Author
[email protected]
Date
2012-12-04 05:15:01 -0800 (Tue, 04 Dec 2012)

Log Message

[EFL][WK2] Add APIs to toggle plug-ins support.
https://bugs.webkit.org/show_bug.cgi?id=101920

Patch by Yuni Jeong <[email protected]> on 2012-12-04
Reviewed by Gyuyoung Kim.

Add setting APIs to toggle plug-ins support and add corresponding API tests.

* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_plugins_enabled_set):
(ewk_settings_plugins_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (136503 => 136504)


--- trunk/Source/WebKit2/ChangeLog	2012-12-04 13:05:41 UTC (rev 136503)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-04 13:15:01 UTC (rev 136504)
@@ -1,3 +1,19 @@
+2012-12-04  Yuni Jeong  <[email protected]>
+
+        [EFL][WK2] Add APIs to toggle plug-ins support.
+        https://bugs.webkit.org/show_bug.cgi?id=101920
+
+        Reviewed by Gyuyoung Kim.
+
+        Add setting APIs to toggle plug-ins support and add corresponding API tests.
+
+        * UIProcess/API/efl/ewk_settings.cpp:
+        (ewk_settings_plugins_enabled_set):
+        (ewk_settings_plugins_enabled_get):
+        * UIProcess/API/efl/ewk_settings.h:
+        * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
+        (TEST_F):
+
 2012-12-04  Andras Becsi  <[email protected]>
 
         [Qt][WK2] Do not override previously set flags of QQuickWebView when enabling drag&drop

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp (136503 => 136504)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2012-12-04 13:05:41 UTC (rev 136503)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2012-12-04 13:15:01 UTC (rev 136504)
@@ -348,3 +348,19 @@
 
     return settings->preferences()->localStorageEnabled();
 }
+
+Eina_Bool ewk_settings_plugins_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    settings->preferences()->setPluginsEnabled(enable);
+
+    return true;
+}
+
+Eina_Bool ewk_settings_plugins_enabled_get(const Ewk_Settings* settings)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    return settings->preferences()->pluginsEnabled();
+}

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h (136503 => 136504)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h	2012-12-04 13:05:41 UTC (rev 136503)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h	2012-12-04 13:15:01 UTC (rev 136504)
@@ -424,6 +424,29 @@
  */
 EAPI Eina_Bool ewk_settings_local_storage_enabled_get(const Ewk_Settings *settings);
 
+/**
+ * Toggles plug-ins support.
+ *
+ * By default, plug-ins support is enabled.
+ *
+ * @param settings settings object to set plug-ins support
+ * @param enable @c EINA_TRUE to enable plug-ins support
+ *        @c EINA_FALSE to disable
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_settings_plugins_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
+
+/**
+ * Returns whether plug-ins support is enabled or not.
+ *
+ * @param settings settings object to query whether plug-ins support is enabled
+ *
+ * @return @c EINA_TRUE if plug-ins support is enabled
+ *         @c EINA_FALSE if not or on failure
+ */
+EAPI Eina_Bool ewk_settings_plugins_enabled_get(const Ewk_Settings *settings);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp (136503 => 136504)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp	2012-12-04 13:05:41 UTC (rev 136503)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp	2012-12-04 13:15:01 UTC (rev 136504)
@@ -221,3 +221,17 @@
     ASSERT_TRUE(ewk_settings_local_storage_enabled_set(settings, true));
     ASSERT_TRUE(ewk_settings_local_storage_enabled_get(settings));
 }
+
+TEST_F(EWK2UnitTestBase, ewk_settings_plugins_enabled)
+{
+    Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+    // Plug-ins support is enabled by default.
+    ASSERT_TRUE(ewk_settings_plugins_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_plugins_enabled_set(settings, true));
+    ASSERT_TRUE(ewk_settings_plugins_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_plugins_enabled_set(settings, false));
+    ASSERT_FALSE(ewk_settings_plugins_enabled_get(settings));
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to