2014-09-04 19:53:40 +02:00
|
|
|
diff --git web_contents_impl.cc web_contents_impl.cc
|
2014-10-10 19:54:35 +02:00
|
|
|
index b6ff810..e783922 100644
|
2014-09-04 19:53:40 +02:00
|
|
|
--- web_contents_impl.cc
|
|
|
|
+++ web_contents_impl.cc
|
2014-09-27 01:48:19 +02:00
|
|
|
@@ -1195,22 +1195,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
2014-07-01 00:30:29 +02:00
|
|
|
params.browser_context, params.site_instance, params.routing_id,
|
|
|
|
params.main_frame_routing_id);
|
|
|
|
|
|
|
|
- WebContentsViewDelegate* delegate =
|
|
|
|
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
2014-09-04 19:53:40 +02:00
|
|
|
-
|
2014-07-01 00:30:29 +02:00
|
|
|
- if (browser_plugin_guest_) {
|
|
|
|
- scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
|
|
|
|
- this, delegate, &render_view_host_delegate_view_));
|
2014-09-04 19:53:40 +02:00
|
|
|
-
|
2014-07-01 00:30:29 +02:00
|
|
|
- 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_));
|
2014-09-04 19:53:40 +02:00
|
|
|
+ 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);
|
|
|
|
+
|
2014-07-01 00:30:29 +02:00
|
|
|
+ if (browser_plugin_guest_) {
|
|
|
|
+ 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());
|
2014-09-27 01:48:19 +02:00
|
|
|
@@ -1529,6 +1536,9 @@ void WebContentsImpl::CreateNewWindow(
|
2014-07-01 00:30:29 +02:00
|
|
|
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,
|
2014-09-27 01:48:19 +02:00
|
|
|
@@ -1536,7 +1546,9 @@ void WebContentsImpl::CreateNewWindow(
|
2014-07-01 00:30:29 +02:00
|
|
|
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
|
2014-09-27 01:48:19 +02:00
|
|
|
@@ -1556,6 +1568,8 @@ void WebContentsImpl::CreateNewWindow(
|
2014-07-01 00:30:29 +02:00
|
|
|
create_params.main_frame_routing_id = main_frame_route_id;
|
|
|
|
create_params.opener = this;
|
|
|
|
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;
|
|
|
|
|