#include <dali/devel-api/adaptor-framework/web-engine.h>
#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine-frame.h>
+#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
private:
MockWebEngineBackForwardListItem mockItem;
- WebEngineBackForwardListItem* pMockItem;
+ WebEngineBackForwardListItem* pMockItem;
+};
+
+class MockWebEngineCertificate : public Dali::WebEngineCertificate
+{
+public:
+ MockWebEngineCertificate()
+ {
+ }
+
+ void Allow(bool allowed) override
+ {
+ }
+
+ bool IsFromMainFrame() const override
+ {
+ return true;
+ }
+
+ std::string GetPem() const override
+ {
+ return "abc";
+ }
+
+ bool IsContextSecure() const override
+ {
+ return true;
+ }
+};
+
+class MockWebEngineHttpAuthHandler : public Dali::WebEngineHttpAuthHandler
+{
+public:
+ MockWebEngineHttpAuthHandler()
+ {
+ }
+
+ std::string GetRealm() const override
+ {
+ return "test";
+ }
+
+ void Suspend() override
+ {
+ }
+
+ void UseCredential(const std::string& user, const std::string& password) override
+ {
+ }
+
+ void CancelCredential() override
+ {
+ }
};
class MockWebEngineFormRepostDecision : public WebEngineFormRepostDecision
void Reply(bool allowed) override {}
};
+class MockWebEngineFrame : public Dali::WebEngineFrame
+{
+public:
+ MockWebEngineFrame()
+ {
+ }
+
+ bool IsMainFrame() const override
+ {
+ return true;
+ }
+};
+
+class MockWebEnginePolicyDecision : public Dali::WebEnginePolicyDecision
+{
+public:
+ MockWebEnginePolicyDecision()
+ {
+ }
+
+ std::string GetUrl() const override
+ {
+ return "http://test.html";
+ }
+
+ std::string GetCookie() const override
+ {
+ return "test:abc";
+ }
+
+ Dali::WebEnginePolicyDecision::DecisionType GetDecisionType() const
+ {
+ return Dali::WebEnginePolicyDecision::DecisionType::USE;
+ }
+
+ std::string GetResponseMime() const
+ {
+ return "txt/xml";
+ }
+
+ int32_t GetResponseStatusCode() const
+ {
+ return 500;
+ }
+
+ Dali::WebEnginePolicyDecision::NavigationType GetNavigationType() const
+ {
+ return Dali::WebEnginePolicyDecision::NavigationType::LINK_CLICKED;
+ }
+
+ Dali::WebEngineFrame& GetFrame() const
+ {
+ return *(Dali::WebEngineFrame*)(&mockWebFrame);
+ }
+
+ std::string GetScheme() const
+ {
+ return "test";
+ }
+
+ bool Use()
+ {
+ return true;
+ }
+
+ bool Ignore()
+ {
+ return true;
+ }
+
+ bool Suspend()
+ {
+ return true;
+ }
+
+private:
+ MockWebEngineFrame mockWebFrame;
+};
+
class MockWebEngineRequestInterceptor : public WebEngineRequestInterceptor
{
public:
}
};
+class MockWebEngineConsoleMessage : public Dali::WebEngineConsoleMessage
+{
+public:
+ MockWebEngineConsoleMessage()
+ {
+ }
+
+ std::string GetSource() const override
+ {
+ return "source";
+ }
+
+ uint32_t GetLine() const override
+ {
+ return 10;
+ }
+
+ SeverityLevel GetSeverityLevel() const override
+ {
+ return SeverityLevel::EMPTY;
+ }
+
+ std::string GetText() const override
+ {
+ return "This is a text.";
+ }
+};
+
+class MockWebEngineLoadError : public Dali::WebEngineLoadError
+{
+public:
+ MockWebEngineLoadError(const std::string& url)
+ : mockUrl(url)
+ {
+ }
+
+ std::string GetUrl() const override
+ {
+ return mockUrl;
+ }
+
+ ErrorCode GetCode() const override
+ {
+ return ErrorCode::UNKNOWN;
+ }
+
+ std::string GetDescription() const override
+ {
+ return "This is an error.";
+ }
+
+ ErrorType GetType() const override
+ {
+ return ErrorType::NONE;
+ }
+
+private:
+ std::string mockUrl;
+};
+
class MockWebEngineSettings : public WebEngineSettings
{
public:
return mRequestInterceptorSignal;
}
+ Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& ConsoleMessageSignal()
+ {
+ return mConsoleMessageSignal;
+ }
+
+ Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal()
+ {
+ return mPolicyDecisionSignal;
+ }
+
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal()
+ {
+ return mCertificateConfirmSignal;
+ }
+
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal()
+ {
+ return mSslCertificateChangedSignal;
+ }
+
+ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal()
+ {
+ return mHttpAuthHandlerSignal;
+ }
+
std::string mUrl;
std::vector<std::string> mHistory;
size_t mCurrentPlusOnePos;
Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType mFormRepostDecisionSignal;
Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType mFrameRenderedSignal;
Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType mRequestInterceptorSignal;
+ Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType mConsoleMessageSignal;
+ Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType mPolicyDecisionSignal;
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType mCertificateConfirmSignal;
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType mSslCertificateChangedSignal;
+ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType mHttpAuthHandlerSignal;
bool mEvaluating;
float mPageZoomFactor;
WebEngineCookieManager* mockWebEngineCookieManager;
WebEngineSettings* mockWebEngineSettings;
- std::vector<JavaScriptEvaluatedResultCallback> mResultCallbacks;
- Dali::WebEnginePlugin::JavaScriptAlertCallback mJavaScriptAlertCallback;
- Dali::WebEnginePlugin::JavaScriptConfirmCallback mJavaScriptConfirmCallback;
- Dali::WebEnginePlugin::JavaScriptPromptCallback mJavaScriptPromptCallback;
- Dali::WebEnginePlugin::ScreenshotCapturedCallback mScreenshotCapturedCallback;
- Dali::WebEnginePlugin::VideoPlayingCallback mVideoPlayingCallback;
- Dali::WebEnginePlugin::GeolocationPermissionCallback mGeolocationPermissionCallback;
+ std::vector<JavaScriptEvaluatedResultCallback> mResultCallbacks;
+ Dali::WebEnginePlugin::JavaScriptAlertCallback mJavaScriptAlertCallback;
+ Dali::WebEnginePlugin::JavaScriptConfirmCallback mJavaScriptConfirmCallback;
+ Dali::WebEnginePlugin::JavaScriptPromptCallback mJavaScriptPromptCallback;
+ Dali::WebEnginePlugin::ScreenshotCapturedCallback mScreenshotCapturedCallback;
+ Dali::WebEnginePlugin::VideoPlayingCallback mVideoPlayingCallback;
+ Dali::WebEnginePlugin::GeolocationPermissionCallback mGeolocationPermissionCallback;
};
gInstance->mPageLoadFinishedSignal.Emit( gInstance->mUrl );
gInstance->mUrlChangedSignal.Emit( "http://new-test" );
- std::shared_ptr<Dali::WebEngineFormRepostDecision> decision(new MockWebEngineFormRepostDecision());
- gInstance->mFormRepostDecisionSignal.Emit(std::move(decision));
+ std::shared_ptr<Dali::WebEngineFormRepostDecision> repostDecision(new MockWebEngineFormRepostDecision());
+ gInstance->mFormRepostDecisionSignal.Emit(std::move(repostDecision));
gInstance->mFrameRenderedSignal.Emit();
std::shared_ptr<Dali::WebEngineRequestInterceptor> interceptor(new MockWebEngineRequestInterceptor());
gInstance->mRequestInterceptorSignal.Emit(std::move(interceptor));
+
+ std::shared_ptr<Dali::WebEngineLoadError> error(new MockWebEngineLoadError(gInstance->mUrl));
+ gInstance->mPageLoadErrorSignal.Emit(std::move(error));
+ std::shared_ptr<Dali::WebEngineConsoleMessage> message(new MockWebEngineConsoleMessage());
+ gInstance->mConsoleMessageSignal.Emit(std::move(message));
+ std::shared_ptr<Dali::WebEnginePolicyDecision> policyDecision(new MockWebEnginePolicyDecision());
+ gInstance->mPolicyDecisionSignal.Emit(std::move(policyDecision));
+
+ std::shared_ptr<Dali::WebEngineCertificate> certificate(new MockWebEngineCertificate());
+ gInstance->mCertificateConfirmSignal.Emit(std::move(certificate));
+ std::shared_ptr<Dali::WebEngineCertificate> sslCertificate(new MockWebEngineCertificate());
+ gInstance->mSslCertificateChangedSignal.Emit(std::move(sslCertificate));
+ std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler(new MockWebEngineHttpAuthHandler());
+ gInstance->mHttpAuthHandlerSignal.Emit(std::move(handler));
}
return false;
}
Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& WebEngine::FormRepostDecisionSignal()
{
- return Internal::Adaptor::GetImplementation( *this ).FormRepostDecisionSignal();
+ return Internal::Adaptor::GetImplementation(*this).FormRepostDecisionSignal();
}
Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
return Internal::Adaptor::GetImplementation(*this).RequestInterceptorSignal();
}
+Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& WebEngine::ConsoleMessageSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).ConsoleMessageSignal();
+}
+
+Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& WebEngine::PolicyDecisionSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).PolicyDecisionSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).CertificateConfirmSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).SslCertificateChangedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).HttpAuthHandlerSignal();
+}
+
} // namespace Dali;
#include "dali-toolkit-test-utils/toolkit-timer.h"
#include <dali.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine-frame.h>
+#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/key-event-integ.h>
static int gPageLoadStartedCallbackCalled = 0;
static int gPageLoadInProgressCallbackCalled = 0;
static int gPageLoadFinishedCallbackCalled = 0;
+static int gPageLoadErrorCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineLoadError> gPageLoadErrorInstance = nullptr;
static int gScrollEdgeReachedCallbackCalled = 0;
static int gUrlChangedCallbackCalled = 0;
static int gEvaluateJavaScriptCallbackCalled = 0;
static bool gHovered = false;
static bool gWheelEventHandled = false;
static int gFormRepostDecisionCallbackCalled = 0;
-static std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> gFormRepostDecisionInstance;
+static std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> gFormRepostDecisionInstance = nullptr;
static int gFrameRenderedCallbackCalled = 0;
static int gRequestInterceptorCallbackCalled = 0;
static std::shared_ptr<Dali::WebEngineRequestInterceptor> gRequestInterceptorInstance = nullptr;
+static int gConsoleMessageCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineConsoleMessage> gConsoleMessageInstance = nullptr;
+static int gPolicyDecisionCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEnginePolicyDecision> gPolicyDecisionInstance = nullptr;
+static int gCertificateConfirmCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineCertificate> gCertificateConfirmInstance = nullptr;
+static int gSslCertificateChangedCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
+static int gHttpAuthHandlerCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
struct CallbackFunctor
{
gScrollEdgeReachedCallbackCalled++;
}
+static void OnPolicyDecisionRequest(WebView view, std::shared_ptr<Dali::WebEnginePolicyDecision> decision)
+{
+ gPolicyDecisionCallbackCalled++;
+ gPolicyDecisionInstance = std::move(decision);
+}
+
static void OnUrlChanged( WebView view, const std::string& url )
{
gUrlChangedCallbackCalled++;
}
-static void OnPageLoadError( WebView view, const std::string& url, WebView::LoadErrorCode errorCode )
+static void OnPageLoadError(WebView view, std::shared_ptr<Dali::WebEngineLoadError> error)
{
+ gPageLoadErrorCallbackCalled++;
+ gPageLoadErrorInstance = std::move(error);
}
static void OnEvaluateJavaScript( const std::string& result )
static void OnFormRepostDecision(WebView, std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> decision)
{
gFormRepostDecisionCallbackCalled++;
- gFormRepostDecisionInstance = decision;
+ gFormRepostDecisionInstance = std::move(decision);
}
static void OnFrameRendered(WebView)
gRequestInterceptorInstance = std::move(interceptor);
}
+static void OnConsoleMessage(WebView view, std::shared_ptr<Dali::WebEngineConsoleMessage> message)
+{
+ gConsoleMessageCallbackCalled++;
+ gConsoleMessageInstance = std::move(message);
+}
+
+static void OnCertificateConfirm(WebView view, std::shared_ptr<Dali::WebEngineCertificate> certificate )
+{
+ gCertificateConfirmCallbackCalled++;
+ gCertificateConfirmInstance = std::move(certificate);
+}
+
+static void OnSslCertificateChanged(WebView view, std::shared_ptr<Dali::WebEngineCertificate> certificate )
+{
+ gSslCertificateChangedCallbackCalled++;
+ gSslCertificateInstance = std::move(certificate);
+}
+
+static void OnHttpAuthHandler( WebView view, std::shared_ptr<Dali::WebEngineHttpAuthHandler> hander )
+{
+ gHttpAuthHandlerCallbackCalled++;
+ gHttpAuthInstance = std::move(hander);
+}
+
} // namespace
void web_view_startup(void)
assign = copy;
DALI_TEST_CHECK( assign == view );
-
// DownCast Test
tet_infoline( "UtcDaliWebViewBasic DownCast Test" );
BaseHandle handle(view);
DALI_TEST_CHECK( view2 );
DALI_TEST_CHECK( view == view2 );
-
// TypeRegistry Test
tet_infoline( "UtcDaliWebViewBasic TypeRegistry Test" );
TypeRegistry typeRegistry = TypeRegistry::Get();
view.PageLoadStartedSignal().Connect( &OnPageLoadStarted );
view.PageLoadInProgressSignal().Connect( &OnPageLoadInProgress );
view.PageLoadFinishedSignal().Connect( &OnPageLoadFinished );
- view.PageLoadErrorSignal().Connect( &OnPageLoadError );
view.UrlChangedSignal().Connect( &OnUrlChanged );
bool signal1 = false;
bool signal2 = false;
END_TEST;
}
+int UtcDaliWebViewPageLoadErrorConsoleMessage(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+ view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ application.GetScene().Add( view );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( view );
+
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ view.PageLoadErrorSignal().Connect( &OnPageLoadError );
+ view.ConsoleMessageSignal().Connect( &OnConsoleMessage );
+ bool signal1 = false;
+ bool signal2 = false;
+ view.ConnectSignal( testTracker, "pageLoadError", CallbackFunctor(&signal1) );
+ view.ConnectSignal( testTracker, "consoleMessage", CallbackFunctor(&signal2) );
+ DALI_TEST_EQUALS( gPageLoadErrorCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gConsoleMessageCallbackCalled, 0, TEST_LOCATION );
+
+ view.LoadUrl( TEST_URL1 );
+ Test::EmitGlobalTimerSignal();
+ DALI_TEST_EQUALS( gPageLoadErrorCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( gConsoleMessageCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_CHECK( signal1 & signal2);
+
+ // error code.
+ DALI_TEST_CHECK(gPageLoadErrorInstance);
+ DALI_TEST_EQUALS(gPageLoadErrorInstance->GetUrl(), TEST_URL1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadErrorInstance->GetCode(), Dali::WebEngineLoadError::ErrorCode::UNKNOWN, TEST_LOCATION);
+ std::string testErrorDescription("This is an error.");
+ DALI_TEST_EQUALS(gPageLoadErrorInstance->GetDescription(), testErrorDescription, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadErrorInstance->GetType(), Dali::WebEngineLoadError::ErrorType::NONE, TEST_LOCATION);
+
+ // console message.
+ DALI_TEST_CHECK(gConsoleMessageInstance);
+ std::string testConsoleSource("source");
+ DALI_TEST_EQUALS(gConsoleMessageInstance->GetSource(), testConsoleSource, TEST_LOCATION);
+ DALI_TEST_EQUALS(gConsoleMessageInstance->GetLine(), 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(gConsoleMessageInstance->GetSeverityLevel(), Dali::WebEngineConsoleMessage::SeverityLevel::EMPTY, TEST_LOCATION);
+ std::string testConsoleText("This is a text.");
+ DALI_TEST_EQUALS(gConsoleMessageInstance->GetText(), testConsoleText, TEST_LOCATION);
+
+ // reset
+ gPageLoadErrorInstance = nullptr;
+ gConsoleMessageInstance = nullptr;
+
+ END_TEST;
+}
+
int UtcDaliWebViewTouchAndKeys(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliWebViewSslCertificateHttpAuthentication(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+ view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ application.GetScene().Add( view );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( view );
+
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ view.CertificateConfirmSignal().Connect(&OnCertificateConfirm);
+ view.SslCertificateChangedSignal().Connect(&OnSslCertificateChanged);
+ view.HttpAuthHandlerSignal().Connect(&OnHttpAuthHandler);
+ bool signal1 = false;
+ bool signal2 = false;
+ bool signal3 = false;
+ view.ConnectSignal( testTracker, "certificateConfirm", CallbackFunctor(&signal1) );
+ view.ConnectSignal( testTracker, "sslCertificateChanged", CallbackFunctor(&signal2) );
+ view.ConnectSignal( testTracker, "httpAuthRequest", CallbackFunctor(&signal3) );
+ DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 0, TEST_LOCATION );
+
+ view.LoadUrl( TEST_URL1 );
+ Test::EmitGlobalTimerSignal();
+ DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_CHECK( signal1 & signal2 & signal3);
+
+ // certificate.
+ DALI_TEST_CHECK(gCertificateConfirmInstance);
+ gCertificateConfirmInstance->Allow(true);
+ DALI_TEST_CHECK(gCertificateConfirmInstance->IsFromMainFrame());
+
+ DALI_TEST_CHECK(gSslCertificateInstance);
+ DALI_TEST_EQUALS(gSslCertificateInstance->GetPem(), "abc", TEST_LOCATION);
+ DALI_TEST_CHECK(gSslCertificateInstance->IsContextSecure());
+
+ // http authentication.
+ DALI_TEST_CHECK(gHttpAuthInstance);
+ gHttpAuthInstance->Suspend();
+ gHttpAuthInstance->UseCredential("", "");
+ gHttpAuthInstance->CancelCredential();
+ DALI_TEST_EQUALS(gHttpAuthInstance->GetRealm(), "test", TEST_LOCATION);
+
+ // reset
+ gCertificateConfirmInstance = nullptr;
+ gSslCertificateInstance = nullptr;
+ gHttpAuthInstance = nullptr;
+
+ END_TEST;
+}
+
int UtcDaliWebViewGetWebBackForwardList(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliWebViewPolicyDecisionRequest(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ DALI_TEST_CHECK( view );
+
+ // load url.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ view.PolicyDecisionSignal().Connect( &OnPolicyDecisionRequest );
+ bool signal1 = false;
+ view.ConnectSignal( testTracker, "policyDecision", CallbackFunctor(&signal1) );
+ DALI_TEST_EQUALS( gPolicyDecisionCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_CHECK(gPolicyDecisionInstance == 0);
+
+ view.LoadUrl( TEST_URL1 );
+ Test::EmitGlobalTimerSignal();
+ DALI_TEST_EQUALS( gPolicyDecisionCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_CHECK( signal1 );
+
+ // check policy decision & its frame.
+ DALI_TEST_CHECK(gPolicyDecisionInstance != 0);
+ std::string testUrl("http://test.html");
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetUrl(), testUrl, TEST_LOCATION);
+ std::string testCookie("test:abc");
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetCookie(), testCookie, TEST_LOCATION);
+ Dali::WebEnginePolicyDecision::DecisionType testDecisionType = Dali::WebEnginePolicyDecision::DecisionType::USE;
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetDecisionType(), testDecisionType, TEST_LOCATION);
+ std::string testResponseMime("txt/xml");
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetResponseMime(), testResponseMime, TEST_LOCATION);
+ int32_t ResponseStatusCode = 500;
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetResponseStatusCode(), ResponseStatusCode, TEST_LOCATION);
+ Dali::WebEnginePolicyDecision::NavigationType testNavigationType = Dali::WebEnginePolicyDecision::NavigationType::LINK_CLICKED;
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetNavigationType(), testNavigationType, TEST_LOCATION);
+ std::string testScheme("test");
+ DALI_TEST_EQUALS(gPolicyDecisionInstance->GetScheme(), testScheme, TEST_LOCATION);
+ DALI_TEST_CHECK(gPolicyDecisionInstance->Use());
+ DALI_TEST_CHECK(gPolicyDecisionInstance->Ignore());
+ DALI_TEST_CHECK(gPolicyDecisionInstance->Suspend());
+
+ Dali::WebEngineFrame* webFrame = &(gPolicyDecisionInstance->GetFrame());
+ DALI_TEST_CHECK(webFrame);
+ DALI_TEST_CHECK(webFrame->IsMainFrame());
+
+ gPolicyDecisionInstance = nullptr;
+
+ END_TEST;
+}
+
int UtcDaliWebViewEvaluteJavaScript(void)
{
ToolkitTestApplication application;
return Dali::Toolkit::GetImpl(*this).RequestInterceptorSignal();
}
+WebView::WebViewConsoleMessageSignalType& WebView::ConsoleMessageSignal()
+{
+ return Dali::Toolkit::GetImpl(*this).ConsoleMessageSignal();
+}
+
+WebView::WebViewPolicyDecisionSignalType& WebView::PolicyDecisionSignal()
+{
+ return Dali::Toolkit::GetImpl(*this).PolicyDecisionSignal();
+}
+
+WebView::WebViewCertificateSignalType& WebView::CertificateConfirmSignal()
+{
+ return Dali::Toolkit::GetImpl(*this).CertificateConfirmSignal();
+}
+
+WebView::WebViewCertificateSignalType& WebView::SslCertificateChangedSignal()
+{
+ return Dali::Toolkit::GetImpl(*this).SslCertificateChangedSignal();
+}
+
+WebView::WebViewHttpAuthHandlerSignalType& WebView::HttpAuthHandlerSignal()
+{
+ return Dali::Toolkit::GetImpl(*this).HttpAuthHandlerSignal();
+}
+
WebView::WebView(Internal::WebView& implementation)
: Control(implementation)
{
};
/**
- * @brief Enumeration for indicating error code of page loading.
- */
- enum class LoadErrorCode
- {
- UNKNOWN = 0, ///< Unknown.
- CANCELED, ///< User canceled.
- CANT_SUPPORT_MIMETYPE, ///< Can't show the page for this MIME type.
- FAILED_FILE_IO, ///< File IO error.
- CANT_CONNECT, ///< Cannot connect to the network.
- CANT_LOOKUP_HOST, ///< Fail to look up host from the DNS.
- FAILED_TLS_HANDSHAKE, ///< Fail to SSL/TLS handshake.
- INVALID_CERTIFICATE, ///< Received certificate is invalid.
- REQUEST_TIMEOUT, ///< Connection timeout.
- TOO_MANY_REDIRECTS, ///< Too many redirects.
- TOO_MANY_REQUESTS, ///< Too many requests during this load.
- BAD_URL, ///< Malformed URL.
- UNSUPPORTED_SCHEME, ///< Unsupported scheme.
- AUTHENTICATION, ///< User authentication failed on the server.
- INTERNAL_SERVER ///< Web server has an internal server error.
- };
-
- /**
* @brief WebView callback related with screen-shot captured.
*/
using WebViewScreenshotCapturedCallback = std::function<void(Dali::Toolkit::ImageView)>;
/**
* @brief WebView signal type related with page loading error.
*/
- using WebViewPageLoadErrorSignalType = Signal<void(WebView, const std::string&, LoadErrorCode)>;
+ using WebViewPageLoadErrorSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineLoadError>)>;
/**
* @brief WebView signal type related with scroll edge reached.
*/
using WebViewRequestInterceptorSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineRequestInterceptor>)>;
+ /**
+ * @brief WebView signal type related with console message.
+ */
+ using WebViewConsoleMessageSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineConsoleMessage>)>;
+
+ /**
+ * @brief WebView signal type related with policy decision.
+ */
+ using WebViewPolicyDecisionSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEnginePolicyDecision>)>;
+
+ /**
+ * @brief WebView signal type related with certificate changed.
+ */
+ using WebViewCertificateSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineCertificate>)>;
+
+ /**
+ * @brief WebView signal type related with http authentication.
+ */
+ using WebViewHttpAuthHandlerSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
+
public:
/**
* @brief Creates an initialized WebView.
*/
WebViewRequestInterceptorSignalType& RequestInterceptorSignal();
+ /**
+ * @brief Connects to this signal to be notified when console message will be logged.
+ *
+ * @return A signal object to connect with.
+ */
+ WebViewConsoleMessageSignalType& ConsoleMessageSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when new policy would be decided.
+ *
+ * @return A signal object to connect with.
+ */
+ WebViewPolicyDecisionSignalType& PolicyDecisionSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when certificate need be confirmed.
+ *
+ * @return A signal object to connect with.
+ */
+ WebViewCertificateSignalType& CertificateConfirmSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when ssl certificate is changed.
+ *
+ * @return A signal object to connect with.
+ */
+ WebViewCertificateSignalType& SslCertificateChangedSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when http authentication need be confirmed.
+ *
+ * @return A signal object to connect with.
+ */
+ WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
+
public: // Not intended for application developers
/// @cond internal
/**
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
#include <dali/devel-api/common/stage.h>
DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "textZoomFactor", FLOAT, TEXT_ZOOM_FACTOR )
DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "loadProgressPercentage", FLOAT, LOAD_PROGRESS_PERCENTAGE )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted", PAGE_LOAD_STARTED_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress", PAGE_LOAD_IN_PROGRESS_SIGNAL)
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadFinished", PAGE_LOAD_FINISHED_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadError", PAGE_LOAD_ERROR_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "scrollEdgeReached", SCROLL_EDGE_REACHED_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "urlChanged", URL_CHANGED_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "formRepostDecision", FORM_REPOST_DECISION_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "frameRendered", FRAME_RENDERED_SIGNAL )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "requestInterceptor", REQUEST_INTERCEPTOR_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted", PAGE_LOAD_STARTED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress", PAGE_LOAD_IN_PROGRESS_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadFinished", PAGE_LOAD_FINISHED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadError", PAGE_LOAD_ERROR_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "scrollEdgeReached", SCROLL_EDGE_REACHED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "urlChanged", URL_CHANGED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "formRepostDecision", FORM_REPOST_DECISION_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "frameRendered", FRAME_RENDERED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "requestInterceptor", REQUEST_INTERCEPTOR_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "consoleMessage", CONSOLE_MESSAGE_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "policyDecision", POLICY_DECISION )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "certificateConfirm", CERTIFICATE_CONFIRM_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "sslCertificateChanged", SSL_CERTIFICATE_CHANGED_SIGNAL)
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "httpAuthRequest", HTTP_AUTH_REQUEST_SIGNAL )
DALI_TYPE_REGISTRATION_END()
// clang-format on
mPageLoadFinishedSignal(),
mPageLoadErrorSignal(),
mUrlChangedSignal(),
- mVideoHoleEnabled(true),
mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
+ mVideoHoleEnabled(true),
mMouseEventsEnabled(true),
mKeyEventsEnabled(true)
{
mPageLoadFinishedSignal(),
mPageLoadErrorSignal(),
mUrlChangedSignal(),
- mVideoHoleEnabled(true),
mWebViewArea(0, 0, mWebViewSize.width, mWebViewSize.height),
+ mVideoHoleEnabled(true),
mMouseEventsEnabled(true),
mKeyEventsEnabled(true)
{
mWebEngine.FormRepostDecisionSignal().Connect(this, &WebView::OnFormRepostDecision);
mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnFrameRendered);
mWebEngine.RequestInterceptorSignal().Connect(this, &WebView::OnInterceptRequest);
+ mWebEngine.ConsoleMessageSignal().Connect(this, &WebView::OnConsoleMessage);
+ mWebEngine.PolicyDecisionSignal().Connect(this, &WebView::OnPolicyDecisionRequest);
+ mWebEngine.CertificateConfirmSignal().Connect(this, &WebView::OnCertificateConfirm);
+ mWebEngine.SslCertificateChangedSignal().Connect(this, &WebView::OnSslCertificateChanged);
+ mWebEngine.HttpAuthHandlerSignal().Connect(this, &WebView::OnHttpAuthenticationRequest);
mWebContext = std::unique_ptr<Dali::Toolkit::WebContext>(new WebContext(mWebEngine.GetContext()));
mWebCookieManager = std::unique_ptr<Dali::Toolkit::WebCookieManager>(new WebCookieManager(mWebEngine.GetCookieManager()));
return mRequestInterceptorSignal;
}
+Dali::Toolkit::WebView::WebViewConsoleMessageSignalType& WebView::ConsoleMessageSignal()
+{
+ return mConsoleMessageSignal;
+}
+
+Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType& WebView::PolicyDecisionSignal()
+{
+ return mPolicyDecisionSignal;
+}
+
+Dali::Toolkit::WebView::WebViewCertificateSignalType& WebView::CertificateConfirmSignal()
+{
+ return mCertificateConfirmSignal;
+}
+
+Dali::Toolkit::WebView::WebViewCertificateSignalType& WebView::SslCertificateChangedSignal()
+{
+ return mSslCertificateChangedSignal;
+}
+
+Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& WebView::HttpAuthHandlerSignal()
+{
+ return mHttpAuthHandlerSignal;
+}
+
void WebView::OnPageLoadStarted(const std::string& url)
{
if(!mPageLoadStartedSignal.Empty())
}
}
-void WebView::OnPageLoadError(const std::string& url, int errorCode)
+void WebView::OnPageLoadError(std::shared_ptr<Dali::WebEngineLoadError> error)
{
if(!mPageLoadErrorSignal.Empty())
{
Dali::Toolkit::WebView handle(GetOwner());
- mPageLoadErrorSignal.Emit(handle, url, static_cast<Toolkit::WebView::LoadErrorCode>(errorCode));
+ mPageLoadErrorSignal.Emit(handle, std::move(error));
}
}
}
}
+void WebView::OnConsoleMessage(std::shared_ptr<Dali::WebEngineConsoleMessage> message)
+{
+ if(!mConsoleMessageSignal.Empty())
+ {
+ Dali::Toolkit::WebView handle(GetOwner());
+ mConsoleMessageSignal.Emit(handle, std::move(message));
+ }
+}
+
+void WebView::OnPolicyDecisionRequest(std::shared_ptr<Dali::WebEnginePolicyDecision> decision)
+{
+ if(!mPolicyDecisionSignal.Empty())
+ {
+ Dali::Toolkit::WebView handle(GetOwner());
+ mPolicyDecisionSignal.Emit(handle, std::move(decision));
+ }
+}
+
+void WebView::OnCertificateConfirm(std::shared_ptr<Dali::WebEngineCertificate> certificate)
+{
+ if(!mCertificateConfirmSignal.Empty())
+ {
+ Dali::Toolkit::WebView handle(GetOwner());
+ mCertificateConfirmSignal.Emit(handle, std::move(certificate));
+ }
+}
+
+void WebView::OnSslCertificateChanged(std::shared_ptr<Dali::WebEngineCertificate> certificate)
+{
+ if(!mSslCertificateChangedSignal.Empty())
+ {
+ Dali::Toolkit::WebView handle(GetOwner());
+ mSslCertificateChangedSignal.Emit(handle, std::move(certificate));
+ }
+}
+
+void WebView::OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler)
+{
+ if(!mHttpAuthHandlerSignal.Empty())
+ {
+ Dali::Toolkit::WebView handle(GetOwner());
+ mHttpAuthHandlerSignal.Emit(handle, std::move(handler));
+ }
+}
+
bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
{
Dali::BaseHandle handle(object);
webView.RequestInterceptorSignal().Connect(tracker, functor);
connected = true;
}
+ else if(0 == strcmp(signalName.c_str(), CONSOLE_MESSAGE_SIGNAL))
+ {
+ webView.ConsoleMessageSignal().Connect(tracker, functor);
+ connected = true;
+ }
+ else if(0 == strcmp(signalName.c_str(), POLICY_DECISION))
+ {
+ webView.PolicyDecisionSignal().Connect(tracker, functor);
+ connected = true;
+ }
+ else if(0 == strcmp(signalName.c_str(), CERTIFICATE_CONFIRM_SIGNAL))
+ {
+ webView.CertificateConfirmSignal().Connect(tracker, functor);
+ connected = true;
+ }
+ else if(0 == strcmp(signalName.c_str(), SSL_CERTIFICATE_CHANGED_SIGNAL))
+ {
+ webView.SslCertificateChangedSignal().Connect(tracker, functor);
+ connected = true;
+ }
+ else if(0 == strcmp(signalName.c_str(), HTTP_AUTH_REQUEST_SIGNAL))
+ {
+ webView.HttpAuthHandlerSignal().Connect(tracker, functor);
+ connected = true;
+ }
return connected;
}
*/
Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType& RequestInterceptorSignal();
+ /**
+ * @copydoc Dali::Toolkit::WebView::ConsoleMessageSignal()
+ */
+ Dali::Toolkit::WebView::WebViewConsoleMessageSignalType& ConsoleMessageSignal();
+
+ /**
+ * @copydoc Dali::Toolkit::WebView::PolicyDecisionSignal()
+ */
+ Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType& PolicyDecisionSignal();
+
+ /**
+ * @copydoc Dali::Toolkit::WebView::CertificateConfirmSignal()
+ */
+ Dali::Toolkit::WebView::WebViewCertificateSignalType& CertificateConfirmSignal();
+
+ /**
+ * @copydoc Dali::Toolkit::WebView::SslCertificateChangedSignal()
+ */
+ Dali::Toolkit::WebView::WebViewCertificateSignalType& SslCertificateChangedSignal();
+
+ /**
+ * @copydoc Dali::Toolkit::WebView::HttpAuthHandlerSignal()
+ */
+ Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
+
public: // Properties
/**
* @brief Called when a property of an object of this type is set.
WebView& operator=(const WebView& webView);
/**
- * @brief Sets an absolute scroll of the given view.
+ * @brief Set an absolute scroll of the given view.
* @param[in] x The coordinate x of scroll
* @param[in] y The coordinate y of scroll
*/
Dali::Vector2 GetScrollPosition() const;
/**
- * @brief Gets the possible scroll size of the given view.
+ * @brief Get the possible scroll size of the given view.
* @param[out] width The width of scroll size
* @param[out] height The height of scroll size
*/
Dali::Vector2 GetScrollSize() const;
/**
- * @brief Gets the last known content's size.
+ * @brief Get the last known content's size.
* @param[out] width The width of content's size
* @param[out] height The height of content's size
*/
Dali::Vector2 GetContentSize() const;
/**
- * @brief Returns the title of the Web.
+ * @brief Return the title of the Web.
*
* @return The title of web page
*/
std::string GetTitle() const;
/**
- * @brief Sets the background color of web page.
+ * @brief Set the background color of web page.
* @param[in] color The value of background color.
*/
void SetDocumentBackgroundColor(Dali::Vector4 color);
/**
- * @brief Clears tiles when hidden.
+ * @brief Clear tiles when hidden.
*
* @param[in] cleared Whether tiles are cleared or not
*/
void ClearTilesWhenHidden(bool cleared);
/**
- * @brief Sets multiplier of cover area of tile.
+ * @brief Set multiplier of cover area of tile.
*
* @param[in] multiplier The multiplier of cover area
*/
void SetTileCoverAreaMultiplier(float multiplier);
/**
- * @brief Enables cursor by client.
+ * @brief Enable cursor by client.
* @param[in] enabled Whether cursor is enabled or not.
*/
void EnableCursorByClient(bool enabled);
/**
- * @brief Gets the selected text.
+ * @brief Get the selected text.
* @return The selected text
*/
std::string GetSelectedText() const;
void SetUserAgent(const std::string& userAgent);
/**
- * @brief Sets zoom factor of the current page.
+ * @brief Set zoom factor of the current page.
* @param[in] zoomFactor a new factor to be set.
*/
void SetPageZoomFactor(float zoomFactor);
/**
- * @brief Queries the current zoom factor of the page。
+ * @brief Query the current zoom factor of the page。
* @return The current page zoom factor.
*/
float GetPageZoomFactor() const;
/**
- * @brief Sets the current text zoom level。.
+ * @brief Set the current text zoom level。.
* @param[in] zoomFactor a new factor to be set.
*/
void SetTextZoomFactor(float zoomFactor);
/**
- * @brief Gets the current text zoom level.
+ * @brief Get the current text zoom level.
* @return The current text zoom factor.
*/
float GetTextZoomFactor() const;
/**
- * @brief Gets the current load progress of the page.
+ * @brief Get the current load progress of the page.
* @return The load progress of the page.
*/
float GetLoadProgressPercentage() const;
bool SetVisibility(bool visible);
/**
- * @brief Updates display area of web view.
+ * @brief Update display area of web view.
* @param[in] source The soource triggers Notification.
*/
void UpdateDisplayArea(Dali::PropertyNotification& source);
void EnableBlendMode(bool blendEnabled);
/**
- * @brief Enables/disables mouse events. The default is enabled.
+ * @brief Enable/disable mouse events. The default is enabled.
*
* @param[in] enabled True if mouse events are enabled, false otherwise
*/
void EnableMouseEvents(bool enabled);
/**
- * @brief Enables/disables key events. The default is enabled.
+ * @brief Enable/disable key events. The default is enabled.
*
* @param[in] enabled True if key events enabled, false otherwise
*/
* @param[in] url The url currently being loaded
* @param[in] errorCode The error code
*/
- void OnPageLoadError(const std::string& url, int errorCode);
+ void OnPageLoadError(std::shared_ptr<Dali::WebEngineLoadError> error);
/**
* @brief Callback function to be called when scroll edge is reached.
- * @param[in] e The scroll edge reached.
+ * @param[in] edge The scroll edge reached.
*/
void OnScrollEdgeReached(Dali::WebEnginePlugin::ScrollEdge edge);
*/
void OnInterceptRequest(std::shared_ptr<Dali::WebEngineRequestInterceptor> interceptor);
+ /**
+ * @brief Callback function to be called when console message will be logged.
+ * @param[in] message The message logged.
+ */
+ void OnConsoleMessage(std::shared_ptr<Dali::WebEngineConsoleMessage> message);
+
+ /**
+ * @brief Callback function to be called when policy need be decided.
+ * @param[in] decision The policy decided.
+ */
+ void OnPolicyDecisionRequest(std::shared_ptr<Dali::WebEnginePolicyDecision> decision);
+
+ /**
+ * @brief Callback function to be called when certificate need be confirmed.
+ * @param[in] certificate The certificate policy decision.
+ */
+ void OnCertificateConfirm(std::shared_ptr<Dali::WebEngineCertificate> certificate);
+
+ /**
+ * @brief Callback function to be called when ssl certificate is changed.
+ * @param[in] certificate The certificate information received.
+ */
+ void OnSslCertificateChanged(std::shared_ptr<Dali::WebEngineCertificate> certificate);
+
+ /**
+ * @brief Callback function to be called when http authentication need be confirmed.
+ * @param[in] handler The handler for http authentication
+ */
+ void OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler);
+
private:
std::string mUrl;
Dali::Toolkit::Visual::Base mVisual;
Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType mFormRepostDecisionSignal;
Dali::Toolkit::WebView::WebViewFrameRenderedSignalType mFrameRenderedSignal;
Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType mRequestInterceptorSignal;
+ Dali::Toolkit::WebView::WebViewConsoleMessageSignalType mConsoleMessageSignal;
+ Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType mPolicyDecisionSignal;
+ Dali::Toolkit::WebView::WebViewCertificateSignalType mCertificateConfirmSignal;
+ Dali::Toolkit::WebView::WebViewCertificateSignalType mSslCertificateChangedSignal;
+ Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType mHttpAuthHandlerSignal;
std::unique_ptr<Dali::Toolkit::WebContext> mWebContext;
std::unique_ptr<Dali::Toolkit::WebCookieManager> mWebCookieManager;
Dali::PropertyNotification mPositionUpdateNotification;
Dali::PropertyNotification mSizeUpdateNotification;
Dali::PropertyNotification mScaleUpdateNotification;
- bool mVideoHoleEnabled;
Dali::Rect<int> mWebViewArea;
+ bool mVideoHoleEnabled;
bool mMouseEventsEnabled;
bool mKeyEventsEnabled;