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; |