+ impl->pageProxy->setContentSecurityPolicy(String::fromUTF8(policy), static_cast<WebCore::ContentSecurityPolicy::HeaderType>(type));
+#endif
+}
+
+#if ENABLE(TIZEN_APPLICATION_CACHE)
+Eina_Bool ewkViewRequestApplicationCachePermission(Evas_Object* ewkView, WKSecurityOriginRef origin)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+ if (!impl->applicationCachePermissionContext || !impl->applicationCachePermissionContext->applicationCachePermissionCallback)
+ return false;
+
+ impl->isWaitingForApplicationCachePermission = true;
+ if (impl->applicationCachePermissionOrigin)
+ deleteSecurityOrigin(impl->applicationCachePermissionOrigin);
+ impl->applicationCachePermissionOrigin = createSecurityOrigin(origin);
+
+ return impl->applicationCachePermissionContext->applicationCachePermissionCallback(ewkView, impl->applicationCachePermissionOrigin, impl->applicationCachePermissionContext->userData) == EINA_TRUE;
+}
+#endif
+
+void ewk_view_application_cache_permission_callback_set(Evas_Object* ewkView, Ewk_View_Applicacion_Cache_Permission_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_APPLICATION_CACHE)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ if (!impl->applicationCachePermissionContext)
+ impl->applicationCachePermissionContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+ impl->applicationCachePermissionContext->applicationCachePermissionCallback = callback;
+ impl->applicationCachePermissionContext->userData = userData;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(callback);
+ UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_application_cache_permission_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_APPLICATION_CACHE)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ TIZEN_LOGI("allow %d", allow);
+ WKPageReplyApplicationCachePermission(toAPI(impl->page()), allow);
+ if (impl->applicationCachePermissionOrigin)
+ deleteSecurityOrigin(impl->applicationCachePermissionOrigin);
+ impl->applicationCachePermissionOrigin = 0;
+ impl->isWaitingForApplicationCachePermission = false;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(allow);
+#endif
+}
+
+#if ENABLE(TIZEN_INDEXED_DATABASE)
+bool ewkViewExceededIndexedDatabaseQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, long long currentUsage)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+ if (!impl->exceededIndexedDatabaseQuotaContext || !impl->exceededIndexedDatabaseQuotaContext->exceededIndexedDatabaseQuotaCallback)
+ return false;
+
+ impl->isWaitingForExceededQuotaPopupReply = true;
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = createSecurityOrigin(origin);
+
+ TIZEN_LOGI("currentUsage(%lld)", currentUsage);
+
+ return impl->exceededIndexedDatabaseQuotaContext->exceededIndexedDatabaseQuotaCallback(ewkView, impl->exceededQuotaOrigin, currentUsage, impl->exceededIndexedDatabaseQuotaContext->userData) == EINA_TRUE;
+}
+#endif
+
+void ewk_view_exceeded_indexed_database_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_INDEXED_DATABASE)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ if (!impl->exceededIndexedDatabaseQuotaContext)
+ impl->exceededIndexedDatabaseQuotaContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+ impl->exceededIndexedDatabaseQuotaContext->exceededIndexedDatabaseQuotaCallback = callback;
+ impl->exceededIndexedDatabaseQuotaContext->userData = userData;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(callback);
+ UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_exceeded_indexed_database_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_INDEXED_DATABASE)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ TIZEN_LOGI("allow %d", allow);
+ WKPageReplyExceededIndexedDatabaseQuota(toAPI(impl->page()), allow == EINA_TRUE);
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = 0;
+ impl->isWaitingForExceededQuotaPopupReply = false;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(allow);
+#endif
+}
+
+// EwkFindOptions should be matched up orders with WkFindOptions.
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_CASE_INSENSITIVE, kWKFindOptionsCaseInsensitive);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_AT_WORD_STARTS, kWKFindOptionsAtWordStarts);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START, kWKFindOptionsTreatMedialCapitalAsWordStart);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_BACKWARDS, kWKFindOptionsBackwards);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_WRAP_AROUND, kWKFindOptionsWrapAround);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_SHOW_OVERLAY, kWKFindOptionsShowOverlay);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR, kWKFindOptionsShowFindIndicator);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_FIND_OPTIONS_SHOW_HIGHLIGHT, kWKFindOptionsShowHighlight);
+
+Eina_Bool ewk_view_text_find(Evas_Object* ewkView, const char* text, Ewk_Find_Options options, unsigned maxMatchCount)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(text, false);
+
+ impl->pageProxy->findString(String::fromUTF8(text), static_cast<WebKit::FindOptions>(options), maxMatchCount);
+
+ return true;
+}
+
+Eina_Bool ewk_view_text_find_highlight_clear(Evas_Object* ewkView)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+ impl->pageProxy->hideFindUI();
+
+ return true;
+}
+
+Eina_Bool ewk_view_text_matches_count(Evas_Object* ewkView, const char* text, Ewk_Find_Options options, unsigned maxMatchCount)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(text, false);
+
+ impl->pageProxy->countStringMatches(String::fromUTF8(text), static_cast<WebKit::FindOptions>(options), maxMatchCount);
+
+ return true;
+}
+
+void ewk_view_exceeded_database_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Database_Quota_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_SQL_DATABASE)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ if (!impl->exceededDatabaseQuotaContext)
+ impl->exceededDatabaseQuotaContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+ impl->exceededDatabaseQuotaContext->exceededDatabaseQuotaCallback = callback;
+ impl->exceededDatabaseQuotaContext->userData = userData;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(callback);
+ UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_exceeded_database_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_SQL_DATABASE)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ TIZEN_LOGI("allow %d", allow);
+ WKPageReplyExceededDatabaseQuota(toAPI(impl->page()), allow == EINA_TRUE);
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = 0;
+ impl->isWaitingForExceededQuotaPopupReply = false;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(allow);
+#endif
+}
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+bool ewkViewExceededLocalFileSystemQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, long long currentUsage)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+ if (!impl->exceededLocalFileSystemQuotaContext || !impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback)
+ return false;
+
+ impl->isWaitingForExceededQuotaPopupReply = true;
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = createSecurityOrigin(origin);
+
+ TIZEN_LOGI("currentUsage(%lld)", currentUsage);
+
+ return impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback(ewkView, impl->exceededQuotaOrigin , currentUsage, impl->exceededLocalFileSystemQuotaContext->userData) == EINA_TRUE;
+}
+#endif
+
+void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ if (!impl->exceededLocalFileSystemQuotaContext)
+ impl->exceededLocalFileSystemQuotaContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+ impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback = callback;
+ impl->exceededLocalFileSystemQuotaContext->userData = userData;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(callback);
+ UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ TIZEN_LOGI("allow %d", allow);
+ WKPageReplyExceededLocalFileSystemQuota(toAPI(impl->page()), allow == EINA_TRUE);
+ if (impl->exceededQuotaOrigin)
+ deleteSecurityOrigin(impl->exceededQuotaOrigin);
+ impl->exceededQuotaOrigin = 0;
+ impl->isWaitingForExceededQuotaPopupReply = false;
+#else
+ UNUSED_PARAM(ewkView);
+ UNUSED_PARAM(result);
+#endif
+}
+
+void ewk_view_rotation_prepare(Evas_Object* ewkView, int angle)
+{
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ int width, height;
+ if (angle == 0 || angle == 180) {
+ width = WebCore::getDefaultScreenResolution().width();
+ height = WebCore::getDefaultScreenResolution().height() + 100;
+ }
+ if (angle == 90 || angle == 270) {
+ width = WebCore::getDefaultScreenResolution().height();
+ height = WebCore::getDefaultScreenResolution().width() + 100;
+ }
+
+ impl->pageProxy->drawingArea()->setSize(IntSize(width, height), IntSize());
+ impl->pageClient->setWaitFrameOfNewViewortSize(true);
+ ewk_view_suspend(ewkView);
+ impl->pageClient->updateViewportSize(IntSize(width, height), angle);
+#endif
+}
+
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+void ewkViewRotatePrepared(Evas_Object* ewkView)
+{
+ evas_object_smart_callback_call(ewkView, "rotate,prepared", 0);
+}
+#endif
+
+void ewk_view_use_settings_font(Evas_Object* ewkView)
+{
+#if ENABLE(TIZEN_USE_SETTINGS_FONT)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ impl->pageProxy->useSettingsFont();
+#endif
+}
+
+void ewk_view_fullscreen_exit(Evas_Object* ewkView)
+{
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ TIZEN_LOGI("");
+
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ if (!impl->pageProxy->fullScreenManager()->isFullScreen())
+ return;
+
+ impl->pageProxy->fullScreenManager()->requestExitFullScreen();
+#else
+ UNUSED_PARAM(ewkView);