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

Unified Diff: chrome/browser/ui/browser.h

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: Incoporated comments, primarily from Achuith. 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
Index: chrome/browser/ui/browser.h
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 4e453b4e465e9d14cc4f90bf66f972d226026885..d799d7af3cdf3eaa382f64853c3bee916e33e87f 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -108,6 +108,21 @@ class Browser : public TabHandlerDelegate,
FEATURE_DOWNLOADSHELF = 128
};
+ // The context for a download blocked notification from
+ // OkToCloseWithInProgressDownloads.
+ enum DownloadClosePreventionType {
+ // Browser close is not blocked by download state.
+ DOWNLOAD_CLOSE_OK,
+
+ // The browser is shutting down and there are active downloads
+ // that would be cancelled.
+ DOWNLOAD_CLOSE_BROWSER_SHUTDOWN,
+
+ // There are active downloads associated with this incognito profile
+ // that would be canceled.
+ DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE,
+ };
+
struct CreateParams {
CreateParams(Type type, Profile* profile);
@@ -340,16 +355,20 @@ class Browser : public TabHandlerDelegate,
// In-progress download termination handling /////////////////////////////////
- // Are normal and/or incognito downloads in progress?
- void CheckDownloadsInProgress(bool* normal_downloads,
- bool* incognito_downloads);
-
// Called when the user has decided whether to proceed or not with the browser
// closure. |cancel_downloads| is true if the downloads should be canceled
// and the browser closed, false if the browser should stay open and the
// downloads running.
void InProgressDownloadResponse(bool cancel_downloads);
+ // Indicates whether or not this browser window can be closed, or
+ // would be blocked by in-progress downloads.
+ // If executing downloads would be cancelled by this window close,
+ // then |*num_downloads_blocking| is updated with how many downloads
+ // would be canceled if the close continued.
+ DownloadClosePreventionType OkToCloseWithInProgressDownloads(
+ int* num_downloads_blocking) const;
+
// TabStripModel pass-thrus /////////////////////////////////////////////////
TabStripModel* tabstrip_model() const {

Powered by Google App Engine
This is Rietveld 408576698