Cookies saving between browser restarts. 57/49457/4
authorMaciej Skrzypkowski <m.skrzypkows@samsung.com>
Tue, 13 Oct 2015 11:13:36 +0000 (13:13 +0200)
committerMaciej Skrzypkowski <m.skrzypkows@samsung.com>
Wed, 14 Oct 2015 07:04:44 +0000 (00:04 -0700)
[Issue]    https://bugs.tizen.org/jira/browse/TT-138
[Problem]  Cookies saving path was not set.
[Solution] Addes cookies saving path.
[Verify]   Open onet.pl > click on X button in cookies popup information
           > close browser > open again onet.pl,
           cookies popup should not appear.

Change-Id: I4d0c4d1a544bd59a093dcf62092365121ef17435
Signed-off-by: Maciej Skrzypkowski <m.skrzypkows@samsung.com>
services/WebKitEngineService/WebView.cpp
services/WebKitEngineService/WebView.h

index cb944e636fb261c8b1ae90877af433478893f84f..1d03786022cc5857e5e4acb1a6318f7d4594e8e1 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "AbstractWebEngine/AbstractWebEngine.h"
 #include "AbstractWebEngine/TabThumbCache.h"
+#include "app_common.h"
 #include "BrowserAssert.h"
 #include "BrowserLogger.h"
 #include "EflTools.h"
@@ -60,6 +61,8 @@ namespace tizen_browser {
 namespace basic_webengine {
 namespace webkitengine_service {
 
+const std::string WebView::COOKIES_PATH = "cookies";
+
 WebView::WebView(Evas_Object * obj, TabId tabId)
     : m_parent(obj)
     , m_tabId(tabId)
@@ -86,6 +89,7 @@ WebView::~WebView()
 void WebView::init(bool desktopMode, Evas_Object * opener)
 {
 #if defined(USE_EWEBKIT)
+    M_ASSERT(m_ewkContext);
     m_ewkView = ewk_view_add_with_context(evas_object_evas_get(m_parent), m_ewkContext);
 
     evas_object_data_set(m_ewkView, "_container", this);
@@ -106,17 +110,10 @@ void WebView::init(bool desktopMode, Evas_Object * opener)
     ewk_view_resume(m_ewkView);
 #endif
 
-    if (m_ewkView)
-    {
-        Ewk_Context *context = ewk_view_context_get(m_ewkView);
-        if (context)
-        {
-            ewk_context_cache_model_set(context, EWK_CACHE_MODEL_PRIMARY_WEBBROWSER);
-        }
-    }
+    ewk_context_cache_model_set(m_ewkContext, EWK_CACHE_MODEL_PRIMARY_WEBBROWSER);
+    std::string path = app_get_data_path() + COOKIES_PATH;
+    ewk_cookie_manager_persistent_storage_set(ewk_context_cookie_manager_get(m_ewkContext),  path.c_str(), EWK_COOKIE_PERSISTENT_STORAGE_SQLITE);
 
-///\note Odroid modification - not exists in WebKit API
-//     ewk_cookie_manager_widget_cookie_directory_set(ewk_context_cookie_manager_get(context), webkit_path.c_str());
     setupEwkSettings();
     registerCallbacks();
 #else
index 224e6572e6f95a3e638e179e0581841560c960c0..07fdcdcc8c891b62ae6296eb28d69d17444bb9bd 100644 (file)
@@ -225,6 +225,8 @@ private:
     std::map<AuthenticationConfirmationPtr, Ewk_Auth_Request *> m_confirmationAuthenticationMap;
 #endif
 #endif
+
+    static const std::string COOKIES_PATH;
 };
 
 } /* namespace webkitengine_service */