| 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 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 // A new download has started. Add it to our shelf and show the download | 129 // A new download has started. Add it to our shelf and show the download |
| 130 // started animation. | 130 // started animation. |
| 131 // | 131 // |
| 132 // Some downloads are removed from the shelf on completion (See | 132 // Some downloads are removed from the shelf on completion (See |
| 133 // DownloadItemModel::ShouldRemoveFromShelfWhenComplete()). These transient | 133 // DownloadItemModel::ShouldRemoveFromShelfWhenComplete()). These transient |
| 134 // downloads are added to the shelf after a delay. If the download completes | 134 // downloads are added to the shelf after a delay. If the download completes |
| 135 // before the delay duration, it will not be added to the shelf at all. | 135 // before the delay duration, it will not be added to the shelf at all. |
| 136 void AddDownload(content::DownloadItem* download); | 136 void AddDownload(content::DownloadItem* download); |
| 137 | 137 |
| 138 // Remove |download| from our shelf if it exists. |
| 139 // |
| 140 // NOTE: This call is only necessary if |download| needs to be hidden but |
| 141 // isn't actually being deleted. For example: a download is visually hidden |
| 142 // from chrome://downloads but isn't deleted until the page closes (so the |
| 143 // removal can be undone). |
| 144 // |
| 145 // To really remove a download from all views and delete any intermediate |
| 146 // files, call DownloadItem::Remove(). |
| 147 virtual void RemoveDownload(content::DownloadItem* download) = 0; |
| 148 |
| 138 // The browser view needs to know when we are going away to properly return | 149 // The browser view needs to know when we are going away to properly return |
| 139 // the resize corner size to WebKit so that we don't draw on top of it. | 150 // the resize corner size to WebKit so that we don't draw on top of it. |
| 140 // This returns the showing state of our animation which is set to true at | 151 // This returns the showing state of our animation which is set to true at |
| 141 // the beginning Show and false at the beginning of a Hide. | 152 // the beginning Show and false at the beginning of a Hide. |
| 142 virtual bool IsShowing() const = 0; | 153 virtual bool IsShowing() const = 0; |
| 143 | 154 |
| 144 // Returns whether the download shelf is showing the close animation. | 155 // Returns whether the download shelf is showing the close animation. |
| 145 virtual bool IsClosing() const = 0; | 156 virtual bool IsClosing() const = 0; |
| 146 | 157 |
| 147 // Opens the shelf. | 158 // Opens the shelf. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // download should belong to the DownloadManager returned by | 196 // download should belong to the DownloadManager returned by |
| 186 // GetDownloadManager(). | 197 // GetDownloadManager(). |
| 187 void ShowDownloadById(int32 download_id); | 198 void ShowDownloadById(int32 download_id); |
| 188 | 199 |
| 189 bool should_show_on_unhide_; | 200 bool should_show_on_unhide_; |
| 190 bool is_hidden_; | 201 bool is_hidden_; |
| 191 base::WeakPtrFactory<DownloadShelf> weak_ptr_factory_; | 202 base::WeakPtrFactory<DownloadShelf> weak_ptr_factory_; |
| 192 }; | 203 }; |
| 193 | 204 |
| 194 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 205 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| OLD | NEW |