From db62139e1daea171e08d95592c63f663789d6391 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 1 Aug 2018 15:04:35 +0200 Subject: Make WebChannel an optional feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann --- src/core/web_contents_adapter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core/web_contents_adapter.cpp') 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 +#endif + #include #include #include @@ -100,7 +104,6 @@ #include #include #include -#include namespace QtWebEngineCore { @@ -386,8 +389,10 @@ QSharedPointer 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) -- cgit v1.2.3