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

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

Issue 7466033: Fix warning prompting on closing a window that will cancel downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing trybot failures (chromeos specifically). Created 9 years, 4 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_list.cc
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index 37b5425f7225b467141c34f9bdc5289340e9529b..c63ff60dcbfa94517edbfd6b660ac7ca2358b57e 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -184,15 +184,17 @@ printing::BackgroundPrintingManager* GetBackgroundPrintingManager() {
// This currently checks if there is pending download, or if it needs to
// handle unload handler.
bool AreAllBrowsersCloseable() {
- for (BrowserList::const_iterator i = BrowserList::begin();
- i != BrowserList::end(); ++i) {
- bool normal_downloads_are_present = false;
- bool incognito_downloads_are_present = false;
- (*i)->CheckDownloadsInProgress(&normal_downloads_are_present,
- &incognito_downloads_are_present);
- if (normal_downloads_are_present ||
- incognito_downloads_are_present ||
- (*i)->TabsNeedBeforeUnloadFired())
+ BrowserList::const_iterator browser_it = BrowserList::begin();
+ if (browser_it == BrowserList::end())
+ return true;
+
+ // If there are any downloads active, all browsers are not closeable.
+ if (g_browser_process->profile_manager()->TotalDownloadCount() > 0)
+ return false;
+
+ // Check TabsNeedBeforeUnloadFired().
+ for (; browser_it != BrowserList::end(); ++browser_it) {
+ if ((*browser_it)->TabsNeedBeforeUnloadFired())
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698