summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-08-01 15:04:35 +0200
committerMichal Klocek <michal.klocek@qt.io>2018-08-09 09:39:56 +0000
commitdb62139e1daea171e08d95592c63f663789d6391 (patch)
treeddce513a2e74bf656466a6f83b57a8efbd3cbe18 /src/core/web_contents_adapter.cpp
parente50fb187dc4467ac28a724e6ea9f2d51a1f131ba (diff)
Make WebChannel an optional feature
Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index ec1416010..e65ab9d07 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -52,7 +52,6 @@
#include "printing/print_view_manager_qt.h"
#include "profile_qt.h"
#include "qwebenginecallback_p.h"
-#include "renderer_host/web_channel_ipc_transport_host.h"
#include "render_view_observer_host_qt.h"
#include "type_conversion.h"
#include "web_contents_view_qt.h"
@@ -87,6 +86,11 @@
#include "ui/base/clipboard/custom_data_helper.h"
#include "ui/gfx/font_render_params.h"
+#if QT_CONFIG(webengine_webchannel)
+#include "renderer_host/web_channel_ipc_transport_host.h"
+#include <QtWebChannel/QWebChannel>
+#endif
+
#include <QDir>
#include <QGuiApplication>
#include <QPageLayout>
@@ -100,7 +104,6 @@
#include <QtGui/qaccessible.h>
#include <QtGui/qdrag.h>
#include <QtGui/qpixmap.h>
-#include <QtWebChannel/QWebChannel>
namespace QtWebEngineCore {
@@ -386,8 +389,10 @@ QSharedPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavig
WebContentsAdapter::WebContentsAdapter(content::WebContents *webContents)
: m_profileAdapter(nullptr)
, m_webContents(webContents)
+#if QT_CONFIG(webengine_webchannel)
, m_webChannel(nullptr)
, m_webChannelWorld(0)
+#endif
, m_adapterClient(nullptr)
, m_nextRequestId(CallbackDirectory::ReservedCallbackIdsEnd)
, m_lastFindRequestId(0)
@@ -1270,6 +1275,7 @@ content::WebContents *WebContentsAdapter::webContents() const
return m_webContents.get();
}
+#if QT_CONFIG(webengine_webchannel)
QWebChannel *WebContentsAdapter::webChannel() const
{
return m_webChannel;
@@ -1299,6 +1305,7 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId)
}
channel->connectTo(m_webChannelTransport.get());
}
+#endif
#if QT_CONFIG(draganddrop)
static QMimeData *mimeDataFromDropData(const content::DropData &dropData)