diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 03:30:22 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 03:30:22 +0000 |
commit | 59560e0ba999d5edc33453d4a0fbf44831025817 (patch) | |
tree | f365944f6f0eca593a28747a7fed4caf169578fb /chrome/browser/download/download_shelf.h | |
parent | 4d2868972ff25746d39ecea58e88480ae0463145 (diff) | |
download | chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.zip chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.tar.gz chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.tar.bz2 |
Move download shelf from per-tab to per-window. Also disable auto-hiding of
the shelf.
BUG=9025
TEST=Download file in one tab, open new tab, and check that download shelf is
still open. Also try the shelf's close button and the "show all downloads"
link. When saving a file, the download animation should not show up.
Review URL: http://codereview.chromium.org/115740
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_shelf.h')
-rw-r--r-- | chrome/browser/download/download_shelf.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/chrome/browser/download/download_shelf.h b/chrome/browser/download/download_shelf.h index 1b455c0..1ad0b71 100644 --- a/chrome/browser/download/download_shelf.h +++ b/chrome/browser/download/download_shelf.h @@ -7,47 +7,48 @@ #include <string> +#include "base/logging.h" #include "base/basictypes.h" class BaseDownloadItemModel; +class Browser; class DownloadItem; -class TabContents; // DownloadShelf is an interface for platform-specific download shelves to // implement. It also contains some shared logic. This class should not be // instantiated directly, but rather created via a call to Create(). +// It is a view object. class DownloadShelf { public: - explicit DownloadShelf(TabContents* tab_contents) - : tab_contents_(tab_contents) { } + explicit DownloadShelf(Browser* browser) + : browser_(browser) { DCHECK(browser_); } virtual ~DownloadShelf() { } - // Creates a platform-specific DownloadShelf, passing ownership to the caller. - static DownloadShelf* Create(TabContents* tab_contents); - // A new download has started, so add it to our shelf. This object will - // take ownership of |download_model|. + // take ownership of |download_model|. Also make the shelf visible. virtual void AddDownload(BaseDownloadItemModel* download_model) = 0; // Invoked when the user clicks the 'show all downloads' link button. void ShowAllDownloads(); - // Invoked when the download shelf is migrated from one tab contents to a new - // one. - void ChangeTabContents(TabContents* old_contents, TabContents* new_contents); - // The browser view needs to know when we are going away to properly return // the resize corner size to WebKit so that we don't draw on top of it. - // This returns the showing state of our animation which is set to false at - // the beginning Show and true at the beginning of a Hide. + // This returns the showing state of our animation which is set to true at + // the beginning Show and false at the beginning of a Hide. virtual bool IsShowing() const = 0; // Returns whether the download shelf is showing the close animation. virtual bool IsClosing() const = 0; + // Opens the shelf. + virtual void Show() = 0; + + // Closes the shelf. + virtual void Close() = 0; + protected: - TabContents* tab_contents_; + Browser* browser_; private: DISALLOW_COPY_AND_ASSIGN(DownloadShelf); |