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 47045a85fdee48ef0e47a024b91a5ee22125ad81..bd2cdb91dac1c6c12a07f41bc6582603ccfdbd9e 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 |
@@ -23,8 +23,19 @@ |
DownloadInProgressDialogView::DownloadInProgressDialogView(Browser* browser) |
: browser_(browser), |
product_name_(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)) { |
- int download_count = browser->profile()->GetDownloadManager()-> |
- in_progress_count(); |
+ Browser::DownloadClosePreventionType type; |
+ int download_count; |
+ bool result = browser_->OkToCloseWithInProgressDownloads( |
+ &type, &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(!result); |
+ |
+ // 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. |
std::wstring warning_text; |
std::wstring explanation_text; |