Revert "[Tizen] Support incognito mode in WebView"
authorJiyun Yang <ji.yang@samsung.com>
Wed, 21 Aug 2024 04:28:29 +0000 (13:28 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 21 Aug 2024 04:28:29 +0000 (13:28 +0900)
This reverts commit 1f123c696a3ae23320f4ede37c49f74ccc60ab49.

dali-extension/web-engine-chromium/tizen-web-engine-chromium.cpp
dali-extension/web-engine-chromium/tizen-web-engine-chromium.h
dali-extension/web-engine-chromium/tizen-web-engine-manager.cpp
dali-extension/web-engine-chromium/tizen-web-engine-manager.h

index 78c3a4c..d49c8b4 100644 (file)
@@ -126,7 +126,7 @@ void TizenWebEngineChromium::Create(uint32_t width, uint32_t height, const std::
 
   mWidth  = width;
   mHeight = height;
-  InitWebView(false);
+  InitWebView();
   WebEngineManager::Get().Add(mWebView, this);
 }
 
@@ -142,40 +142,19 @@ void TizenWebEngineChromium::Create(uint32_t width, uint32_t height, uint32_t ar
     return;
   }
 
-  bool incognito = false;
-  for(uint32_t idx = 0; idx < argc; ++idx)
-  {
-    if(strstr(argv[idx], "--incognito"))
-    {
-      incognito = true;
-      break;
-    }
-  }
-
   mWidth  = width;
   mHeight = height;
-  InitWebView(incognito);
+  InitWebView();
   WebEngineManager::Get().Add(mWebView, this);
 }
 
-void TizenWebEngineChromium::InitWebView(bool incognito)
+void TizenWebEngineChromium::InitWebView()
 {
-  Ewk_Context* context = nullptr;
-  if(incognito)
-  {
-    mWebView = ewk_view_add_in_incognito_mode(ecore_evas_get(WebEngineManager::Get().GetWindow()));
-    context  = ewk_view_context_get(mWebView);
-  }
-  else
-  {
-    context  = ewk_context_default_get();
-    mWebView = ewk_view_add(ecore_evas_get(WebEngineManager::Get().GetWindow()));
-  }
-  WebEngineManager::Get().SetContext(context);
+  Ecore_Wl2_Window* win     = AnyCast<Ecore_Wl2_Window*>(Adaptor::Get().GetNativeWindowHandle());
+  Ewk_Context*      context = ewk_context_default_get();
   ewk_context_max_refresh_rate_set(context, 60);
+  mWebView = ewk_view_add(ecore_evas_get(WebEngineManager::Get().GetWindow()));
   ewk_view_offscreen_rendering_enabled_set(mWebView, true);
-
-  Ecore_Wl2_Window* win = AnyCast<Ecore_Wl2_Window*>(Adaptor::Get().GetNativeWindowHandle());
   ewk_view_ime_window_set(mWebView, win);
 
   Ewk_Settings* settings = ewk_view_settings_get(mWebView);
index 3e6ac35..6f1dab0 100644 (file)
@@ -606,7 +606,7 @@ private:
   static Eina_Bool OnGeolocationPermission(Evas_Object*, Ewk_Geolocation_Permission_Request* request, void* data);
 
   void UpdateImage(tbm_surface_h buffer);
-  void InitWebView(bool incognito);
+  void InitWebView();
   bool FeedMouseEvent(const TouchEvent& touch);
   bool FeedTouchEvent(const TouchEvent& touch);
 
index bd0ad1d..693cd6f 100644 (file)
@@ -25,6 +25,8 @@
 #include <dali/devel-api/adaptor-framework/lifecycle-controller.h>
 #include <dali/integration-api/debug.h>
 
+#include <ewk_context.h>
+#include <ewk_context_internal.h>
 #include <ewk_main.h>
 
 #include <memory>
@@ -55,6 +57,11 @@ WebEngineManager::WebEngineManager()
   ewk_init();
   mWindow = ecore_evas_new("wayland_egl", 0, 0, 1, 1, 0);
 
+  Ewk_Context* context = ewk_context_default_get();
+  mWebEngineContext.reset(new TizenWebEngineContext(context));
+
+  Ewk_Cookie_Manager* manager = ewk_context_cookie_manager_get(context);
+  mWebEngineCookieManager.reset(new TizenWebEngineCookieManager(manager));
   Dali::LifecycleController::Get().TerminateSignal().Connect(mSlotDelegate, &WebEngineManager::OnTerminated);
 
   DALI_LOG_RELEASE_INFO("#WebEngineManager is created fully.\n");
@@ -85,14 +92,6 @@ Ecore_Evas* WebEngineManager::GetWindow()
   return mWindow;
 }
 
-void WebEngineManager::SetContext(Ewk_Context* context)
-{
-  mWebEngineContext.reset(new TizenWebEngineContext(context));
-
-  Ewk_Cookie_Manager* manager = ewk_context_cookie_manager_get(context);
-  mWebEngineCookieManager.reset(new TizenWebEngineCookieManager(manager));
-}
-
 Dali::WebEngineContext* WebEngineManager::GetContext()
 {
   return mWebEngineContext.get();
index 2e0e6eb..4348263 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_PLUGIN_TIZEN_WEB_ENGINE_MANAGER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,8 +25,6 @@
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h>
 #include <dali/public-api/signals/slot-delegate.h>
 
-#include <ewk_context.h>
-
 #include <map>
 #include <memory>
 
@@ -53,8 +51,6 @@ public:
 
   Ecore_Evas* GetWindow();
 
-  void SetContext(Ewk_Context* context);
-
   Dali::WebEngineContext* GetContext();
 
   Dali::WebEngineCookieManager* GetCookieManager();