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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h"
6 6
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/sessions/tab_restore_service_factory.h" 10 #include "chrome/browser/sessions/tab_restore_service_factory.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 chrome::ScopedTabbedBrowserDisplayer displayer( 90 chrome::ScopedTabbedBrowserDisplayer displayer(
91 ProfileManager::GetActiveUserProfile()); 91 ProfileManager::GetActiveUserProfile());
92 browser = displayer.browser(); 92 browser = displayer.browser();
93 chrome::NewTab(browser); 93 chrome::NewTab(browser);
94 } 94 }
95 95
96 browser->SetFocusToLocationBar(false); 96 browser->SetFocusToLocationBar(false);
97 } 97 }
98 98
99 void ChromeNewWindowDelegate::NewWindow(bool is_incognito) { 99 void ChromeNewWindowDelegate::NewWindow(bool is_incognito) {
100 Profile* profile = ProfileManager::GetActiveUserProfile(); 100 Browser* browser = GetBrowserForActiveWindow();
101 Profile* profile = (browser && browser->profile())
102 ? browser->profile()->GetOriginalProfile()
103 : ProfileManager::GetActiveUserProfile();
101 chrome::NewEmptyWindow(is_incognito ? profile->GetOffTheRecordProfile() 104 chrome::NewEmptyWindow(is_incognito ? profile->GetOffTheRecordProfile()
102 : profile); 105 : profile);
103 } 106 }
104 107
105 void ChromeNewWindowDelegate::RestoreTab() { 108 void ChromeNewWindowDelegate::RestoreTab() {
106 if (tab_restore_helper_.get()) { 109 if (tab_restore_helper_.get()) {
107 DCHECK(!tab_restore_helper_->tab_restore_service()->IsLoaded()); 110 DCHECK(!tab_restore_helper_->tab_restore_service()->IsLoaded());
108 return; 111 return;
109 } 112 }
110 113
(...skipping 16 matching lines...) Expand all
127 } 130 }
128 } 131 }
129 132
130 void ChromeNewWindowDelegate::ShowTaskManager() { 133 void ChromeNewWindowDelegate::ShowTaskManager() {
131 chrome::OpenTaskManager(NULL); 134 chrome::OpenTaskManager(NULL);
132 } 135 }
133 136
134 void ChromeNewWindowDelegate::OpenFeedbackPage() { 137 void ChromeNewWindowDelegate::OpenFeedbackPage() {
135 chrome::OpenFeedbackDialog(GetBrowserForActiveWindow()); 138 chrome::OpenFeedbackDialog(GetBrowserForActiveWindow());
136 } 139 }
OLDNEW
« 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