diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 6 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index e0fb3d7d8..409514411 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -49,6 +49,7 @@ #include "web_engine_settings.h" #include "web_engine_visited_links_manager.h" +#include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/browser/favicon_status.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_entry.h" @@ -60,6 +61,7 @@ #include "content/public/common/frame_navigate_params.h" #include "content/public/common/url_constants.h" #include "content/public/common/web_preferences.h" +#include "ui/events/latency_info.h" namespace QtWebEngineCore { @@ -115,9 +117,13 @@ void WebContentsDelegateQt::NavigationStateChanged(const content::WebContents* s void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) { + Q_UNUSED(source) WebContentsAdapter *newAdapter = createWindow(new_contents, disposition, initial_pos, user_gesture); if (was_blocked) *was_blocked = !newAdapter; + + if (content::RenderWidgetHostImpl *impl = content::RenderWidgetHostImpl::From(new_contents->GetRenderViewHost())) + impl->WasShown(ui::LatencyInfo()); } void WebContentsDelegateQt::CloseContents(content::WebContents *source) diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 85d400caf..72ccb128a 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -559,7 +559,7 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent return; } - if (browserContextAdapter() != webContents->browserContextAdapter()) { + if (webContents->browserContextAdapter() && browserContextAdapter() != webContents->browserContextAdapter()) { qWarning("Can not adopt content from a different WebEngineProfile."); return; } |