mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-30 11:04:52 +01:00
9af98fab45
- Mac: 10.10 SDK is now required for building (see http://crbug.com/463170#c63). Older SDKs can be used for a short time by setting mac_sdk_min via GYP_DEFINES.
83 lines
3.6 KiB
Diff
83 lines
3.6 KiB
Diff
diff --git web_contents_impl.cc web_contents_impl.cc
|
|
index f7505af..ef9ff79 100644
|
|
--- web_contents_impl.cc
|
|
+++ web_contents_impl.cc
|
|
@@ -1351,23 +1351,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
|
params.main_frame_routing_id);
|
|
frame_tree_.root()->SetFrameName(params.main_frame_name);
|
|
|
|
- WebContentsViewDelegate* delegate =
|
|
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
|
-
|
|
- if (browser_plugin_guest_ &&
|
|
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
|
- scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
|
|
- this, delegate, &render_view_host_delegate_view_));
|
|
-
|
|
- WebContentsViewGuest* rv = new WebContentsViewGuest(
|
|
- this, browser_plugin_guest_.get(), platform_view.Pass(),
|
|
- render_view_host_delegate_view_);
|
|
- render_view_host_delegate_view_ = rv;
|
|
- view_.reset(rv);
|
|
- } else {
|
|
- // Regular WebContentsView.
|
|
- view_.reset(CreateWebContentsView(
|
|
- this, delegate, &render_view_host_delegate_view_));
|
|
+ if (params.view && params.delegate_view) {
|
|
+ view_.reset(params.view);
|
|
+ render_view_host_delegate_view_ = params.delegate_view;
|
|
+ }
|
|
+
|
|
+ if (!view_) {
|
|
+ WebContentsViewDelegate* delegate =
|
|
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
|
+
|
|
+ if (browser_plugin_guest_ &&
|
|
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
|
+ scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
|
|
+ this, delegate, &render_view_host_delegate_view_));
|
|
+
|
|
+ WebContentsViewGuest* rv = new WebContentsViewGuest(
|
|
+ this, browser_plugin_guest_.get(), platform_view.Pass(),
|
|
+ render_view_host_delegate_view_);
|
|
+ render_view_host_delegate_view_ = rv;
|
|
+ view_.reset(rv);
|
|
+ } else {
|
|
+ // Regular WebContentsView.
|
|
+ view_.reset(CreateWebContentsView(
|
|
+ this, delegate, &render_view_host_delegate_view_));
|
|
+ }
|
|
}
|
|
CHECK(render_view_host_delegate_view_);
|
|
CHECK(view_.get());
|
|
@@ -1705,6 +1712,9 @@ void WebContentsImpl::CreateNewWindow(
|
|
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
|
|
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
|
|
|
|
+ content::WebContentsView* view = NULL;
|
|
+ content::RenderViewHostDelegateView* delegate_view = NULL;
|
|
+
|
|
if (delegate_ &&
|
|
!delegate_->ShouldCreateWebContents(this,
|
|
route_id,
|
|
@@ -1713,7 +1723,9 @@ void WebContentsImpl::CreateNewWindow(
|
|
params.frame_name,
|
|
params.target_url,
|
|
partition_id,
|
|
- session_storage_namespace)) {
|
|
+ session_storage_namespace,
|
|
+ &view,
|
|
+ &delegate_view)) {
|
|
if (route_id != MSG_ROUTING_NONE &&
|
|
!RenderViewHost::FromID(render_process_id, route_id)) {
|
|
// If the embedder didn't create a WebContents for this route, we need to
|
|
@@ -1735,6 +1747,8 @@ void WebContentsImpl::CreateNewWindow(
|
|
create_params.opener_render_process_id = render_process_id;
|
|
create_params.opener_render_frame_id = params.opener_render_frame_id;
|
|
create_params.opener_suppressed = params.opener_suppressed;
|
|
+ create_params.view = view;
|
|
+ create_params.delegate_view = delegate_view;
|
|
if (params.disposition == NEW_BACKGROUND_TAB)
|
|
create_params.initially_hidden = true;
|
|
create_params.renderer_initiated_creation =
|