Index: chrome/browser/extensions/api/tabs/tabs_api.cc |
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc |
index a3b16919c5a6d9bc840574dac92ec7706a7622ca..b7f333d193c3b6a50957e6a583dd7d1773601f85 100644 |
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc |
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc |
@@ -571,13 +571,10 @@ ExtensionFunction::ResponseAction WindowsCreateFunction::Run() { |
ui::PAGE_TRANSITION_LINK); |
navigate_params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
- // The next 2 statements put the new contents in the same BrowsingInstance |
- // as their opener. Note that |force_new_process_for_new_contents = false| |
- // means that new contents might still end up in a new renderer |
- // (if they open a web URL and are transferred out of an extension |
- // renderer), but even in this case the flags below ensure findability via |
- // window.open. |
- navigate_params.force_new_process_for_new_contents = false; |
+ // Put the new contents in the same BrowsingInstance as their opener. |
+ bool set_self_as_opener = create_data->set_self_as_opener && // present? |
+ *create_data->set_self_as_opener; // set to true? |
+ navigate_params.opener = set_self_as_opener ? render_frame_host() : nullptr; |
navigate_params.source_site_instance = |
render_frame_host()->GetSiteInstance(); |