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

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

Issue 115740: Move download shelf from per-tab to per-window (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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_file.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
===================================================================
--- chrome/browser/download/download_shelf.h (revision 17483)
+++ chrome/browser/download/download_shelf.h (working copy)
@@ -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);
« no previous file with comments | « chrome/browser/download/download_file.cc ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698