Remove filesystem usage popup
authorJihoon Chung <jihoon.chung@samsung.com>
Wed, 6 Mar 2013 06:54:09 +0000 (15:54 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Wed, 6 Mar 2013 06:54:41 +0000 (15:54 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] Webkit deprecate API for filesystem usage
[Solution] Remove filesystem usage popup
[SCMRequest] N/A

Change-Id: I60db3589d2e0fa8b174d82400aa30f3b444a0164

src/view/common/view_logic_security_origin_support.cpp
src/view/webkit/CMakeLists.txt
src/view/webkit/view_logic.cpp
src/view/webkit/view_logic.h
src/view/webkit/view_logic_filesystem_support.cpp [deleted file]
src/view/webkit/view_logic_filesystem_support.h [deleted file]

index b1c7a77..7b4a5af 100644 (file)
@@ -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");
         }
index 60fa610..e0a1b28 100644 (file)
@@ -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
index 41a3e63..20a2902 100644 (file)
@@ -52,7 +52,6 @@
 #include <common/view_logic_user_agent_support.h>
 #include <common/view_logic_vibration_support.h>
 #include <view_logic_scheme_support.h>
-#include <view_logic_filesystem_support.h>
 #include <view_logic_geolocation_support_webkit2.h>
 #include <view_logic_usermedia_support.h>
 #include <view_logic_web_notification_support.h>
@@ -130,8 +129,6 @@ std::map<const std::string,
 
     { "database,quota,exceeded",
       &ViewLogic::databaseUsagePermissionRequestCallback },
-    { "filesystem,permission,request",
-      &ViewLogic::fileSystemPermissionRequestCallback },
     { "fullscreen,enterfullscreen", &ViewLogic::enterFullscreenCallback },
     { "fullscreen,exitfullscreen", &ViewLogic::exitFullscreenCallback },
     // IME Callback
@@ -1861,33 +1858,6 @@ void ViewLogic::databaseUsagePermissionRequestCallback(
     return;
 }
 
-void ViewLogic::fileSystemPermissionRequestCallback(
-    void* data,
-    Evas_Object* /*obj*/,
-    void* eventInfo)
-{
-    LogDebug("fileSystemPermissionRequestCallback called");
-    Assert(data);
-    ViewLogic* This = static_cast<ViewLogic*>(data);
-
-    if (This->m_securityOriginSupport->isNeedPermissionCheck(
-            SecurityOriginDB::FEATURE_FILE_SYSTEM_ACCESS)
-        == WrtDB::SETTINGS_TYPE_OFF)
-    {
-        Ewk_Context_File_System_Permission* fileSystemPermission =
-            static_cast<Ewk_Context_File_System_Permission*>(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*/,
index a45e1f8..271a84c 100644 (file)
@@ -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 (file)
index cbea174..0000000
+++ /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 <string>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
-#include <wrt-commons/security-origin-dao/security_origin_dao.h>
-#include <EWebKit2.h>
-#include <common/view_logic_security_origin_support.h>
-#include <Elementary.h>
-
-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<PermissionData*>(data);
-    Ewk_Context_File_System_Permission* fileSystemPermission =
-        static_cast<Ewk_Context_File_System_Permission*>(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<Ewk_Context_File_System_Permission*>(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 (file)
index 7465f03..0000000
+++ /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 <memory.h>
-#include <Elementary.h>
-
-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_