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