| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 void SetId(uint32_t id); | 39 void SetId(uint32_t id); |
| 40 uint32_t GetId() const override; | 40 uint32_t GetId() const override; |
| 41 | 41 |
| 42 void SetGuid(const std::string& guid); | 42 void SetGuid(const std::string& guid); |
| 43 const std::string& GetGuid() const override; | 43 const std::string& GetGuid() const override; |
| 44 | 44 |
| 45 void SetURL(const GURL& url); | 45 void SetURL(const GURL& url); |
| 46 const GURL& GetURL() const override; | 46 const GURL& GetURL() const override; |
| 47 | 47 |
| 48 void SetUrlChain(const std::vector<GURL>& url_chain); |
| 49 const std::vector<GURL>& GetUrlChain() const override; |
| 50 |
| 48 void SetTargetFilePath(const base::FilePath& file_path); | 51 void SetTargetFilePath(const base::FilePath& file_path); |
| 49 const base::FilePath& GetTargetFilePath() const override; | 52 const base::FilePath& GetTargetFilePath() const override; |
| 50 | 53 |
| 51 void SetFileExternallyRemoved(bool is_file_externally_removed); | 54 void SetFileExternallyRemoved(bool is_file_externally_removed); |
| 52 bool GetFileExternallyRemoved() const override; | 55 bool GetFileExternallyRemoved() const override; |
| 53 | 56 |
| 54 void SetStartTime(base::Time start_time); | 57 void SetStartTime(base::Time start_time); |
| 55 base::Time GetStartTime() const override; | 58 base::Time GetStartTime() const override; |
| 56 | 59 |
| 57 void SetEndTime(base::Time end_time); | 60 void SetEndTime(base::Time end_time); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 82 void Pause() override; | 85 void Pause() override; |
| 83 void Resume() override; | 86 void Resume() override; |
| 84 void Cancel(bool user_cancel) override; | 87 void Cancel(bool user_cancel) override; |
| 85 void Remove() override; | 88 void Remove() override; |
| 86 void OpenDownload() override; | 89 void OpenDownload() override; |
| 87 void ShowDownloadInShell() override; | 90 void ShowDownloadInShell() override; |
| 88 bool IsPaused() const override; | 91 bool IsPaused() const override; |
| 89 bool IsTemporary() const override; | 92 bool IsTemporary() const override; |
| 90 bool CanResume() const override; | 93 bool CanResume() const override; |
| 91 bool IsDone() const override; | 94 bool IsDone() const override; |
| 92 const std::vector<GURL>& GetUrlChain() const override; | |
| 93 const GURL& GetReferrerUrl() const override; | 95 const GURL& GetReferrerUrl() const override; |
| 94 const GURL& GetSiteUrl() const override; | 96 const GURL& GetSiteUrl() const override; |
| 95 const GURL& GetTabUrl() const override; | 97 const GURL& GetTabUrl() const override; |
| 96 const GURL& GetTabReferrerUrl() const override; | 98 const GURL& GetTabReferrerUrl() const override; |
| 97 std::string GetSuggestedFilename() const override; | 99 std::string GetSuggestedFilename() const override; |
| 98 std::string GetContentDisposition() const override; | 100 std::string GetContentDisposition() const override; |
| 99 std::string GetOriginalMimeType() const override; | 101 std::string GetOriginalMimeType() const override; |
| 100 std::string GetRemoteAddress() const override; | 102 std::string GetRemoteAddress() const override; |
| 101 bool HasUserGesture() const override; | 103 bool HasUserGesture() const override; |
| 102 ui::PageTransition GetTransitionType() const override; | 104 ui::PageTransition GetTransitionType() const override; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 131 void SetOpenWhenComplete(bool open) override; | 133 void SetOpenWhenComplete(bool open) override; |
| 132 void SetOpened(bool opened) override; | 134 void SetOpened(bool opened) override; |
| 133 void SetDisplayName(const base::FilePath& name) override; | 135 void SetDisplayName(const base::FilePath& name) override; |
| 134 std::string DebugString(bool verbose) const override; | 136 std::string DebugString(bool verbose) const override; |
| 135 | 137 |
| 136 private: | 138 private: |
| 137 base::ObserverList<Observer> observers_; | 139 base::ObserverList<Observer> observers_; |
| 138 uint32_t id_ = 0; | 140 uint32_t id_ = 0; |
| 139 std::string guid_; | 141 std::string guid_; |
| 140 GURL url_; | 142 GURL url_; |
| 143 std::vector<GURL> url_chain_; |
| 141 base::FilePath file_path_; | 144 base::FilePath file_path_; |
| 142 bool is_file_externally_removed_ = false; | 145 bool is_file_externally_removed_ = false; |
| 143 base::Time start_time_; | 146 base::Time start_time_; |
| 144 base::Time end_time_; | 147 base::Time end_time_; |
| 145 base::Time last_access_time_; | 148 base::Time last_access_time_; |
| 146 // MAX_DOWNLOAD_STATE is used as the uninitialized state. | 149 // MAX_DOWNLOAD_STATE is used as the uninitialized state. |
| 147 DownloadState download_state_ = | 150 DownloadState download_state_ = |
| 148 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE; | 151 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE; |
| 149 std::string mime_type_; | 152 std::string mime_type_; |
| 150 GURL original_url_; | 153 GURL original_url_; |
| 151 DownloadInterruptReason last_reason_ = | 154 DownloadInterruptReason last_reason_ = |
| 152 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE; | 155 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE; |
| 153 int64_t received_bytes_ = 0; | 156 int64_t received_bytes_ = 0; |
| 154 | 157 |
| 155 // The members below are to be returned by methods, which return by reference. | 158 // The members below are to be returned by methods, which return by reference. |
| 156 std::string dummy_string; | 159 std::string dummy_string; |
| 157 std::vector<GURL> dummy_url_vector; | |
| 158 GURL dummy_url; | 160 GURL dummy_url; |
| 159 base::FilePath dummy_file_path; | 161 base::FilePath dummy_file_path; |
| 160 | 162 |
| 161 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); | 163 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); |
| 162 }; | 164 }; |
| 163 | 165 |
| 164 } // namespace content | 166 } // namespace content |
| 165 | 167 |
| 166 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ | 168 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ |
| OLD | NEW |