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_ITEM_MODEL_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 bool IsDangerousFileBasedOnType() const; | 145 bool IsDangerousFileBasedOnType() const; |
146 | 146 |
147 // Change what's returned by IsDangerousFileBasedOnType(). | 147 // Change what's returned by IsDangerousFileBasedOnType(). |
148 void SetIsDangerousFileBasedOnType(bool dangerous); | 148 void SetIsDangerousFileBasedOnType(bool dangerous); |
149 | 149 |
150 // Open the download using the platform handler for the download. The behavior | 150 // Open the download using the platform handler for the download. The behavior |
151 // of this method will be different from DownloadItem::OpenDownload() if | 151 // of this method will be different from DownloadItem::OpenDownload() if |
152 // ShouldPreferOpeningInBrowser(). | 152 // ShouldPreferOpeningInBrowser(). |
153 void OpenUsingPlatformHandler(); | 153 void OpenUsingPlatformHandler(); |
154 | 154 |
| 155 // Whether the download was removed and this is currently being undone. |
| 156 bool IsBeingRevived() const; |
| 157 |
| 158 // Set whether the download is being revived. |
| 159 void SetIsBeingRevived(bool is_being_revived); |
| 160 |
155 content::DownloadItem* download() { return download_; } | 161 content::DownloadItem* download() { return download_; } |
156 | 162 |
157 private: | 163 private: |
158 // Returns a string representations of the current download progress sizes. If | 164 // Returns a string representations of the current download progress sizes. If |
159 // the total size of the download is known, this string looks like: "100/200 | 165 // the total size of the download is known, this string looks like: "100/200 |
160 // MB" where the numerator is the transferred size and the denominator is the | 166 // MB" where the numerator is the transferred size and the denominator is the |
161 // total size. If the total isn't known, returns the transferred size as a | 167 // total size. If the total isn't known, returns the transferred size as a |
162 // string (e.g.: "100 MB"). | 168 // string (e.g.: "100 MB"). |
163 base::string16 GetProgressSizesString() const; | 169 base::string16 GetProgressSizesString() const; |
164 | 170 |
165 // Returns a string indicating the status of an in-progress download. | 171 // Returns a string indicating the status of an in-progress download. |
166 base::string16 GetInProgressStatusString() const; | 172 base::string16 GetInProgressStatusString() const; |
167 | 173 |
168 // The DownloadItem that this model represents. Note that DownloadItemModel | 174 // The DownloadItem that this model represents. Note that DownloadItemModel |
169 // itself shouldn't maintain any state since there can be more than one | 175 // itself shouldn't maintain any state since there can be more than one |
170 // DownloadItemModel in use with the same DownloadItem. | 176 // DownloadItemModel in use with the same DownloadItem. |
171 content::DownloadItem* download_; | 177 content::DownloadItem* download_; |
172 | 178 |
173 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); | 179 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); |
174 }; | 180 }; |
175 | 181 |
176 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 182 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
OLD | NEW |