Index: chrome/browser/ui/browser_navigator.cc |
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc |
index abf993f818697581907ccd20f65fb0941d6c09be..ad2772485bbe36320bd045d431f84c3319e566aa 100644 |
--- a/chrome/browser/ui/browser_navigator.cc |
+++ b/chrome/browser/ui/browser_navigator.cc |
@@ -34,6 +34,8 @@ |
#include "content/public/browser/browser_url_handler.h" |
#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/render_frame_host.h" |
+#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/web_contents.h" |
#include "extensions/features/features.h" |
@@ -358,10 +360,15 @@ content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, |
const GURL& url) { |
WebContents::CreateParams create_params( |
params.browser->profile(), |
- params.source_site_instance && !params.force_new_process_for_new_contents |
- ? params.source_site_instance |
Charlie Reis
2017/06/05 21:06:28
Was this really only used for chrome.windows.creat
Łukasz Anforowicz
2017/06/05 22:06:54
I've added a comment here.
|
+ params.opener |
+ ? params.opener->GetSiteInstance() |
: tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); |
create_params.main_frame_name = params.frame_name; |
+ if (params.opener) { |
+ create_params.opener_render_frame_id = params.opener->GetRoutingID(); |
+ create_params.opener_render_process_id = |
+ params.opener->GetProcess()->GetID(); |
+ } |
if (params.source_contents) { |
create_params.initial_size = |
params.source_contents->GetContainerBounds().size(); |
@@ -473,6 +480,7 @@ void Navigate(NavigateParams* params) { |
if (GetSourceProfile(params) != params->browser->profile()) { |
// A tab is being opened from a link from a different profile, we must reset |
// source information that may cause state to be shared. |
+ params->opener = nullptr; |
params->source_contents = nullptr; |
params->source_site_instance = nullptr; |
params->referrer = content::Referrer(); |