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

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: Fix failed browsertest. 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/chrome_new_window_delegate_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dd08fa5844bb3d06bd8a9ca8d654d4de1ac097c8 100644
--- a/chrome/browser/ui/ash/chrome_new_window_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_new_window_delegate.cc
@@ -97,7 +97,10 @@ void ChromeNewWindowDelegate::NewTab() {
}
void ChromeNewWindowDelegate::NewWindow(bool is_incognito) {
- Profile* profile = ProfileManager::GetActiveUserProfile();
+ Browser* browser = GetBrowserForActiveWindow();
+ Profile* profile = (browser && browser->profile())
+ ? browser->profile()->GetOriginalProfile()
+ : ProfileManager::GetActiveUserProfile();
chrome::NewEmptyWindow(is_incognito ? profile->GetOffTheRecordProfile()
: profile);
}
« no previous file with comments | « no previous file | chrome/browser/ui/ash/chrome_new_window_delegate_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698