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

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: Removed unneeded friend decls and tweaked a comment. Created 9 years, 5 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/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;

Powered by Google App Engine
This is Rietveld 408576698