From 8102f7568114ed5e35aa96b69cac8a973dcce857 Mon Sep 17 00:00:00 2001 From: "huayong.xu" Date: Tue, 26 Jul 2022 15:30:20 +0800 Subject: [PATCH] Add an API for getting web view when request is intercepted. Change-Id: I03aad2d08cc6df178056006392a05876a7841c13 --- .../adaptor-framework/web-engine/web-engine-request-interceptor.h | 8 ++++++++ dali/devel-api/adaptor-framework/web-engine/web-engine.cpp | 5 +++++ dali/devel-api/adaptor-framework/web-engine/web-engine.h | 5 +++++ dali/internal/web-engine/common/web-engine-impl.cpp | 5 +++++ dali/internal/web-engine/common/web-engine-impl.h | 5 +++++ 5 files changed, 28 insertions(+) mode change 100644 => 100755 dali/internal/web-engine/common/web-engine-impl.cpp mode change 100644 => 100755 dali/internal/web-engine/common/web-engine-impl.h diff --git a/dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h b/dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h index aa8889d..fc88806 100755 --- a/dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h +++ b/dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include #include #include #include @@ -44,6 +45,13 @@ public: virtual ~WebEngineRequestInterceptor() = default; /** + * @brief Gets web engine in which http request is intercepted. + * + * @return web engine if succeeded or null otherwise + */ + virtual Dali::WebEnginePlugin* GetWebEngine() const = 0; + + /** * @brief Returns request url. * * @return url if succeeded or empty otherwise diff --git a/dali/devel-api/adaptor-framework/web-engine/web-engine.cpp b/dali/devel-api/adaptor-framework/web-engine/web-engine.cpp index 5a39d11..bba76f0 100755 --- a/dali/devel-api/adaptor-framework/web-engine/web-engine.cpp +++ b/dali/devel-api/adaptor-framework/web-engine/web-engine.cpp @@ -101,6 +101,11 @@ void WebEngine::Destroy() GetImplementation(*this).Destroy(); } +Dali::WebEnginePlugin* WebEngine::GetPlugin() const +{ + return GetImplementation(*this).GetPlugin(); +} + NativeImageSourcePtr WebEngine::GetNativeImageSource() { return GetImplementation(*this).GetNativeImageSource(); diff --git a/dali/devel-api/adaptor-framework/web-engine/web-engine.h b/dali/devel-api/adaptor-framework/web-engine/web-engine.h index 0af9cbe..cdc5b21 100755 --- a/dali/devel-api/adaptor-framework/web-engine/web-engine.h +++ b/dali/devel-api/adaptor-framework/web-engine/web-engine.h @@ -123,6 +123,11 @@ public: void Destroy(); /** + * @brief Gets web engine plugin. + */ + Dali::WebEnginePlugin* GetPlugin() const; + + /** * @brief Get native image source to render. */ NativeImageSourcePtr GetNativeImageSource(); diff --git a/dali/internal/web-engine/common/web-engine-impl.cpp b/dali/internal/web-engine/common/web-engine-impl.cpp old mode 100644 new mode 100755 index 1ec614a..558dac7 --- a/dali/internal/web-engine/common/web-engine-impl.cpp +++ b/dali/internal/web-engine/common/web-engine-impl.cpp @@ -227,6 +227,11 @@ void WebEngine::Destroy() mPlugin->Destroy(); } +Dali::WebEnginePlugin* WebEngine::GetPlugin() const +{ + return mPlugin; +} + Dali::NativeImageSourcePtr WebEngine::GetNativeImageSource() { return mPlugin->GetNativeImageSource(); diff --git a/dali/internal/web-engine/common/web-engine-impl.h b/dali/internal/web-engine/common/web-engine-impl.h old mode 100644 new mode 100755 index 7b9edac..085c28a --- a/dali/internal/web-engine/common/web-engine-impl.h +++ b/dali/internal/web-engine/common/web-engine-impl.h @@ -83,6 +83,11 @@ public: void Destroy(); /** + * @copydoc Dali::WebEngine::GetPlugin() + */ + Dali::WebEnginePlugin* GetPlugin() const; + + /** * @copydoc Dali::WebEngine::GetNativeImageSource() */ Dali::NativeImageSourcePtr GetNativeImageSource(); -- 2.7.4