Commit f6afa45d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Move in webengineviewer too

parent 4b34f0b7
Pipeline #55639 canceled with stage
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(PIM_VERSION "5.17.42")
set(PIM_VERSION "5.17.43")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -48,7 +48,6 @@ if(BUILD_TESTING)
add_subdirectory(widgets/autotests/)
add_subdirectory(utils/autotests)
add_subdirectory(viewer/renderer/autotests)
add_subdirectory(viewer/webengine/blockexternalresourcesurlinterceptor/autotests)
add_subdirectory(remote-content/autotests)
endif()
add_subdirectory(pics)
......@@ -121,7 +120,6 @@ set(libmessageviewer_mailviewer_SRCS
viewer/webengine/mailwebenginepage.cpp
viewer/webengine/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.cpp
viewer/webengine/cidreferencesurlinterceptor/cidreferencesurlinterceptor.cpp
viewer/webengine/blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.cpp
viewer/webengine/cidschemehandler/cidschemehandler.cpp
)
......
......@@ -5,7 +5,6 @@
*/
#include "mailwebengineview.h"
#include "../urlhandlermanager.h"
#include "blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.h"
#include "cidreferencesurlinterceptor/cidreferencesurlinterceptor.h"
#include "cidschemehandler/cidschemehandler.h"
#include "loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.h"
......@@ -13,6 +12,7 @@
#include "messageviewer/messageviewersettings.h"
#include "webengineviewer/webengineaccesskey.h"
#include "webengineviewer/webenginescript.h"
#include <WebEngineViewer/BlockExternalResourcesUrlInterceptor>
#include <WebEngineViewer/BlockMailTrackingUrlInterceptor>
#include <WebEngineViewer/InterceptorManager>
#include <WebEngineViewer/WebEngineManageScript>
......@@ -86,8 +86,8 @@ MailWebEngineView::MailWebEngineView(KActionCollection *ac, QWidget *parent)
d->mNetworkAccessManager->addInterceptor(d->mExternalReference);
auto cidReference = new MessageViewer::CidReferencesUrlInterceptor(this);
d->mNetworkAccessManager->addInterceptor(cidReference);
auto blockExternalUrl = new MessageViewer::BlockExternalResourcesUrlInterceptor(this);
connect(blockExternalUrl, &BlockExternalResourcesUrlInterceptor::formSubmittedForbidden, this, &MailWebEngineView::formSubmittedForbidden);
auto blockExternalUrl = new WebEngineViewer::BlockExternalResourcesUrlInterceptor(this);
connect(blockExternalUrl, &WebEngineViewer::BlockExternalResourcesUrlInterceptor::formSubmittedForbidden, this, &MailWebEngineView::formSubmittedForbidden);
d->mNetworkAccessManager->addInterceptor(blockExternalUrl);
d->mBlockMailTrackingUrl = new WebEngineViewer::BlockMailTrackingUrlInterceptor(this);
......
......@@ -9,6 +9,7 @@ if(BUILD_TESTING)
add_subdirectory(findbar/autotests)
add_subdirectory(checkphishingurl/autotests/)
add_subdirectory(checkphishingurl/tests/)
add_subdirectory(urlinterceptor/blockexternalresourcesurlinterceptor/autotests)
endif()
......@@ -52,6 +53,7 @@ set(libwebengineviewer_interceptor_SRCS
urlinterceptor/networkpluginurlinterceptorconfigurewidget.cpp
urlinterceptor/blockmailtrackingurlinterceptor/blockmailtrackingurlinterceptor.cpp
urlinterceptor/loadexternalreferencesurlinterceptor/loadexternalreferencesurlinterceptor.cpp
urlinterceptor/blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.cpp
)
set(libwebengineviewer_accesskey_SRCS
......@@ -214,6 +216,16 @@ ecm_generate_headers(WebEngineViewer_Camelloadexternalreferencesurlinterceptor_H
RELATIVE urlinterceptor/loadexternalreferencesurlinterceptor/
)
ecm_generate_headers(WebEngineViewer_Camelblockexternalresourcesurlinterceptor_HEADERS
HEADER_NAMES
BlockExternalResourcesUrlInterceptor
REQUIRED_HEADERS WebEngineViewer_blockexternalresourcesurlinterceptor_HEADERS
PREFIX WebEngineViewer
RELATIVE urlinterceptor/blockexternalresourcesurlinterceptor/
)
ecm_generate_pri_file(BASE_NAME WebEngineViewer
LIB_NAME KF5WebEngineViewer
DEPS "webenginewidgets PimCommon" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/WebEngineViewer
......@@ -221,6 +233,7 @@ ecm_generate_pri_file(BASE_NAME WebEngineViewer
install(FILES
${WebEngineViewer_Camelblockexternalresourcesurlinterceptor_HEADERS}
${WebEngineViewer_Camelloadexternalreferencesurlinterceptor_HEADERS}
${WebEngineViewer_Camelblockmailtrackingurlinterceptor_HEADERS}
${WebEngineViewer_Camelcasewebengine_checkurl_HEADERS}
......@@ -236,6 +249,7 @@ install(FILES
)
install(FILES
${WebEngineViewer_blockexternalresourcesurlinterceptor_HEADERS}
${WebEngineViewer_loadexternalreferencesurlinterceptor_HEADERS}
${WebEngineViewer_blockmailtrackingurlinterceptor_HEADERS}
${WebEngineViewer_webengine_checkurl_HEADERS}
......
......@@ -5,9 +5,9 @@
*/
#include "blockexternalresourcesurlinterceptortest.h"
#include "viewer/webengine/blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.h"
#include <QStandardPaths>
#include <QTest>
#include <WebEngineViewer/BlockExternalResourcesUrlInterceptor>
QTEST_GUILESS_MAIN(BlockExternalResourcesUrlInterceptorTest)
BlockExternalResourcesUrlInterceptorTest::BlockExternalResourcesUrlInterceptorTest(QObject *parent)
: QObject(parent)
......@@ -17,7 +17,7 @@ BlockExternalResourcesUrlInterceptorTest::BlockExternalResourcesUrlInterceptorTe
void BlockExternalResourcesUrlInterceptorTest::shouldIntercept()
{
MessageViewer::BlockExternalResourcesUrlInterceptor interceptor;
WebEngineViewer::BlockExternalResourcesUrlInterceptor interceptor;
QVERIFY(!interceptor.interceptRequest(QUrl(QStringLiteral("file://")),
QWebEngineUrlRequestInfo::ResourceType::ResourceTypeMedia,
QWebEngineUrlRequestInfo::NavigationType::NavigationTypeReload));
......
......@@ -5,7 +5,7 @@
*/
#include "blockexternalresourcesurlinterceptor.h"
using namespace MessageViewer;
using namespace WebEngineViewer;
BlockExternalResourcesUrlInterceptor::BlockExternalResourcesUrlInterceptor(QObject *parent)
: WebEngineViewer::NetworkPluginUrlInterceptorInterface(parent)
......
......@@ -5,13 +5,13 @@
*/
#pragma once
#include "messageviewer_private_export.h"
#include "webengineviewer_export.h"
#include <QUrl>
#include <QWebEngineUrlRequestInfo>
#include <WebEngineViewer/NetworkPluginUrlInterceptorInterface>
namespace MessageViewer
namespace WebEngineViewer
{
class MESSAGEVIEWER_TESTS_EXPORT BlockExternalResourcesUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
class WEBENGINEVIEWER_EXPORT BlockExternalResourcesUrlInterceptor : public WebEngineViewer::NetworkPluginUrlInterceptorInterface
{
Q_OBJECT
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment