diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-01-18 15:40:56 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-01-19 23:13:47 +0100 |
commit | a7510e85e6f53f4e889307edb58f26c8900d2d06 (patch) | |
tree | d4b6208bb8bf7d8288c57d7024c2813b3af1b5aa /src/core/web_contents_adapter.cpp | |
parent | 91696b2cb090e5b6147a30465f74d8d37db48615 (diff) | |
parent | f1f763cf3c7254406b7b6f01551b6624210bb834 (diff) |
Merge branch '5.15' into dev
Last commits before 87 update.
Change-Id: Id156b0199a8fd354c946cfe604ae8541ba554658
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index db2069fe7..7ba65f2bb 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" @@ -512,7 +513,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++; } @@ -1414,8 +1415,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 @@ -1989,14 +1993,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); |