From ca4078cf8fa2d3194bc3caa24ce041aa6bff75b5 Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Wed, 6 Mar 2013 15:54:09 +0900 Subject: [PATCH] Remove filesystem usage popup [Issue#] N/A [Problem] N/A [Cause] Webkit deprecate API for filesystem usage [Solution] Remove filesystem usage popup [SCMRequest] N/A Change-Id: I60db3589d2e0fa8b174d82400aa30f3b444a0164 --- .../common/view_logic_security_origin_support.cpp | 3 - src/view/webkit/CMakeLists.txt | 1 - src/view/webkit/view_logic.cpp | 30 ----- src/view/webkit/view_logic.h | 5 - src/view/webkit/view_logic_filesystem_support.cpp | 140 --------------------- src/view/webkit/view_logic_filesystem_support.h | 40 ------ 6 files changed, 219 deletions(-) delete mode 100644 src/view/webkit/view_logic_filesystem_support.cpp delete mode 100644 src/view/webkit/view_logic_filesystem_support.h diff --git a/src/view/common/view_logic_security_origin_support.cpp b/src/view/common/view_logic_security_origin_support.cpp index b1c7a77..7b4a5af 100644 --- a/src/view/common/view_logic_security_origin_support.cpp +++ b/src/view/common/view_logic_security_origin_support.cpp @@ -87,9 +87,6 @@ class SecurityOriginSupportImplementation } else if (feature == FEATURE_WEB_DATABASE) { key = WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage( m_model->TizenId); - } else if (feature == FEATURE_FILE_SYSTEM_ACCESS) { - key = WrtDB::VconfConfig::GetVconfKeyFilesystemUsage( - m_model->TizenId); } else { Assert("Wrong feature argument is input"); } diff --git a/src/view/webkit/CMakeLists.txt b/src/view/webkit/CMakeLists.txt index 60fa610..e0a1b28 100644 --- a/src/view/webkit/CMakeLists.txt +++ b/src/view/webkit/CMakeLists.txt @@ -44,7 +44,6 @@ PKG_CHECK_MODULES(SYS_VIEW_MODULE_DEP SET(VIEW_MODULE_SOURCES ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic.cpp - ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_filesystem_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_geolocation_support_webkit2.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_usermedia_support.cpp diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index 41a3e63..20a2902 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -130,8 +129,6 @@ std::map(data); - - if (This->m_securityOriginSupport->isNeedPermissionCheck( - SecurityOriginDB::FEATURE_FILE_SYSTEM_ACCESS) - == WrtDB::SETTINGS_TYPE_OFF) - { - Ewk_Context_File_System_Permission* fileSystemPermission = - static_cast(eventInfo); - ewk_context_file_system_permission_allow_set(fileSystemPermission, - EINA_FALSE); - return; - } - - Assert(eventInfo); - ViewModule::FileSystemSupport::fileSystemPermissionRequest( - This->m_window, - This->m_securityOriginSupport->getSecurityOriginDAO(), - eventInfo); -} - void ViewLogic::certificateConfirmRequestCallback( void* data, Evas_Object* /*obj*/, diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h index a45e1f8..271a84c 100644 --- a/src/view/webkit/view_logic.h +++ b/src/view/webkit/view_logic.h @@ -233,11 +233,6 @@ class ViewLogic : public ViewModule::IViewModule void* data, Evas_Object* obj, void* eventInfo); - // file System Permission Request Callback - static void fileSystemPermissionRequestCallback( - void* data, - Evas_Object* obj, - void* eventInfo); static void certificateConfirmRequestCallback( void* data, Evas_Object* obj, diff --git a/src/view/webkit/view_logic_filesystem_support.cpp b/src/view/webkit/view_logic_filesystem_support.cpp deleted file mode 100644 index cbea174..0000000 --- a/src/view/webkit/view_logic_filesystem_support.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file view_logic_filesystem_support.cpp - * @author Jihoon Chung (jihoon.chung@samsung.com) - */ - -#include "view_logic_filesystem_support.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ViewModule { -using namespace SecurityOriginDB; -using namespace ViewModule::SecurityOriginSupportUtil; - -namespace { -const char* const FILESYSTEM_USE_ASK_TITLE = "Use FileSystem?"; -const char* const FILESYSTEM_USE_ASK_BODY_PREFIX = "Do you want to allow "; -const char* const FILESYSTEM_USE_ASK_BODY_POSTFIX = - " to use persistent filesystem?"; -const char* const FILESYSTEM_USE_ASK_CHECK = "Don't ask again"; - -// function declare -void askUserForFileSystemPermission( - Evas_Object* window, - PermissionData* data); -static void popupCallback(void* data, Evas_Object* obj, void* eventInfo); - -void askUserForFileSystemPermission(Evas_Object* window, PermissionData* data) -{ - LogDebug("askUserForFileSystemPermission called"); - std::string body = - FILESYSTEM_USE_ASK_BODY_PREFIX + - DPL::ToUTF8String(data->m_originData.origin.host) + - FILESYSTEM_USE_ASK_BODY_POSTFIX; - Evas_Object* popup = createPopup(window, - body.c_str(), - FILESYSTEM_USE_ASK_CHECK, - popupCallback, - data); - if (popup == NULL) { - LogError("Fail to create popup object"); - delete data; - return; - } else { - evas_object_show(popup); - } -} - -void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/) -{ - LogDebug("popupCallback"); - Assert(data); - PermissionData* permData = static_cast(data); - Ewk_Context_File_System_Permission* fileSystemPermission = - static_cast(permData->m_data); - - Evas_Object* popup = getPopup(obj); - Result result = getResult(obj); - - if (result != RESULT_UNKNOWN) { - permData->m_originDao->setSecurityOriginData(permData->m_originData, - result); - } - Eina_Bool ret = - (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ? - EINA_TRUE : EINA_FALSE; - ewk_context_file_system_permission_allow_set(fileSystemPermission, - ret); - delete permData; - evas_object_hide(popup); - evas_object_del(popup); -} -} // namespace - -void FileSystemSupport::fileSystemPermissionRequest( - Evas_Object* window, - SecurityOriginDAO* securityOriginDAO, - void* data) -{ - LogDebug("fileSystemPermissionRequest called"); - Assert(securityOriginDAO); - Assert(data); - Ewk_Context_File_System_Permission* fileSystemPermission = - static_cast(data); - Ewk_Security_Origin* ewkOrigin = - ewk_context_file_system_permission_origin_get( - fileSystemPermission); - Assert(ewkOrigin); - - SecurityOriginData securityOriginData( - FEATURE_FILE_SYSTEM_ACCESS, - Origin( - DPL::FromUTF8String(ewk_security_origin_protocol_get(ewkOrigin)), - DPL::FromUTF8String(ewk_security_origin_host_get(ewkOrigin)), - ewk_security_origin_port_get(ewkOrigin))); - - // check cache database - Result result = securityOriginDAO->getResult(securityOriginData); - if (RESULT_ALLOW_ONCE == result || RESULT_ALLOW_ALWAYS == result) { - LogDebug("permit"); - ewk_context_file_system_permission_allow_set(fileSystemPermission, - EINA_TRUE); - return; - } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) { - LogDebug("deny"); - ewk_context_file_system_permission_allow_set(fileSystemPermission, - EINA_FALSE); - return; - } - - // ask to user - PermissionData* permissionData = - new PermissionData(securityOriginDAO, - securityOriginData, - fileSystemPermission); - askUserForFileSystemPermission(window, permissionData); - return; -} -} // namespace ViewModule diff --git a/src/view/webkit/view_logic_filesystem_support.h b/src/view/webkit/view_logic_filesystem_support.h deleted file mode 100644 index 7465f03..0000000 --- a/src/view/webkit/view_logic_filesystem_support.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file view_logic_filesystem_support.h - * @author Jihoon Chung (jihoon.chung@samsung.com) - */ - -#ifndef VIEW_LOGIC_FILESYSTEM_SUPPORT_H_ -#define VIEW_LOGIC_FILESYSTEM_SUPPORT_H_ - -#include -#include - -namespace SecurityOriginDB { -class SecurityOriginDAO; -} - -namespace ViewModule { -namespace FileSystemSupport { -void fileSystemPermissionRequest( - Evas_Object* window, - SecurityOriginDB::SecurityOriginDAO* securityOriginDAO, - void* data); -} // namespace FileSystemSupport -} // namespace ViewModule - -#endif // VIEW_LOGIC_FILESYSTEM_SUPPORT_H_ -- 2.7.4