Index: chrome/browser/views/download_shelf_view.h |
diff --git a/chrome/browser/views/download_shelf_view.h b/chrome/browser/views/download_shelf_view.h |
index 83fab7c8a1963c5ddf19309a864d2ed48e78c3e9..db7e53e062ba517106e66e29a611e5086503db00 100644 |
--- a/chrome/browser/views/download_shelf_view.h |
+++ b/chrome/browser/views/download_shelf_view.h |
@@ -10,6 +10,7 @@ |
#include "chrome/browser/download/download_shelf.h" |
#include "views/controls/button/button.h" |
#include "views/controls/link.h" |
+#include "views/mouse_watcher.h" |
namespace views { |
class ImageButton; |
@@ -28,15 +29,19 @@ class DownloadItemView; |
// |
// DownloadShelfView does not hold an infinite number of download views, rather |
// it'll automatically remove views once a certain point is reached. |
-class DownloadShelfView : public DownloadShelf, |
- public views::View, |
+class DownloadShelfView : public AnimationDelegate, |
+ public DownloadShelf, |
public views::ButtonListener, |
public views::LinkController, |
- public AnimationDelegate { |
+ public views::MouseWatcherListener, |
+ public views::View { |
public: |
DownloadShelfView(Browser* browser, BrowserView* parent); |
virtual ~DownloadShelfView(); |
+ // Sent from the DownloadItemView when the user opens an item. |
+ void OpenedDownload(DownloadItemView* view); |
+ |
// Implementation of View. |
virtual gfx::Size GetPreferredSize(); |
virtual void Layout(); |
@@ -63,6 +68,9 @@ class DownloadShelfView : public DownloadShelf, |
virtual void Close(); |
virtual Browser* browser() const { return browser_; } |
+ // Implementation of MouseWatcherDelegate. |
+ virtual void MouseMovedOutOfView(); |
+ |
// Removes a specified download view. The supplied view is deleted after |
// it's removed. |
void RemoveDownloadView(views::View* view); |
@@ -90,6 +98,10 @@ class DownloadShelfView : public DownloadShelf, |
// Called when the "close shelf" animation ended. |
void Closed(); |
+ // Returns true if we can auto close. We can auto-close if all the items on |
+ // the shelf have been opened. |
+ bool CanAutoClose(); |
+ |
// The browser for this shelf. |
Browser* browser_; |
@@ -117,6 +129,8 @@ class DownloadShelfView : public DownloadShelf, |
// The window this shelf belongs to. |
BrowserView* parent_; |
+ views::MouseWatcher mouse_watcher_; |
+ |
DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); |
}; |