diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-28 00:35:02 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-28 00:35:02 +0000 |
commit | bcef0dc01dad3fff84f0c64389a0ead525181e55 (patch) | |
tree | 1d08ea6a05a2adbb44050715acde79771e442f88 /chrome/browser/download/download_shelf.h | |
parent | df9d0aa2e3feea5b71e1b3979ba6057238591fe3 (diff) | |
download | chromium_src-bcef0dc01dad3fff84f0c64389a0ead525181e55.zip chromium_src-bcef0dc01dad3fff84f0c64389a0ead525181e55.tar.gz chromium_src-bcef0dc01dad3fff84f0c64389a0ead525181e55.tar.bz2 |
Refactor download shelf and prepare for porting.
Side effect of removing some views dependencies from places they don't belong.
Review URL: http://codereview.chromium.org/28252
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_shelf.h')
-rw-r--r-- | chrome/browser/download/download_shelf.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/download/download_shelf.h b/chrome/browser/download/download_shelf.h new file mode 100644 index 0000000..d3b83a1 --- /dev/null +++ b/chrome/browser/download/download_shelf.h @@ -0,0 +1,51 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ +#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ + +#include "base/basictypes.h" + +class BaseDownloadItemModel; +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(). +class DownloadShelf { + public: + explicit DownloadShelf(TabContents* tab_contents) + : tab_contents_(tab_contents) { } + + 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|. + 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. + virtual bool IsShowing() const = 0; + + protected: + TabContents* tab_contents_; + + private: + DISALLOW_COPY_AND_ASSIGN(DownloadShelf); +}; + +#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ + |