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

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

Issue 2686943002: New WebContents created via ctrl-click should be in a new process. (Closed)
Patch Set: s/renderer/process/ in the field name + initializing the field and variables. Created 3 years, 8 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 | « chrome/browser/chrome_navigation_browsertest.cc ('k') | 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 e4ec50d3ce1cbe127880073ff250eaddf86ab6fd..9dc6ede08fe74a101578e1e94aacd80f85c72e02 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -621,8 +621,17 @@ ExtensionFunction::ResponseAction WindowsCreateFunction::Run() {
chrome::NavigateParams navigate_params(new_window, url,
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;
navigate_params.source_site_instance =
render_frame_host()->GetSiteInstance();
+
chrome::Navigate(&navigate_params);
}
« no previous file with comments | « chrome/browser/chrome_navigation_browsertest.cc ('k') | chrome/browser/extensions/api/tabs/tabs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698