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