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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2921753002: NOT YET READY: Making chrome.windows.create establish an actual "opener" relationship.
Patch Set: Fix incognito profile transitions Created 3 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 // on the frame's unique name. If this can't be found, fall back to the 1250 // on the frame's unique name. If this can't be found, fall back to the
1251 // default params using RequestOpenURL below. 1251 // default params using RequestOpenURL below.
1252 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this, 1252 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this,
1253 validated_url)) 1253 validated_url))
1254 return; 1254 return;
1255 } 1255 }
1256 1256
1257 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url", 1257 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url",
1258 validated_url.possibly_invalid_spec()); 1258 validated_url.possibly_invalid_spec());
1259 1259
1260 // When |params.disposition| asks OpenURL to create new contents, it always
1261 // happens because of an explicit user request for new content creation (i.e.
1262 // opening a link using ctrl-click or middle click). In such cases, the new
1263 // content should be created in a new renderer to break opener relationship
1264 // (see https://crbug.com/658386) and to conserve memory per renderer (see
1265 // https://crbug.com/23815). Note that new content creation that wasn't
1266 // explicitly requested by the user (i.e. left-clicking a link with
1267 // target=_blank) goes through a different code path (through
1268 // WebViewClient::CreateView).
1269 bool kForceNewProcessForNewContents = true;
1270
1271 frame_tree_node_->navigator()->RequestOpenURL( 1260 frame_tree_node_->navigator()->RequestOpenURL(
1272 this, validated_url, params.uses_post, params.resource_request_body, 1261 this, validated_url, params.uses_post, params.resource_request_body,
1273 params.extra_headers, params.referrer, params.disposition, 1262 params.extra_headers, params.referrer, params.disposition,
1274 kForceNewProcessForNewContents, params.should_replace_current_entry, 1263 params.should_replace_current_entry, params.user_gesture);
1275 params.user_gesture);
1276 } 1264 }
1277 1265
1278 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() { 1266 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() {
1279 // A Javascript navigation interrupted the initial history load. Check if an 1267 // A Javascript navigation interrupted the initial history load. Check if an
1280 // initial subframe cross-process navigation needs to be canceled as a result. 1268 // initial subframe cross-process navigation needs to be canceled as a result.
1281 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate. 1269 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate.
1282 if (GetParent() && !frame_tree_node_->has_committed_real_load() && 1270 if (GetParent() && !frame_tree_node_->has_committed_real_load() &&
1283 frame_tree_node_->render_manager()->pending_frame_host()) { 1271 frame_tree_node_->render_manager()->pending_frame_host()) {
1284 frame_tree_node_->render_manager()->CancelPendingIfNecessary( 1272 frame_tree_node_->render_manager()->CancelPendingIfNecessary(
1285 frame_tree_node_->render_manager()->pending_frame_host()); 1273 frame_tree_node_->render_manager()->pending_frame_host());
(...skipping 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after
4066 } 4054 }
4067 4055
4068 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 4056 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
4069 const std::string& interface_name, 4057 const std::string& interface_name,
4070 mojo::ScopedMessagePipeHandle pipe) { 4058 mojo::ScopedMessagePipeHandle pipe) {
4071 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 4059 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
4072 } 4060 }
4073 #endif 4061 #endif
4074 4062
4075 } // namespace content 4063 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698