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

Unified Diff: chrome/browser/ui/ash/chrome_new_window_delegate.cc

Issue 1954853002: When user presses Ctrl-N, we should use the current active window's profile to determine on which p… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 4 years, 7 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/ash/chrome_new_window_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_new_window_delegate.cc b/chrome/browser/ui/ash/chrome_new_window_delegate.cc
index b0689d930f5b07ff3f3eee30d5140840df67f8e0..494944e03d471bf34530ccb2ac8cd528674d35fe 100644
--- a/chrome/browser/ui/ash/chrome_new_window_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_new_window_delegate.cc
@@ -97,7 +97,12 @@ void ChromeNewWindowDelegate::NewTab() {
}
void ChromeNewWindowDelegate::NewWindow(bool is_incognito) {
- Profile* profile = ProfileManager::GetActiveUserProfile();
+ Profile* profile;
+ Browser* browser = GetBrowserForActiveWindow();
+ if (browser && browser->profile())
+ profile = browser->profile();
+ else
+ profile = ProfileManager::GetActiveUserProfile();
oshima 2016/05/06 18:44:14 optional: conditional operator?
xdai1 2016/05/06 20:25:32 Done.
chrome::NewEmptyWindow(is_incognito ? profile->GetOffTheRecordProfile()
: profile);
}

Powered by Google App Engine
This is Rietveld 408576698