| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| 7 | 7 |
| 8 class DownloadItemModel; | 8 namespace content { |
| 9 class DownloadItem; |
| 10 } |
| 11 |
| 9 class Browser; | 12 class Browser; |
| 10 | 13 |
| 11 // This is an abstract base class for platform specific download shelf | 14 // This is an abstract base class for platform specific download shelf |
| 12 // implementations. | 15 // implementations. |
| 13 class DownloadShelf { | 16 class DownloadShelf { |
| 14 public: | 17 public: |
| 15 DownloadShelf(); | 18 DownloadShelf(); |
| 16 virtual ~DownloadShelf() {} | 19 virtual ~DownloadShelf() {} |
| 17 | 20 |
| 18 // A new download has started, so add it to our shelf. This object will | 21 // A new download has started, so add it to our shelf. Also make the shelf |
| 19 // take ownership of |download_model|. Also make the shelf visible. | 22 // visible. |
| 20 void AddDownload(DownloadItemModel* download_model); | 23 void AddDownload(content::DownloadItem* download); |
| 21 | 24 |
| 22 // The browser view needs to know when we are going away to properly return | 25 // The browser view needs to know when we are going away to properly return |
| 23 // the resize corner size to WebKit so that we don't draw on top of it. | 26 // the resize corner size to WebKit so that we don't draw on top of it. |
| 24 // This returns the showing state of our animation which is set to true at | 27 // This returns the showing state of our animation which is set to true at |
| 25 // the beginning Show and false at the beginning of a Hide. | 28 // the beginning Show and false at the beginning of a Hide. |
| 26 virtual bool IsShowing() const = 0; | 29 virtual bool IsShowing() const = 0; |
| 27 | 30 |
| 28 // Returns whether the download shelf is showing the close animation. | 31 // Returns whether the download shelf is showing the close animation. |
| 29 virtual bool IsClosing() const = 0; | 32 virtual bool IsClosing() const = 0; |
| 30 | 33 |
| 31 // Opens the shelf. | 34 // Opens the shelf. |
| 32 void Show(); | 35 void Show(); |
| 33 | 36 |
| 34 // Closes the shelf. | 37 // Closes the shelf. |
| 35 void Close(); | 38 void Close(); |
| 36 | 39 |
| 37 // Hides the shelf. This closes the shelf if it is currently showing. | 40 // Hides the shelf. This closes the shelf if it is currently showing. |
| 38 void Hide(); | 41 void Hide(); |
| 39 | 42 |
| 40 // Unhides the shelf. This will cause the shelf to be opened if it was open | 43 // Unhides the shelf. This will cause the shelf to be opened if it was open |
| 41 // when it was hidden, or was shown while it was hidden. | 44 // when it was hidden, or was shown while it was hidden. |
| 42 void Unhide(); | 45 void Unhide(); |
| 43 | 46 |
| 44 virtual Browser* browser() const = 0; | 47 virtual Browser* browser() const = 0; |
| 45 | 48 |
| 46 // Returns whether the download shelf is hidden. | 49 // Returns whether the download shelf is hidden. |
| 47 bool is_hidden() { return is_hidden_; } | 50 bool is_hidden() { return is_hidden_; } |
| 48 | 51 |
| 49 protected: | 52 protected: |
| 50 virtual void DoAddDownload(DownloadItemModel* download_model) = 0; | 53 virtual void DoAddDownload(content::DownloadItem* download) = 0; |
| 51 virtual void DoShow() = 0; | 54 virtual void DoShow() = 0; |
| 52 virtual void DoClose() = 0; | 55 virtual void DoClose() = 0; |
| 53 | 56 |
| 54 private: | 57 private: |
| 55 bool should_show_on_unhide_; | 58 bool should_show_on_unhide_; |
| 56 bool is_hidden_; | 59 bool is_hidden_; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 62 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| OLD | NEW |