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

Unified Diff: chrome/browser/ui/browser_navigator.cc

Issue 2372323003: Keep web popups opened from extensions in same BrowsingInstance. (Closed)
Patch Set: Fix another test (ExtensionApiTest.TabQuery) Created 4 years, 2 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
Index: chrome/browser/ui/browser_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index b90525ab3d24eeff8bec4cd54b8f6e262f7da2f1..f86afec25d4187449633205d614e98d1cc73be49 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -248,6 +248,11 @@ void NormalizeDisposition(chrome::NavigateParams* params) {
// Obtain the profile used by the code that originated the Navigate() request.
Profile* GetSourceProfile(chrome::NavigateParams* params) {
+ if (params->source_site_instance) {
alexmos 2016/10/04 21:24:44 Turned out the source_site_instance check needed t
Lei Zhang 2016/10/06 00:36:47 You may want to write down some of your notes here
alexmos 2016/10/06 00:42:00 Thanks! I'll add the comment in a followup so I c
+ return Profile::FromBrowserContext(
+ params->source_site_instance->GetBrowserContext());
+ }
+
if (params->source_contents) {
return Profile::FromBrowserContext(
params->source_contents->GetBrowserContext());
@@ -465,7 +470,8 @@ 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->source_contents = NULL;
+ params->source_contents = nullptr;
+ params->source_site_instance = nullptr;
params->referrer = content::Referrer();
}

Powered by Google App Engine
This is Rietveld 408576698