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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 const std::string& etag, | 70 const std::string& etag, |
71 const std::string& last_modified, | 71 const std::string& last_modified, |
72 int64_t received_bytes, | 72 int64_t received_bytes, |
73 int64_t total_bytes, | 73 int64_t total_bytes, |
74 const std::string& hash, | 74 const std::string& hash, |
75 DownloadItem::DownloadState state, | 75 DownloadItem::DownloadState state, |
76 DownloadDangerType danger_type, | 76 DownloadDangerType danger_type, |
77 DownloadInterruptReason interrupt_reason, | 77 DownloadInterruptReason interrupt_reason, |
78 bool opened, | 78 bool opened, |
79 base::Time last_access_time, | 79 base::Time last_access_time, |
| 80 bool visible, |
80 const std::vector<DownloadItem::ReceivedSlice>& received_slices, | 81 const std::vector<DownloadItem::ReceivedSlice>& received_slices, |
81 const net::NetLogWithSource& net_log); | 82 const net::NetLogWithSource& net_log); |
82 | 83 |
83 // Constructing for a regular download. | 84 // Constructing for a regular download. |
84 // |net_log| is constructed externally for our use. | 85 // |net_log| is constructed externally for our use. |
85 DownloadItemImpl(DownloadItemImplDelegate* delegate, | 86 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
86 uint32_t id, | 87 uint32_t id, |
87 const DownloadCreateInfo& info, | 88 const DownloadCreateInfo& info, |
88 const net::NetLogWithSource& net_log); | 89 const net::NetLogWithSource& net_log); |
89 | 90 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 const override; | 159 const override; |
159 base::Time GetStartTime() const override; | 160 base::Time GetStartTime() const override; |
160 base::Time GetEndTime() const override; | 161 base::Time GetEndTime() const override; |
161 bool CanShowInFolder() override; | 162 bool CanShowInFolder() override; |
162 bool CanOpenDownload() override; | 163 bool CanOpenDownload() override; |
163 bool ShouldOpenFileBasedOnExtension() override; | 164 bool ShouldOpenFileBasedOnExtension() override; |
164 bool GetOpenWhenComplete() const override; | 165 bool GetOpenWhenComplete() const override; |
165 bool GetAutoOpened() override; | 166 bool GetAutoOpened() override; |
166 bool GetOpened() const override; | 167 bool GetOpened() const override; |
167 base::Time GetLastAccessTime() const override; | 168 base::Time GetLastAccessTime() const override; |
| 169 bool IsVisible() const override; |
168 BrowserContext* GetBrowserContext() const override; | 170 BrowserContext* GetBrowserContext() const override; |
169 WebContents* GetWebContents() const override; | 171 WebContents* GetWebContents() const override; |
170 void OnContentCheckCompleted(DownloadDangerType danger_type) override; | 172 void OnContentCheckCompleted(DownloadDangerType danger_type) override; |
171 void SetOpenWhenComplete(bool open) override; | 173 void SetOpenWhenComplete(bool open) override; |
172 void SetOpened(bool opened) override; | 174 void SetOpened(bool opened) override; |
173 void SetLastAccessTime(base::Time last_access_time) override; | 175 void SetLastAccessTime(base::Time last_access_time) override; |
174 void SetDisplayName(const base::FilePath& name) override; | 176 void SetDisplayName(const base::FilePath& name) override; |
175 std::string DebugString(bool verbose) const override; | 177 std::string DebugString(bool verbose) const override; |
176 | 178 |
177 // All remaining public interfaces virtual to allow for DownloadItemImpl | 179 // All remaining public interfaces virtual to allow for DownloadItemImpl |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 624 |
623 // Did the user open the item either directly or indirectly (such as by | 625 // Did the user open the item either directly or indirectly (such as by |
624 // setting always open files of this type)? The shelf also sets this field | 626 // setting always open files of this type)? The shelf also sets this field |
625 // when the user closes the shelf before the item has been opened but should | 627 // when the user closes the shelf before the item has been opened but should |
626 // be treated as though the user opened it. | 628 // be treated as though the user opened it. |
627 bool opened_ = false; | 629 bool opened_ = false; |
628 | 630 |
629 // Time when the download was last accessed. | 631 // Time when the download was last accessed. |
630 base::Time last_access_time_; | 632 base::Time last_access_time_; |
631 | 633 |
| 634 // Whether the download item should be visible. |
| 635 bool visible_ = true; |
| 636 |
632 // Did the delegate delay calling Complete on this download? | 637 // Did the delegate delay calling Complete on this download? |
633 bool delegate_delayed_complete_ = false; | 638 bool delegate_delayed_complete_ = false; |
634 | 639 |
635 // Error return from DestinationError. Stored separately from | 640 // Error return from DestinationError. Stored separately from |
636 // last_reason_ so that we can avoid handling destination errors until | 641 // last_reason_ so that we can avoid handling destination errors until |
637 // after file name determination has occurred. | 642 // after file name determination has occurred. |
638 DownloadInterruptReason destination_error_ = DOWNLOAD_INTERRUPT_REASON_NONE; | 643 DownloadInterruptReason destination_error_ = DOWNLOAD_INTERRUPT_REASON_NONE; |
639 | 644 |
640 // The following fields describe the current state of the download file. | 645 // The following fields describe the current state of the download file. |
641 | 646 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 std::unique_ptr<DownloadJob> job_; | 700 std::unique_ptr<DownloadJob> job_; |
696 | 701 |
697 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 702 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
698 | 703 |
699 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 704 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
700 }; | 705 }; |
701 | 706 |
702 } // namespace content | 707 } // namespace content |
703 | 708 |
704 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 709 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
OLD | NEW |