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

Unified Diff: chrome/browser/download/download_shelf.h

Issue 12995025: [Mac] DownloadShelf should be notified when autoclosing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: + NSTrackingInVisibleRect Created 7 years, 9 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/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_shelf.h
diff --git a/chrome/browser/download/download_shelf.h b/chrome/browser/download/download_shelf.h
index 9bf0ab476476749369c222602fcd8e02685852a5..9498a86be3b1b60871ab752722bf6b0872ff3407 100644
--- a/chrome/browser/download/download_shelf.h
+++ b/chrome/browser/download/download_shelf.h
@@ -19,6 +19,19 @@ class Browser;
// implementations.
class DownloadShelf {
public:
+ // Reason for closing download shelf.
+ enum CloseReason {
+ // Closing the shelf automatically. E.g.: all remaining downloads in the
+ // shelf have been opened, last download in shelf was removed, or the
+ // browser is switching to full-screen mode.
+ AUTOMATIC,
+
+ // Closing shelf due to a user selection. E.g.: the user clicked on the
+ // 'close' button on the download shelf, or the shelf is being closed as a
+ // side-effect of the user opening the downloads page.
+ USER_ACTION
+ };
+
DownloadShelf();
virtual ~DownloadShelf();
@@ -44,7 +57,7 @@ class DownloadShelf {
void Show();
// Closes the shelf.
- void Close();
+ void Close(CloseReason reason);
// Hides the shelf. This closes the shelf if it is currently showing.
void Hide();
@@ -61,7 +74,7 @@ class DownloadShelf {
protected:
virtual void DoAddDownload(content::DownloadItem* download) = 0;
virtual void DoShow() = 0;
- virtual void DoClose() = 0;
+ virtual void DoClose(CloseReason reason) = 0;
// Time delay to wait before adding a transient download to the shelf.
// Protected virtual for testing.
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698