summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-10-29 11:22:51 +0100
committerMichal Klocek <michal.klocek@qt.io>2020-12-11 20:51:50 +0100
commitb2325276152766de8b8aa87e5e5daeb7c2114b35 (patch)
tree5510365c5580a43d51b4767834f475299e39ac16 /src/core/web_contents_adapter.cpp
parentc175a7fbea6b707de9544ff02eb7351600a3a71b (diff)
Migrate render_view_observer_qt to mojo
Since mojo interface no longer works on render view, but on render frame rename the class to be WebEnginePageHost and WebEnginePageRenderFrame Keep SetBackgroundColor render message, since it is required to things work. Change-Id: I4d6b70dd448926f8ac2d75d2b87f3d490a4cfefb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index a44b3316e..18fa9d922 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -53,7 +53,7 @@
#include "profile_adapter.h"
#include "profile_qt.h"
#include "qwebenginecallback_p.h"
-#include "renderer_host/render_view_observer_host_qt.h"
+#include "renderer_host/web_engine_page_host.h"
#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
#include "web_contents_view_qt.h"
@@ -96,6 +96,7 @@
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/base/clipboard/custom_data_helper.h"
#include "ui/gfx/font_render_params.h"
+#include "qtwebengine/browser/qtwebenginepage.mojom.h"
#if QT_CONFIG(webengine_webchannel)
#include "renderer_host/web_channel_ipc_transport_host.h"
@@ -511,7 +512,7 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
// Create and attach observers to the WebContents.
m_webContentsDelegate.reset(new WebContentsDelegateQt(m_webContents.get(), m_adapterClient));
- m_renderViewObserverHost.reset(new RenderViewObserverHostQt(m_webContents.get(), m_adapterClient));
+ m_pageHost.reset(new WebEnginePageHost(m_webContents.get(), m_adapterClient));
// Let the WebContent's view know about the WebContentsAdapterClient.
WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(static_cast<content::WebContentsImpl*>(m_webContents.get())->GetView());
@@ -1078,14 +1079,14 @@ quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScrip
quint64 WebContentsAdapter::fetchDocumentMarkup()
{
CHECK_INITIALIZED(0);
- m_renderViewObserverHost->fetchDocumentMarkup(m_nextRequestId);
+ m_pageHost->FetchDocumentMarkup(m_nextRequestId);
return m_nextRequestId++;
}
quint64 WebContentsAdapter::fetchDocumentInnerText()
{
CHECK_INITIALIZED(0);
- m_renderViewObserverHost->fetchDocumentInnerText(m_nextRequestId);
+ m_pageHost->FetchDocumentInnerText(m_nextRequestId);
return m_nextRequestId++;
}
@@ -1415,8 +1416,11 @@ void WebContentsAdapter::handlePendingMouseLockPermission()
void WebContentsAdapter::setBackgroundColor(const QColor &color)
{
CHECK_INITIALIZED();
+ SkColor c = toSk(color);
if (content::RenderWidgetHostView *rwhv = m_webContents->GetRenderWidgetHostView())
- rwhv->SetBackgroundColor(toSk(color));
+ rwhv->SetBackgroundColor(c);
+ if (color != Qt::transparent)
+ m_pageHost->SetBackgroundColor(c);
}
content::WebContents *WebContentsAdapter::webContents() const
@@ -1990,14 +1994,14 @@ void WebContentsAdapter::discard()
m_webChannel = nullptr;
m_webChannelWorld = 0;
#endif
- m_renderViewObserverHost.reset();
+ m_pageHost.reset();
m_webContentsDelegate.reset();
m_webContents.reset();
m_webContents = std::move(nullContents);
initializeRenderPrefs();
m_webContentsDelegate = std::move(nullDelegate);
- m_renderViewObserverHost.reset(new RenderViewObserverHostQt(m_webContents.get(), m_adapterClient));
+ m_pageHost.reset(new WebEnginePageHost(m_webContents.get(), m_adapterClient));
WebContentsViewQt *contentsView =
static_cast<WebContentsViewQt *>(static_cast<content::WebContentsImpl *>(m_webContents.get())->GetView());
contentsView->setClient(m_adapterClient);