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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 | 90 |
91 // DownloadItem | 91 // DownloadItem |
92 void AddObserver(DownloadItem::Observer* observer) override; | 92 void AddObserver(DownloadItem::Observer* observer) override; |
93 void RemoveObserver(DownloadItem::Observer* observer) override; | 93 void RemoveObserver(DownloadItem::Observer* observer) override; |
94 void UpdateObservers() override; | 94 void UpdateObservers() override; |
95 void ValidateDangerousDownload() override; | 95 void ValidateDangerousDownload() override; |
96 void StealDangerousDownload(const AcquireFileCallback& callback) override; | 96 void StealDangerousDownload(const AcquireFileCallback& callback) override; |
97 void Pause() override; | 97 void Pause() override; |
98 void Resume() override; | 98 void Resume() override; |
99 void Cancel(bool user_cancel) override; | 99 void Cancel(bool user_cancel) override; |
100 void MarkRemoved() override; | |
101 void UndoRemove() override; | |
100 void Remove() override; | 102 void Remove() override; |
101 void OpenDownload() override; | 103 void OpenDownload() override; |
102 void ShowDownloadInShell() override; | 104 void ShowDownloadInShell() override; |
103 uint32 GetId() const override; | 105 uint32 GetId() const override; |
104 DownloadState GetState() const override; | 106 DownloadState GetState() const override; |
105 DownloadInterruptReason GetLastReason() const override; | 107 DownloadInterruptReason GetLastReason() const override; |
106 bool IsPaused() const override; | 108 bool IsPaused() const override; |
107 bool IsTemporary() const override; | 109 bool IsTemporary() const override; |
108 bool CanResume() const override; | 110 bool CanResume() const override; |
109 bool IsDone() const override; | 111 bool IsDone() const override; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 // A request to resume this interrupted download is in progress. | 276 // A request to resume this interrupted download is in progress. |
275 // Transitions from: | 277 // Transitions from: |
276 // INTERRUPTED_INTERNAL | 278 // INTERRUPTED_INTERNAL |
277 // Transitions to: | 279 // Transitions to: |
278 // IN_PROGRESS_INTERNAL Once a server response is received from a | 280 // IN_PROGRESS_INTERNAL Once a server response is received from a |
279 // resumption. | 281 // resumption. |
280 // INTERRUPTED_INTERNAL If the resumption request fails. | 282 // INTERRUPTED_INTERNAL If the resumption request fails. |
281 // CANCELLED_INTERNAL On cancel. | 283 // CANCELLED_INTERNAL On cancel. |
282 RESUMING_INTERNAL, | 284 RESUMING_INTERNAL, |
283 | 285 |
286 // The user removed this download from history but can undo this action. | |
287 // Transitions from: | |
288 // CANCELLED_INTERNAL | |
289 // COMPLETE_INTERNAL | |
290 // INTERRUPTED_INTERNAL | |
291 // Transitions to: | |
292 // CANCELLED_INTERNAL | |
293 // COMPLETE_INTERNAL | |
294 // INTERRUPTED_INTERNAL | |
arv (Not doing code reviews)
2014/11/13 19:02:30
This comment is confusing.
| |
295 REMOVED_INTERNAL, | |
296 | |
284 MAX_DOWNLOAD_INTERNAL_STATE, | 297 MAX_DOWNLOAD_INTERNAL_STATE, |
285 }; | 298 }; |
286 | 299 |
287 // Used with TransitionTo() to indicate whether or not to call | 300 // Used with TransitionTo() to indicate whether or not to call |
288 // UpdateObservers() after the state transition. | 301 // UpdateObservers() after the state transition. |
289 enum ShouldUpdateObservers { | 302 enum ShouldUpdateObservers { |
290 UPDATE_OBSERVERS, | 303 UPDATE_OBSERVERS, |
291 DONT_UPDATE_OBSERVERS | 304 DONT_UPDATE_OBSERVERS |
292 }; | 305 }; |
293 | 306 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 | 495 |
483 // Last reason. | 496 // Last reason. |
484 DownloadInterruptReason last_reason_; | 497 DownloadInterruptReason last_reason_; |
485 | 498 |
486 // Start time for recording statistics. | 499 // Start time for recording statistics. |
487 base::TimeTicks start_tick_; | 500 base::TimeTicks start_tick_; |
488 | 501 |
489 // The current state of this download. | 502 // The current state of this download. |
490 DownloadInternalState state_; | 503 DownloadInternalState state_; |
491 | 504 |
505 // The previous state of this download (set in TransitionTo()). | |
506 DownloadInternalState prev_state_; | |
507 | |
492 // Current danger type for the download. | 508 // Current danger type for the download. |
493 DownloadDangerType danger_type_; | 509 DownloadDangerType danger_type_; |
494 | 510 |
495 // The views of this item in the download shelf and download contents. | 511 // The views of this item in the download shelf and download contents. |
496 ObserverList<Observer> observers_; | 512 ObserverList<Observer> observers_; |
497 | 513 |
498 // Time the download was started. | 514 // Time the download was started. |
499 base::Time start_time_; | 515 base::Time start_time_; |
500 | 516 |
501 // Time the download completed. | 517 // Time the download completed. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 const net::BoundNetLog bound_net_log_; | 567 const net::BoundNetLog bound_net_log_; |
552 | 568 |
553 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 569 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
554 | 570 |
555 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 571 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
556 }; | 572 }; |
557 | 573 |
558 } // namespace content | 574 } // namespace content |
559 | 575 |
560 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 576 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
OLD | NEW |