diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-21 14:35:01 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-21 14:35:01 +0100 |
commit | 432af50e930b7f11455fc1daec17d9c215ea88ee (patch) | |
tree | 75f8e9cc04069de32c25660298c4fce046f88b4e /src/core/web_contents_adapter.cpp | |
parent | 809afc26fe0c47b249cf11376c8ea484a2bfaaf1 (diff) | |
parent | d5a479a720ee76fae9fa7b0f7b6b3d0a61718ff0 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: If771fabe97c4d75edc4627999f04f70ca1901060
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index fe31a5b51..607412e16 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -240,9 +240,13 @@ static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsA content::WebContents::CreateParams create_params(browserContext, NULL); create_params.routing_id = MSG_ROUTING_NONE; create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); - create_params.context = reinterpret_cast<gfx::NativeView>(adapterClient); create_params.initially_hidden = true; - return content::WebContents::Create(create_params); + + std::unique_ptr<content::WebContents> webContents = content::WebContents::Create(create_params); + WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(static_cast<content::WebContentsImpl*>(webContents.get())->GetView()); + contentsView->setClient(adapterClient); + + return webContents; } static void serializeNavigationHistory(const content::NavigationController &controller, QDataStream &output) @@ -468,7 +472,6 @@ void WebContentsAdapter::initialize(content::SiteInstance *site) if (!m_webContents) { content::WebContents::CreateParams create_params(m_profileAdapter->profile(), site); create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); - create_params.context = reinterpret_cast<gfx::NativeView>(m_adapterClient); create_params.initially_hidden = true; m_webContents = content::WebContents::Create(create_params); } @@ -506,7 +509,7 @@ void WebContentsAdapter::initialize(content::SiteInstance *site) // Let the WebContent's view know about the WebContentsAdapterClient. WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(static_cast<content::WebContentsImpl*>(m_webContents.get())->GetView()); - contentsView->initialize(m_adapterClient); + contentsView->setClient(m_adapterClient); // This should only be necessary after having restored the history to a new WebContentsAdapter. m_webContents->GetController().LoadIfNecessary(); |