diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-15 11:30:19 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-18 10:29:40 +0000 |
commit | 65909d55417c78e88308644dea30a65fae2d9c4a (patch) | |
tree | fba86d055bc31f5f00f704aec3f953edbeabd08b /src/core/web_contents_delegate_qt.cpp | |
parent | e9f3b5a7d1609a169a6b6339b7b8a3c0be191efb (diff) |
Remove hack with passing WebContentsAdapterClient as NativeView
Instead delay creating our render view just a little bit further in
WebContentImpl::OpenWindow until it calls delegate->WebContentsCreated()
Change-Id: Idd911d208bbfe419a2567220933eccb2ba726347
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 4fcf2944d..ade29c770 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -58,12 +58,14 @@ #include "visited_links_manager_qt.h" #include "web_contents_adapter_client.h" #include "web_contents_adapter.h" +#include "web_contents_view_qt.h" #include "web_engine_context.h" #include "web_engine_settings.h" #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" #include "components/web_cache/browser/web_cache_manager.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/file_select_listener.h" #include "content/public/browser/invalidate_type.h" @@ -414,9 +416,11 @@ void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::Favic void WebContentsDelegateQt::WebContentsCreated(content::WebContents */*source_contents*/, int /*opener_render_process_id*/, int /*opener_render_frame_id*/, const std::string &/*frame_name*/, - const GURL &target_url, content::WebContents */*new_contents*/) + const GURL &target_url, content::WebContents *newContents) { m_initialTargetUrl = toQt(target_url); + if (auto *view = static_cast<content::WebContentsImpl *>(newContents)->GetView()) + static_cast<WebContentsViewQt *>(view)->setFactoryClient(m_viewClient); } content::ColorChooser *WebContentsDelegateQt::OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestion) |