| 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 <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include <string> | 10 #include <string> | 
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 158   // of this method will be different from DownloadItem::OpenDownload() if | 158   // of this method will be different from DownloadItem::OpenDownload() if | 
| 159   // ShouldPreferOpeningInBrowser(). | 159   // ShouldPreferOpeningInBrowser(). | 
| 160   void OpenUsingPlatformHandler(); | 160   void OpenUsingPlatformHandler(); | 
| 161 | 161 | 
| 162   // Whether the download was removed and this is currently being undone. | 162   // Whether the download was removed and this is currently being undone. | 
| 163   bool IsBeingRevived() const; | 163   bool IsBeingRevived() const; | 
| 164 | 164 | 
| 165   // Set whether the download is being revived. | 165   // Set whether the download is being revived. | 
| 166   void SetIsBeingRevived(bool is_being_revived); | 166   void SetIsBeingRevived(bool is_being_revived); | 
| 167 | 167 | 
|  | 168   // Returns |true| if user opened or shown download item in shell. Download | 
|  | 169   // shelf checks this for autohide. | 
|  | 170   bool GetOpenedOrShown() const; | 
|  | 171 | 
|  | 172   // Sets whether download was opened or shown in shell. Download shelf marks | 
|  | 173   // downloads as shown or opened if user manually closes the shelf. | 
|  | 174   void SetOpenedOrShown(bool opened_or_shown); | 
|  | 175 | 
| 168   content::DownloadItem* download() { return download_; } | 176   content::DownloadItem* download() { return download_; } | 
| 169 | 177 | 
| 170   // Returns a string representations of the current download progress sizes. If | 178   // Returns a string representations of the current download progress sizes. If | 
| 171   // the total size of the download is known, this string looks like: "100/200 | 179   // the total size of the download is known, this string looks like: "100/200 | 
| 172   // MB" where the numerator is the transferred size and the denominator is the | 180   // MB" where the numerator is the transferred size and the denominator is the | 
| 173   // total size. If the total isn't known, returns the transferred size as a | 181   // total size. If the total isn't known, returns the transferred size as a | 
| 174   // string (e.g.: "100 MB"). | 182   // string (e.g.: "100 MB"). | 
| 175   base::string16 GetProgressSizesString() const; | 183   base::string16 GetProgressSizesString() const; | 
| 176 | 184 | 
| 177  private: | 185  private: | 
| 178   // Returns a string indicating the status of an in-progress download. | 186   // Returns a string indicating the status of an in-progress download. | 
| 179   base::string16 GetInProgressStatusString() const; | 187   base::string16 GetInProgressStatusString() const; | 
| 180 | 188 | 
| 181   // The DownloadItem that this model represents. Note that DownloadItemModel | 189   // The DownloadItem that this model represents. Note that DownloadItemModel | 
| 182   // itself shouldn't maintain any state since there can be more than one | 190   // itself shouldn't maintain any state since there can be more than one | 
| 183   // DownloadItemModel in use with the same DownloadItem. | 191   // DownloadItemModel in use with the same DownloadItem. | 
| 184   content::DownloadItem* download_; | 192   content::DownloadItem* download_; | 
| 185 | 193 | 
| 186   DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); | 194   DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); | 
| 187 }; | 195 }; | 
| 188 | 196 | 
| 189 #endif  // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 197 #endif  // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 
| OLD | NEW | 
|---|