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

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: 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/browser.h
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index e06f8486eac4dff1345da0ab15700464b632b309..3aa667637302f6ab0c2fc3d96a19f76a601d3a9f 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -112,6 +112,16 @@ class Browser : public TabHandlerDelegate,
MAXIMIZED_STATE_UNMAXIMIZED
};
+ // The context for a download blocked notification from
+ // OkToCloseWithInProgressDownloads; part of that function's interface.
sky 2011/07/21 20:08:11 The last fragment of this sentence doesn't make se
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Removed. What I was trying to say was just "this
+ enum DownloadClosePreventionType {
+ // All downloads would be canceled.
+ BROWSER_SHUTDOWN,
sky 2011/07/21 20:08:11 Can you prefix this with something to make it clea
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Done.
+
+ // Downloas associated with this incognito profile would be canceled.
jennb 2011/07/21 18:35:33 typo - Downloas
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Done.
+ LAST_WINDOW_IN_INCOGNITO_PROFILE,
+ };
+
struct CreateParams {
CreateParams(Type type, Profile* profile);
@@ -342,9 +352,9 @@ 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);
+ // How many downloads are in process globally, and on this window's profile?
+ void CheckDownloadsInProgress(int* total_download_count,
+ int* profile_download_count) const;
// 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
@@ -352,6 +362,16 @@ class Browser : public TabHandlerDelegate,
// 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.
+ // Returns |true| if no executing downloads would be cancelled by this
+ // window close. If executing downloads would be cancelled by this
+ // window close, then |*type| is updated with the type of close this
+ // is, and |*num_downloads_blocking| is updated with how many downloads
+ // would be canceled if the close continued.
+ bool OkToCloseWithInProgressDownloads(DownloadClosePreventionType* type,
sky 2011/07/21 20:08:11 It's a little bizarre to have both a boolean retur
Randy Smith (Not in Mondays) 2011/07/21 21:36:31 Whoops, not sure how I missed that. Right you are
+ int* num_downloads_blocking) const;
+
// TabStripModel pass-thrus /////////////////////////////////////////////////
TabStripModel* tabstrip_model() const {

Powered by Google App Engine
This is Rietveld 408576698