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

Unified Diff: chrome/browser/browser.h

Issue 62131: Ask for user confirmation when closing a browser with in-progress downloads (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.h
===================================================================
--- chrome/browser/browser.h (revision 13264)
+++ chrome/browser/browser.h (working copy)
@@ -182,6 +182,14 @@
// cleanup.
void OnWindowClosing();
+ // In-progress download termination handling /////////////////////////////////
+
+ // 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);
+
// TabStripModel pass-thrus /////////////////////////////////////////////////
TabStripModel* tabstrip_model() const {
@@ -541,6 +549,13 @@
// successfully fired.
void ClearUnloadState(TabContents* tab);
+ // In-progress download termination handling /////////////////////////////////
+
+ // Called when the window is closing to check if potential in-progress
+ // downloads should prevent it from closing.
+ // Returns true if the window can close, false otherwise.
+ bool CanCloseWithInProgressDownloads();
+
// Assorted utility functions ///////////////////////////////////////////////
// Retrieve the last active tabbed browser with the same profile as the
@@ -655,6 +670,19 @@
// in preparation for closing the browser.
bool is_attempting_to_close_browser_;
+ // In-progress download termination handling /////////////////////////////////
+
+ enum CancelDownloadConfirmationState {
+ NOT_PROMPTED, // We have not asked the user.
+ WAITING_FOR_RESPONSE, // We have asked the user and have not received a
+ // reponse yet.
+ RESPONSE_RECEIVED // The user was prompted and made a decision already.
+ };
+
+ // State used to figure-out whether we should prompt the user for confirmation
+ // when the browser is closed with in-progress downloads.
+ CancelDownloadConfirmationState cancel_download_confirmation_state_;
+
/////////////////////////////////////////////////////////////////////////////
// Override values for the bounds of the window and its maximized state.
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698