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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 2921753002: NOT YET READY: Making chrome.windows.create establish an actual "opener" relationship.
Patch Set: Adding setSelfAsOpener parameter. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tabs/tabs_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tabs/tabs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698