--- /dev/null
+#ifndef DALI_WEB_ENGINE_CERTIFICATE_H
+#define DALI_WEB_ENGINE_CERTIFICATE_H
+
+/*
+ * Copyright (c) 2021 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.
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+
+namespace Dali
+{
+/**
+ * @brief A class WebEngineCertificate for certificate of web engine.
+ */
+class WebEngineCertificate
+{
+public:
+ /**
+ * @brief Constructor.
+ */
+ WebEngineCertificate() = default;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~WebEngineCertificate() = default;
+
+ /**
+ * @brief Allow the site access about certificate error.
+ *
+ * @param[in] allowed A value to decide policy
+ */
+ virtual void Allow(bool allowed) = 0;
+
+ /**
+ * @brief Returns information whether the certificate comes from main frame.
+ *
+ * @return true if the certificate comes from main frame, false otherwise
+ */
+ virtual bool IsFromMainFrame() const = 0;
+
+ /**
+ * @brief Query certificate's PEM data.
+ *
+ * @return A certificate itself in the PEM format.
+ */
+ virtual std::string GetPem() const = 0;
+
+ /**
+ * @brief Query if the context loaded with a given certificate is secure.
+ *
+ * @return true if the context is secure, false otherwise
+ */
+ virtual bool IsContextSecure() const = 0;
+};
+
+} // namespace Dali
+
+#endif // DALI_WEB_ENGINE_CERTIFICATE_H
--- /dev/null
+#ifndef DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H
+#define DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H
+
+/*
+ * Copyright (c) 2021 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.
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+
+namespace Dali
+{
+/**
+ * @brief A class WebEngineHttpAuthHandler for HTTP authentication handler of web engine.
+ */
+class WebEngineHttpAuthHandler
+{
+public:
+ /**
+ * @brief Constructor.
+ */
+ WebEngineHttpAuthHandler() = default;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~WebEngineHttpAuthHandler() = default;
+
+ /**
+ * @brief Gets the realm string of authentication challenge received.
+ *
+ * @return the realm of authentication challenge
+ */
+ virtual std::string GetRealm() const = 0;
+
+ /**
+ * @brief Suspend the operation for authentication challenge.
+ */
+ virtual void Suspend() = 0;
+
+ /**
+ * @brief Send credential for authentication challenge.
+ *
+ * @param[in] user user id from user input.
+ * @param[in] password user password from user input.
+ */
+ virtual void UseCredential(const std::string& user, const std::string& password) = 0;
+
+ /**
+ * @brief Send cancellation notification for authentication challenge.
+ */
+ virtual void CancelCredential() = 0;
+};
+
+} // namespace Dali
+
+#endif // DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H
class PixelData;
class TouchEvent;
class WebEngineBackForwardList;
+class WebEngineCertificate;
class WebEngineConsoleMessage;
class WebEngineContext;
class WebEngineCookieManager;
class WebEngineFormRepostDecision;
+class WebEngineHttpAuthHandler;
class WebEngineLoadError;
class WebEnginePolicyDecision;
class WebEngineRequestInterceptor;
using WebEngineConsoleMessageSignalType = Signal<void(std::shared_ptr<Dali::WebEngineConsoleMessage>)>;
/**
+ * @brief WebView signal type related with certificate changed.
+ */
+ using WebEngineCertificateSignalType = Signal<void(std::shared_ptr<Dali::WebEngineCertificate>)>;
+
+ /**
+ * @brief WebView signal type related with http authentication.
+ */
+ using WebEngineHttpAuthHandlerSignalType = Signal<void(std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
+
+ /**
* @brief Alert callback when JavaScript alert is called with a message.
* It returns true if a pop-up is created successfully, false otherwise.
*/
* @return A signal object to connect with.
*/
virtual WebEnginePolicyDecisionSignalType& PolicyDecisionSignal() = 0;
+
+ /**
+ * @brief Connects to this signal to be notified when certificate need be confirmed.
+ *
+ * @return A signal object to connect with.
+ */
+ virtual WebEngineCertificateSignalType& CertificateConfirmSignal() = 0;
+
+ /**
+ * @brief Connects to this signal to be notified when ssl certificate is changed.
+ *
+ * @return A signal object to connect with.
+ */
+ virtual WebEngineCertificateSignalType& SslCertificateChangedSignal() = 0;
+
+ /**
+ * @brief Connects to this signal to be notified when http authentication need be confirmed.
+ *
+ * @return A signal object to connect with.
+ */
+ virtual WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal() = 0;
};
// specialization has to be done in the same namespace
// INTERNAL 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-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>
return GetImplementation(*this).PolicyDecisionSignal();
}
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal()
+{
+ return GetImplementation(*this).CertificateConfirmSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal()
+{
+ return GetImplementation(*this).SslCertificateChangedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal()
+{
+ return GetImplementation(*this).HttpAuthHandlerSignal();
+}
+
} // namespace Dali
*/
Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal();
+ /**
+ * @brief Connects to this signal to be notified when certificate need be confirmed.
+ *
+ * @return A signal object to connect with.
+ */
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when ssl certificate is changed.
+ *
+ * @return A signal object to connect with.
+ */
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal();
+
+ /**
+ * @brief Connects to this signal to be notified when http authentication need be confirmed.
+ *
+ * @return A signal object to connect with.
+ */
+ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
+
private: // Not intended for application developers
/**
* @brief Internal constructor
${adaptor_devel_api_dir}/adaptor-framework/web-engine.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list-item.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine-certificate.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-console-message.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-context.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-cookie-manager.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-form-repost-decision.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-frame.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine-http-auth-handler.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-load-error.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-plugin.h
${adaptor_devel_api_dir}/adaptor-framework/web-engine-policy-decision.h
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
#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-request-interceptor.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/internal/system/common/environment-variables.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
{
- mPlugin->RegisterJavaScriptAlertCallback(callback);
+ mPlugin->RegisterJavaScriptConfirmCallback(callback);
}
void WebEngine::JavaScriptConfirmReply(bool confirmed)
return mPlugin->PolicyDecisionSignal();
}
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::CertificateConfirmSignal()
+{
+ return mPlugin->CertificateConfirmSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineCertificateSignalType& WebEngine::SslCertificateChangedSignal()
+{
+ return mPlugin->SslCertificateChangedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHandlerSignal()
+{
+ return mPlugin->HttpAuthHandlerSignal();
+}
+
} // namespace Adaptor
} // namespace Internal
} // namespace Dali
*/
Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal();
+ /**
+ * @copydoc Dali::WebEngine::CertificateConfirmSignal()
+ */
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal();
+
+ /**
+ * @copydoc Dali::WebEngine::SslCertificateChangedSignal()
+ */
+ Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal();
+
+ /**
+ * @copydoc Dali::WebEngine::HttpAuthHandlerSignal()
+ */
+ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
+
private:
/**
* @brief Constructor.