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

Side by Side Diff: chrome/browser/lifetime/browser_close_manager.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 Created 4 years, 10 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 | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/memory/tab_manager.h » ('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/lifetime/browser_close_manager.h" 5 #include "chrome/browser/lifetime/browser_close_manager.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/background/background_mode_manager.h" 8 #include "chrome/browser/background/background_mode_manager.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/browser_shutdown.h" 10 #include "chrome/browser/browser_shutdown.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 104
105 ConfirmCloseWithPendingDownloads( 105 ConfirmCloseWithPendingDownloads(
106 download_count, 106 download_count,
107 base::Bind(&BrowserCloseManager::OnReportDownloadsCancellable, this)); 107 base::Bind(&BrowserCloseManager::OnReportDownloadsCancellable, this));
108 } 108 }
109 109
110 void BrowserCloseManager::ConfirmCloseWithPendingDownloads( 110 void BrowserCloseManager::ConfirmCloseWithPendingDownloads(
111 int download_count, 111 int download_count,
112 const base::Callback<void(bool)>& callback) { 112 const base::Callback<void(bool)>& callback) {
113 Browser* browser = 113 Browser* browser = BrowserList::GetInstance()->GetLastActive();
114 BrowserList::GetInstance(chrome::GetActiveDesktop())->GetLastActive();
115 DCHECK(browser); 114 DCHECK(browser);
116 browser->window()->ConfirmBrowserCloseWithPendingDownloads( 115 browser->window()->ConfirmBrowserCloseWithPendingDownloads(
117 download_count, 116 download_count,
118 Browser::DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, 117 Browser::DOWNLOAD_CLOSE_BROWSER_SHUTDOWN,
119 true, 118 true,
120 callback); 119 callback);
121 } 120 }
122 121
123 void BrowserCloseManager::OnReportDownloadsCancellable(bool proceed) { 122 void BrowserCloseManager::OnReportDownloadsCancellable(bool proceed) {
124 if (proceed) { 123 if (proceed) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 it_ptr.reset(new chrome::BrowserIterator()); 173 it_ptr.reset(new chrome::BrowserIterator());
175 if (!it_ptr->done() && browser == **it_ptr) { 174 if (!it_ptr->done() && browser == **it_ptr) {
176 // Destroying the browser should have removed it from the browser list. 175 // Destroying the browser should have removed it from the browser list.
177 // We should never get here. 176 // We should never get here.
178 NOTREACHED(); 177 NOTREACHED();
179 return; 178 return;
180 } 179 }
181 } 180 }
182 } 181 }
183 } 182 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/memory/tab_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698