Title: [134210] trunk/Source/WebKit2
- Revision
- 134210
- Author
- [email protected]
- Date
- 2012-11-12 04:34:15 -0800 (Mon, 12 Nov 2012)
Log Message
[EFL][WK2] Add ewk_settings_offline_web_application_cache_enabled set/get APIs
https://bugs.webkit.org/show_bug.cgi?id=101688
Patch by Jiyeon Kim <[email protected]> on 2012-11-12
Reviewed by Gyuyoung Kim.
Add ewk_settings_offline_web_application_cache_get API to be used for enabling disabling the web application cache.
Add ewk_settings_offline_web_application_cache_set API to be used for getting the web application cache status.
In addition, offline web application cache is enabled by default.
* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::EwkViewImpl):
* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_offline_web_application_cache_enabled_set):
(ewk_settings_offline_web_application_cache_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 (134209 => 134210)
--- trunk/Source/WebKit2/ChangeLog 2012-11-12 12:31:58 UTC (rev 134209)
+++ trunk/Source/WebKit2/ChangeLog 2012-11-12 12:34:15 UTC (rev 134210)
@@ -1,3 +1,23 @@
+2012-11-12 Jiyeon Kim <[email protected]>
+
+ [EFL][WK2] Add ewk_settings_offline_web_application_cache_enabled set/get APIs
+ https://bugs.webkit.org/show_bug.cgi?id=101688
+
+ Reviewed by Gyuyoung Kim.
+
+ Add ewk_settings_offline_web_application_cache_get API to be used for enabling disabling the web application cache.
+ Add ewk_settings_offline_web_application_cache_set API to be used for getting the web application cache status.
+ In addition, offline web application cache is enabled by default.
+
+ * UIProcess/API/efl/EwkViewImpl.cpp:
+ (EwkViewImpl::EwkViewImpl):
+ * UIProcess/API/efl/ewk_settings.cpp:
+ (ewk_settings_offline_web_application_cache_enabled_set):
+ (ewk_settings_offline_web_application_cache_enabled_get):
+ * UIProcess/API/efl/ewk_settings.h:
+ * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
+ (TEST_F):
+
2012-11-11 Shinya Kawanaka <[email protected]>
[Shadow] ElementShadow should have RuleFeatureSet for select attribute selectors.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp (134209 => 134210)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2012-11-12 12:31:58 UTC (rev 134209)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2012-11-12 12:34:15 UTC (rev 134210)
@@ -149,6 +149,8 @@
m_pageProxy->pageGroup()->preferences()->setFullScreenEnabled(true);
#endif
+ m_pageProxy->pageGroup()->preferences()->setOfflineWebApplicationCacheEnabled(true);
+
// Enable mouse events by default
setMouseEventsEnabled(true);
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp (134209 => 134210)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp 2012-11-12 12:31:58 UTC (rev 134209)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp 2012-11-12 12:34:15 UTC (rev 134210)
@@ -302,3 +302,18 @@
return settings->preferences()->layoutFallbackWidth();
}
+
+Eina_Bool ewk_settings_offline_web_application_cache_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+ settings->preferences()->setOfflineWebApplicationCacheEnabled(enable);
+
+ return true;
+}
+
+Eina_Bool ewk_settings_offline_web_application_cache_enabled_get(const Ewk_Settings* settings)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+ return settings->preferences()->offlineWebApplicationCacheEnabled();
+}
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h (134209 => 134210)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h 2012-11-12 12:31:58 UTC (rev 134209)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h 2012-11-12 12:34:15 UTC (rev 134210)
@@ -345,6 +345,29 @@
*/
EAPI unsigned ewk_settings_preferred_minimum_contents_width_get(const Ewk_Settings *settings);
+/**
+ * Enables/disables the offline application cache.
+ *
+ * By default, the offline application cache is enabled.
+ *
+ * @param settings settings object to set the offline application cache state
+ * @param enable @c EINA_TRUE to enable the offline application cache,
+ * @c EINA_FALSE to disable
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_settings_offline_web_application_cache_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
+
+/**
+ * Returns whether the offline application cache is enabled or not.
+ *
+ * @param settings settings object to query whether offline application cache is enabled
+ *
+ * @return @c EINA_TRUE if the offline application cache is enabled
+ * @c EINA_FALSE if disabled or on failure
+ */
+EAPI Eina_Bool ewk_settings_offline_web_application_cache_enabled_get(const Ewk_Settings *settings);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp (134209 => 134210)
--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp 2012-11-12 12:31:58 UTC (rev 134209)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp 2012-11-12 12:34:15 UTC (rev 134210)
@@ -182,3 +182,18 @@
ASSERT_TRUE(ewk_settings_preferred_minimum_contents_width_set(settings, 0));
ASSERT_EQ(0, ewk_settings_preferred_minimum_contents_width_get(settings));
}
+
+TEST_F(EWK2UnitTestBase, ewk_settings_offline_web_application_cache_enabled)
+{
+ Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+ // The offline web application cache is enabled by default.
+ ASSERT_TRUE(ewk_settings_offline_web_application_cache_enabled_get(settings));
+
+ ASSERT_TRUE(ewk_settings_offline_web_application_cache_enabled_set(settings, true));
+ ASSERT_TRUE(ewk_settings_offline_web_application_cache_enabled_get(settings));
+
+ ASSERT_TRUE(ewk_settings_offline_web_application_cache_enabled_set(settings, false));
+ ASSERT_FALSE(ewk_settings_offline_web_application_cache_enabled_get(settings));
+}
+
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes