| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 426 |
| 426 // The current state of this download | 427 // The current state of this download |
| 427 DownloadState state_; | 428 DownloadState state_; |
| 428 | 429 |
| 429 // The views of this item in the download shelf and download tab | 430 // The views of this item in the download shelf and download tab |
| 430 ObserverList<Observer> observers_; | 431 ObserverList<Observer> observers_; |
| 431 | 432 |
| 432 // Time the download was started | 433 // Time the download was started |
| 433 base::Time start_time_; | 434 base::Time start_time_; |
| 434 | 435 |
| 436 // Time the download completed |
| 437 base::Time end_time_; |
| 438 |
| 435 // Our persistent store handle | 439 // Our persistent store handle |
| 436 int64 db_handle_; | 440 int64 db_handle_; |
| 437 | 441 |
| 438 // Timer for regularly updating our observers | 442 // Timer for regularly updating our observers |
| 439 base::RepeatingTimer<DownloadItem> update_timer_; | 443 base::RepeatingTimer<DownloadItem> update_timer_; |
| 440 | 444 |
| 441 // Our owning object | 445 // Our owning object |
| 442 DownloadManager* download_manager_; | 446 DownloadManager* download_manager_; |
| 443 | 447 |
| 444 // In progress downloads may be paused by the user, we note it here | 448 // 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... |
| 478 // only. | 482 // only. |
| 479 bool open_enabled_; | 483 bool open_enabled_; |
| 480 | 484 |
| 481 // Did the delegate delay calling Complete on this download? | 485 // Did the delegate delay calling Complete on this download? |
| 482 bool delegate_delayed_complete_; | 486 bool delegate_delayed_complete_; |
| 483 | 487 |
| 484 DISALLOW_COPY_AND_ASSIGN(DownloadItem); | 488 DISALLOW_COPY_AND_ASSIGN(DownloadItem); |
| 485 }; | 489 }; |
| 486 | 490 |
| 487 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ | 491 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ |
| OLD | NEW |