| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ |
| 6 #define CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ | 6 #define CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 void SetState(const DownloadState& state); | 60 void SetState(const DownloadState& state); |
| 61 DownloadState GetState() const override; | 61 DownloadState GetState() const override; |
| 62 | 62 |
| 63 void SetMimeType(const std::string& mime_type); | 63 void SetMimeType(const std::string& mime_type); |
| 64 std::string GetMimeType() const override; | 64 std::string GetMimeType() const override; |
| 65 | 65 |
| 66 void SetOriginalUrl(const GURL& url); | 66 void SetOriginalUrl(const GURL& url); |
| 67 const GURL& GetOriginalUrl() const override; | 67 const GURL& GetOriginalUrl() const override; |
| 68 | 68 |
| 69 void SetLastReason(DownloadInterruptReason last_reason); |
| 70 DownloadInterruptReason GetLastReason() const override; |
| 71 |
| 69 // The methods below are not supported and are not expected to be called. | 72 // The methods below are not supported and are not expected to be called. |
| 70 void ValidateDangerousDownload() override; | 73 void ValidateDangerousDownload() override; |
| 71 void StealDangerousDownload(bool delete_file_afterward, | 74 void StealDangerousDownload(bool delete_file_afterward, |
| 72 const AcquireFileCallback& callback) override; | 75 const AcquireFileCallback& callback) override; |
| 73 void Pause() override; | 76 void Pause() override; |
| 74 void Resume() override; | 77 void Resume() override; |
| 75 void Cancel(bool user_cancel) override; | 78 void Cancel(bool user_cancel) override; |
| 76 void Remove() override; | 79 void Remove() override; |
| 77 void OpenDownload() override; | 80 void OpenDownload() override; |
| 78 void ShowDownloadInShell() override; | 81 void ShowDownloadInShell() override; |
| 79 DownloadInterruptReason GetLastReason() const override; | |
| 80 bool IsPaused() const override; | 82 bool IsPaused() const override; |
| 81 bool IsTemporary() const override; | 83 bool IsTemporary() const override; |
| 82 bool CanResume() const override; | 84 bool CanResume() const override; |
| 83 bool IsDone() const override; | 85 bool IsDone() const override; |
| 84 const std::vector<GURL>& GetUrlChain() const override; | 86 const std::vector<GURL>& GetUrlChain() const override; |
| 85 const GURL& GetReferrerUrl() const override; | 87 const GURL& GetReferrerUrl() const override; |
| 86 const GURL& GetSiteUrl() const override; | 88 const GURL& GetSiteUrl() const override; |
| 87 const GURL& GetTabUrl() const override; | 89 const GURL& GetTabUrl() const override; |
| 88 const GURL& GetTabReferrerUrl() const override; | 90 const GURL& GetTabReferrerUrl() const override; |
| 89 std::string GetSuggestedFilename() const override; | 91 std::string GetSuggestedFilename() const override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 WebContents* GetWebContents() const override; | 124 WebContents* GetWebContents() const override; |
| 123 void OnContentCheckCompleted(DownloadDangerType danger_type) override; | 125 void OnContentCheckCompleted(DownloadDangerType danger_type) override; |
| 124 void SetOpenWhenComplete(bool open) override; | 126 void SetOpenWhenComplete(bool open) override; |
| 125 void SetOpened(bool opened) override; | 127 void SetOpened(bool opened) override; |
| 126 void SetLastAccessTime(base::Time time) override; | 128 void SetLastAccessTime(base::Time time) override; |
| 127 void SetDisplayName(const base::FilePath& name) override; | 129 void SetDisplayName(const base::FilePath& name) override; |
| 128 std::string DebugString(bool verbose) const override; | 130 std::string DebugString(bool verbose) const override; |
| 129 | 131 |
| 130 private: | 132 private: |
| 131 base::ObserverList<Observer> observers_; | 133 base::ObserverList<Observer> observers_; |
| 132 uint32_t id_; | 134 uint32_t id_ = 0; |
| 133 std::string guid_; | 135 std::string guid_; |
| 134 GURL url_; | 136 GURL url_; |
| 135 base::FilePath file_path_; | 137 base::FilePath file_path_; |
| 136 bool is_file_externally_removed_; | 138 bool is_file_externally_removed_ = false; |
| 137 base::Time start_time_; | 139 base::Time start_time_; |
| 138 base::Time end_time_; | 140 base::Time end_time_; |
| 139 DownloadState download_state_; | 141 // MAX_DOWNLOAD_STATE is used as the uninitialized state. |
| 142 DownloadState download_state_ = |
| 143 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE; |
| 140 std::string mime_type_; | 144 std::string mime_type_; |
| 141 GURL original_url_; | 145 GURL original_url_; |
| 146 DownloadInterruptReason last_reason_ = |
| 147 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE; |
| 142 | 148 |
| 143 // The members below are to be returned by methods, which return by reference. | 149 // The members below are to be returned by methods, which return by reference. |
| 144 std::string dummy_string; | 150 std::string dummy_string; |
| 145 std::vector<GURL> dummy_url_vector; | 151 std::vector<GURL> dummy_url_vector; |
| 146 GURL dummy_url; | 152 GURL dummy_url; |
| 147 base::FilePath dummy_file_path; | 153 base::FilePath dummy_file_path; |
| 148 | 154 |
| 149 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); | 155 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); |
| 150 }; | 156 }; |
| 151 | 157 |
| 152 } // namespace content | 158 } // namespace content |
| 153 | 159 |
| 154 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ | 160 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ |
| OLD | NEW |