user avatar
Implement window creation through QWebEnginePage::createWindow.
Jocelyn Turcotte authored
This makes the necessary changes to handle
WebContentsDelegateQt::AddNewContents and funnel the callback
through createWindow in QWebEnginePage and QWebEngineView.

- Expose the AddNewContents callback through WebContentsAdapterClient
- Allow creating a WebContentsAdapter attached only on the Chromium side,
  leaving the choice to QWebEnginePage to either adopt it and call
  WebContentsAdapter::initialize to attach itself as the client, or
  destroy it if the application isn't handling the call.
- Delay the InitAsChild handling in RenderWidgetHostViewQt when
  it is called before an adapter client has been attached.
- Since WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate
  is only a factory method, not creating any link with the callee client,
  allow using the creating window's adapter client to create the RWHVQtDelegate.
  This allows an unparented delegate to be created instead of needing to
  add numerous null-checks in RWHVQt.
  Use content::WebContents::CreateParams::context for this purpose,
  which can be used both when creating a WebContents ourselves and when
  a new window's WebContents is created for us.

Change-Id: I032262e867931dc40a7c2eca0c993027a555f56e
Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
7146fcc1