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

Unified Diff: content/renderer/render_view_impl.cc

Issue 9325082: Create window in a new BrowsingInstance when opening a link in a new process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use correct navigation policy. Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index a23022d868b4d50e97c987b672a53812c5d68694..0f8cd9c0ddf75911381829e894ffffd77699cd92 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -397,6 +397,7 @@ RenderViewImpl::RenderViewImpl(
navigation_gesture_(NavigationGestureUnknown),
opened_by_user_gesture_(true),
opener_suppressed_(false),
+ new_window_navigation_policy_(WebKit::WebNavigationPolicyIgnore),
page_id_(-1),
last_page_id_sent_to_browser_(-1),
next_page_id_(next_page_id),
@@ -1384,6 +1385,12 @@ bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) {
// WebKit::WebViewClient ------------------------------------------------------
+// TODO(creis): Should this be on WebViewClient or WebFrameClient?
darin (slow to review) 2012/02/14 00:15:56 navigation related callbacks typically live on Web
+void RenderViewImpl::didSetNextNavigationPolicy(
+ WebKit::WebNavigationPolicy policy) {
+ new_window_navigation_policy_ = policy;
Charlie Reis 2012/02/07 02:19:55 I'm not thrilled about this, but I haven't found a
+}
+
WebView* RenderViewImpl::createView(
WebFrame* creator,
const WebURLRequest& request,
@@ -1403,13 +1410,18 @@ WebView* RenderViewImpl::createView(
params.opener_url = creator->document().url();
params.opener_security_origin =
creator->document().securityOrigin().toString().utf8();
+ params.opener_suppressed = creator->willSuppressOpenerInNewFrame();
+ params.disposition =
+ NavigationPolicyToDisposition(new_window_navigation_policy_);
if (!request.isNull())
params.target_url = request.url();
+ // Clear the disposition before the next navigation.
+ new_window_navigation_policy_ = WebKit::WebNavigationPolicyIgnore;
+
int32 routing_id = MSG_ROUTING_NONE;
int32 surface_id = 0;
int64 cloned_session_storage_namespace_id;
- bool opener_suppressed = creator->willSuppressOpenerInNewFrame();
RenderThread::Get()->Send(
new ViewHostMsg_CreateWindow(params,
@@ -1433,7 +1445,7 @@ WebView* RenderViewImpl::createView(
view->opened_by_user_gesture_ = params.user_gesture;
// Record whether the creator frame is trying to suppress the opener field.
- view->opener_suppressed_ = opener_suppressed;
+ view->opener_suppressed_ = params.opener_suppressed;
// Record the security origin of the creator.
GURL creator_url(creator->document().securityOrigin().toString().utf8());
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698