| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Each download is represented by a DownloadItem, and all DownloadItems | 5 // Each download is represented by a DownloadItem, and all DownloadItems |
| 6 // are owned by the DownloadManager which maintains a global list of all | 6 // are owned by the DownloadManager which maintains a global list of all |
| 7 // downloads. DownloadItems are created when a user initiates a download, | 7 // downloads. DownloadItems are created when a user initiates a download, |
| 8 // and exist for the duration of the browser life time. | 8 // and exist for the duration of the browser life time. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "base/timer.h" | 27 #include "base/timer.h" |
| 28 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
| 29 | 29 |
| 30 class DownloadFileManager; | 30 class DownloadFileManager; |
| 31 class DownloadManager; | 31 class DownloadManager; |
| 32 struct DownloadCreateInfo; | 32 struct DownloadCreateInfo; |
| 33 | 33 |
| 34 // One DownloadItem per download. This is the model class that stores all the | 34 // One DownloadItem per download. This is the model class that stores all the |
| 35 // state for a download. Multiple views, such as a tab's download shelf and the | 35 // state for a download. Multiple views, such as a tab's download shelf and the |
| 36 // Destination tab's download view, may refer to a given DownloadItem. | 36 // Destination tab's download view, may refer to a given DownloadItem. |
| 37 // |
| 38 // This is intended to be used only on the UI thread. |
| 37 class DownloadItem { | 39 class DownloadItem { |
| 38 public: | 40 public: |
| 39 enum DownloadState { | 41 enum DownloadState { |
| 40 IN_PROGRESS, | 42 IN_PROGRESS, |
| 41 COMPLETE, | 43 COMPLETE, |
| 42 CANCELLED, | 44 CANCELLED, |
| 43 REMOVING | 45 REMOVING |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 enum SafetyState { | 48 enum SafetyState { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // Did the user open the item either directly or indirectly (such as by | 338 // Did the user open the item either directly or indirectly (such as by |
| 337 // setting always open files of this type)? The shelf also sets this field | 339 // setting always open files of this type)? The shelf also sets this field |
| 338 // when the user closes the shelf before the item has been opened but should | 340 // when the user closes the shelf before the item has been opened but should |
| 339 // be treated as though the user opened it. | 341 // be treated as though the user opened it. |
| 340 bool opened_; | 342 bool opened_; |
| 341 | 343 |
| 342 DISALLOW_COPY_AND_ASSIGN(DownloadItem); | 344 DISALLOW_COPY_AND_ASSIGN(DownloadItem); |
| 343 }; | 345 }; |
| 344 | 346 |
| 345 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ | 347 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ |
| OLD | NEW |