Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: content/browser/tab_contents/tab_contents_view_helper.cc

Issue 9837074: Make it so that allow_js_access: false can be used with background pages created by window.open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revised approach based on http://crrev.com/125180. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tab_contents/tab_contents_view_helper.h" 5 #include "content/browser/tab_contents/tab_contents_view_helper.h"
6 6
7 #include "content/browser/renderer_host/render_view_host_impl.h" 7 #include "content/browser/renderer_host/render_view_host_impl.h"
8 #include "content/browser/tab_contents/tab_contents.h" 8 #include "content/browser/tab_contents/tab_contents.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "content/port/browser/render_widget_host_view_port.h" 10 #include "content/port/browser/render_widget_host_view_port.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 TabContents* TabContentsViewHelper::CreateNewWindow( 49 TabContents* TabContentsViewHelper::CreateNewWindow(
50 WebContents* web_contents, 50 WebContents* web_contents,
51 int route_id, 51 int route_id,
52 const ViewHostMsg_CreateWindow_Params& params) { 52 const ViewHostMsg_CreateWindow_Params& params) {
53 bool should_create = true; 53 bool should_create = true;
54 if (web_contents->GetDelegate()) { 54 if (web_contents->GetDelegate()) {
55 should_create = web_contents->GetDelegate()->ShouldCreateWebContents( 55 should_create = web_contents->GetDelegate()->ShouldCreateWebContents(
56 web_contents, 56 web_contents,
57 route_id, 57 route_id,
58 params.window_container_type, 58 params.window_container_type,
59 params.frame_name); 59 params.frame_name,
60 params.target_url);
60 } 61 }
61 62
62 if (!should_create) 63 if (!should_create)
63 return NULL; 64 return NULL;
64 65
65 // We usually create the new window in the same BrowsingInstance (group of 66 // We usually create the new window in the same BrowsingInstance (group of
66 // script-related windows), by passing in the current SiteInstance. However, 67 // script-related windows), by passing in the current SiteInstance. However,
67 // if the opener is being suppressed, we create a new SiteInstance in its own 68 // if the opener is being suppressed, we create a new SiteInstance in its own
68 // BrowsingInstance. 69 // BrowsingInstance.
69 scoped_refptr<content::SiteInstance> site_instance = 70 scoped_refptr<content::SiteInstance> site_instance =
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id)); 209 RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id));
209 if (is_fullscreen) { 210 if (is_fullscreen) {
210 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); 211 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView());
211 } else { 212 } else {
212 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), 213 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(),
213 initial_pos); 214 initial_pos);
214 } 215 }
215 RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost())->Init(); 216 RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost())->Init();
216 return widget_host_view; 217 return widget_host_view;
217 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698