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); | |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 uint32_t id_; | 134 uint32_t id_; |
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_; |
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 DownloadState download_state_; |
140 std::string mime_type_; | 142 std::string mime_type_; |
141 GURL original_url_; | 143 GURL original_url_; |
144 DownloadInterruptReason last_reason_; | |
Peter Beverloo
2017/03/15 16:53:38
This is a scalar, we need to initialize it. |id_|
harkness
2017/03/16 11:41:10
Done.
| |
142 | 145 |
143 // The members below are to be returned by methods, which return by reference. | 146 // The members below are to be returned by methods, which return by reference. |
144 std::string dummy_string; | 147 std::string dummy_string; |
145 std::vector<GURL> dummy_url_vector; | 148 std::vector<GURL> dummy_url_vector; |
146 GURL dummy_url; | 149 GURL dummy_url; |
147 base::FilePath dummy_file_path; | 150 base::FilePath dummy_file_path; |
148 | 151 |
149 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); | 152 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); |
150 }; | 153 }; |
151 | 154 |
152 } // namespace content | 155 } // namespace content |
153 | 156 |
154 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ | 157 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ |
OLD | NEW |