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

Unified Diff: chrome/browser/ui/views/download/download_in_progress_dialog_view.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: Make sure to use temporary download directory Created 9 years, 2 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 | « chrome/browser/ui/gtk/download/download_in_progress_dialog_gtk.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_in_progress_dialog_view.cc
diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc
index 5fe1b6cb1a8f5302ad3b9b962efc30041ffb24cc..933460a917630a0fff034acd15f3f9507d52c050 100644
--- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc
+++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc
@@ -27,9 +27,18 @@
DownloadInProgressDialogView::DownloadInProgressDialogView(Browser* browser)
: browser_(browser),
product_name_(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)) {
- int download_count =
- DownloadServiceFactory::GetForProfile(
- browser->profile())->GetDownloadManager()->in_progress_count();
+ int download_count;
+ Browser::DownloadClosePreventionType type =
+ browser_->OkToCloseWithInProgressDownloads(&download_count);
+
+ // This dialog should have been created within the same thread invocation
+ // as the original test that lead to us, so it should always not be ok
+ // to close.
+ DCHECK_NE(Browser::DOWNLOAD_CLOSE_OK, type);
+
+ // TODO(rdsmith): This dialog should be different depending on whether we're
+ // closing the last incognito window of a profile or doing browser shutdown.
+ // See http://crbug.com/88421.
string16 warning_text;
string16 explanation_text;
« no previous file with comments | « chrome/browser/ui/gtk/download/download_in_progress_dialog_gtk.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698