| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 std::string original_mime_type() const { return original_mime_type_; } | 271 std::string original_mime_type() const { return original_mime_type_; } |
| 272 std::string referrer_charset() const { return referrer_charset_; } | 272 std::string referrer_charset() const { return referrer_charset_; } |
| 273 int64 total_bytes() const { return total_bytes_; } | 273 int64 total_bytes() const { return total_bytes_; } |
| 274 void set_total_bytes(int64 total_bytes) { | 274 void set_total_bytes(int64 total_bytes) { |
| 275 total_bytes_ = total_bytes; | 275 total_bytes_ = total_bytes; |
| 276 } | 276 } |
| 277 int64 received_bytes() const { return received_bytes_; } | 277 int64 received_bytes() const { return received_bytes_; } |
| 278 int32 id() const { return download_id_; } | 278 int32 id() const { return download_id_; } |
| 279 DownloadId global_id() const; | 279 DownloadId global_id() const; |
| 280 base::Time start_time() const { return start_time_; } | 280 base::Time start_time() const { return start_time_; } |
| 281 base::Time end_time() const { return end_time_; } |
| 281 void set_db_handle(int64 handle) { db_handle_ = handle; } | 282 void set_db_handle(int64 handle) { db_handle_ = handle; } |
| 282 int64 db_handle() const { return db_handle_; } | 283 int64 db_handle() const { return db_handle_; } |
| 283 DownloadManager* download_manager() { return download_manager_; } | 284 DownloadManager* download_manager() { return download_manager_; } |
| 284 bool is_paused() const { return is_paused_; } | 285 bool is_paused() const { return is_paused_; } |
| 285 bool open_when_complete() const { return open_when_complete_; } | 286 bool open_when_complete() const { return open_when_complete_; } |
| 286 void set_open_when_complete(bool open) { open_when_complete_ = open; } | 287 void set_open_when_complete(bool open) { open_when_complete_ = open; } |
| 287 bool file_externally_removed() const { return file_externally_removed_; } | 288 bool file_externally_removed() const { return file_externally_removed_; } |
| 288 SafetyState safety_state() const { return safety_state_; } | 289 SafetyState safety_state() const { return safety_state_; } |
| 289 // Why |safety_state_| is not SAFE. | 290 // Why |safety_state_| is not SAFE. |
| 290 DangerType GetDangerType() const; | 291 DangerType GetDangerType() const; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 429 |
| 429 // The current state of this download | 430 // The current state of this download |
| 430 DownloadState state_; | 431 DownloadState state_; |
| 431 | 432 |
| 432 // The views of this item in the download shelf and download tab | 433 // The views of this item in the download shelf and download tab |
| 433 ObserverList<Observer> observers_; | 434 ObserverList<Observer> observers_; |
| 434 | 435 |
| 435 // Time the download was started | 436 // Time the download was started |
| 436 base::Time start_time_; | 437 base::Time start_time_; |
| 437 | 438 |
| 439 // Time the download completed |
| 440 base::Time end_time_; |
| 441 |
| 438 // Our persistent store handle | 442 // Our persistent store handle |
| 439 int64 db_handle_; | 443 int64 db_handle_; |
| 440 | 444 |
| 441 // Timer for regularly updating our observers | 445 // Timer for regularly updating our observers |
| 442 base::RepeatingTimer<DownloadItem> update_timer_; | 446 base::RepeatingTimer<DownloadItem> update_timer_; |
| 443 | 447 |
| 444 // Our owning object | 448 // Our owning object |
| 445 DownloadManager* download_manager_; | 449 DownloadManager* download_manager_; |
| 446 | 450 |
| 447 // In progress downloads may be paused by the user, we note it here | 451 // In progress downloads may be paused by the user, we note it here |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // only. | 485 // only. |
| 482 bool open_enabled_; | 486 bool open_enabled_; |
| 483 | 487 |
| 484 // Did the delegate delay calling Complete on this download? | 488 // Did the delegate delay calling Complete on this download? |
| 485 bool delegate_delayed_complete_; | 489 bool delegate_delayed_complete_; |
| 486 | 490 |
| 487 DISALLOW_COPY_AND_ASSIGN(DownloadItem); | 491 DISALLOW_COPY_AND_ASSIGN(DownloadItem); |
| 488 }; | 492 }; |
| 489 | 493 |
| 490 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ | 494 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ |
| OLD | NEW |