| 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 CHROME_BROWSER_NTP_SNIPPETS_FAKE_DOWNLOAD_ITEM_H_ | 5 #ifndef CHROME_BROWSER_NTP_SNIPPETS_FAKE_DOWNLOAD_ITEM_H_ |
| 6 #define CHROME_BROWSER_NTP_SNIPPETS_FAKE_DOWNLOAD_ITEM_H_ | 6 #define CHROME_BROWSER_NTP_SNIPPETS_FAKE_DOWNLOAD_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 void NotifyDownloadRemoved(); | 33 void NotifyDownloadRemoved(); |
| 34 | 34 |
| 35 void NotifyDownloadUpdated(); | 35 void NotifyDownloadUpdated(); |
| 36 | 36 |
| 37 void UpdateObservers() override; | 37 void UpdateObservers() override; |
| 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); |
| 43 const std::string& GetGuid() const override; |
| 44 |
| 42 void SetURL(const GURL& url); | 45 void SetURL(const GURL& url); |
| 43 const GURL& GetURL() const override; | 46 const GURL& GetURL() const override; |
| 44 | 47 |
| 45 void SetTargetFilePath(const base::FilePath& file_path); | 48 void SetTargetFilePath(const base::FilePath& file_path); |
| 46 const base::FilePath& GetTargetFilePath() const override; | 49 const base::FilePath& GetTargetFilePath() const override; |
| 47 | 50 |
| 48 void SetFileExternallyRemoved(bool is_file_externally_removed); | 51 void SetFileExternallyRemoved(bool is_file_externally_removed); |
| 49 bool GetFileExternallyRemoved() const override; | 52 bool GetFileExternallyRemoved() const override; |
| 50 | 53 |
| 51 void SetStartTime(base::Time start_time); | 54 void SetStartTime(base::Time start_time); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 66 // The methods below are not supported and are not expected to be called. | 69 // The methods below are not supported and are not expected to be called. |
| 67 void ValidateDangerousDownload() override; | 70 void ValidateDangerousDownload() override; |
| 68 void StealDangerousDownload(bool delete_file_afterward, | 71 void StealDangerousDownload(bool delete_file_afterward, |
| 69 const AcquireFileCallback& callback) override; | 72 const AcquireFileCallback& callback) override; |
| 70 void Pause() override; | 73 void Pause() override; |
| 71 void Resume() override; | 74 void Resume() override; |
| 72 void Cancel(bool user_cancel) override; | 75 void Cancel(bool user_cancel) override; |
| 73 void Remove() override; | 76 void Remove() override; |
| 74 void OpenDownload() override; | 77 void OpenDownload() override; |
| 75 void ShowDownloadInShell() override; | 78 void ShowDownloadInShell() override; |
| 76 const std::string& GetGuid() const override; | |
| 77 content::DownloadInterruptReason GetLastReason() const override; | 79 content::DownloadInterruptReason GetLastReason() const override; |
| 78 bool IsPaused() const override; | 80 bool IsPaused() const override; |
| 79 bool IsTemporary() const override; | 81 bool IsTemporary() const override; |
| 80 bool CanResume() const override; | 82 bool CanResume() const override; |
| 81 bool IsDone() const override; | 83 bool IsDone() const override; |
| 82 const std::vector<GURL>& GetUrlChain() const override; | 84 const std::vector<GURL>& GetUrlChain() const override; |
| 83 const GURL& GetReferrerUrl() const override; | 85 const GURL& GetReferrerUrl() const override; |
| 84 const GURL& GetSiteUrl() const override; | 86 const GURL& GetSiteUrl() const override; |
| 85 const GURL& GetTabUrl() const override; | 87 const GURL& GetTabUrl() const override; |
| 86 const GURL& GetTabReferrerUrl() const override; | 88 const GURL& GetTabReferrerUrl() const override; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 content::DownloadDangerType danger_type) override; | 124 content::DownloadDangerType danger_type) override; |
| 123 void SetOpenWhenComplete(bool open) override; | 125 void SetOpenWhenComplete(bool open) override; |
| 124 void SetOpened(bool opened) override; | 126 void SetOpened(bool opened) override; |
| 125 void SetLastAccessTime(base::Time time) override; | 127 void SetLastAccessTime(base::Time time) override; |
| 126 void SetDisplayName(const base::FilePath& name) override; | 128 void SetDisplayName(const base::FilePath& name) override; |
| 127 std::string DebugString(bool verbose) const override; | 129 std::string DebugString(bool verbose) const override; |
| 128 | 130 |
| 129 private: | 131 private: |
| 130 base::ObserverList<Observer> observers_; | 132 base::ObserverList<Observer> observers_; |
| 131 uint32_t id_; | 133 uint32_t id_; |
| 134 std::string guid_; |
| 132 GURL url_; | 135 GURL url_; |
| 133 base::FilePath file_path_; | 136 base::FilePath file_path_; |
| 134 bool is_file_externally_removed_; | 137 bool is_file_externally_removed_; |
| 135 base::Time start_time_; | 138 base::Time start_time_; |
| 136 base::Time end_time_; | 139 base::Time end_time_; |
| 137 DownloadState download_state_; | 140 DownloadState download_state_; |
| 138 std::string mime_type_; | 141 std::string mime_type_; |
| 139 GURL original_url_; | 142 GURL original_url_; |
| 140 | 143 |
| 141 // The members below are to be returned by methods, which return by reference. | 144 // The members below are to be returned by methods, which return by reference. |
| 142 std::string dummy_string; | 145 std::string dummy_string; |
| 143 std::vector<GURL> dummy_url_vector; | 146 std::vector<GURL> dummy_url_vector; |
| 144 GURL dummy_url; | 147 GURL dummy_url; |
| 145 base::FilePath dummy_file_path; | 148 base::FilePath dummy_file_path; |
| 146 | 149 |
| 147 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); | 150 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); |
| 148 }; | 151 }; |
| 149 | 152 |
| 150 } // namespace test | 153 } // namespace test |
| 151 | 154 |
| 152 #endif // CHROME_BROWSER_NTP_SNIPPETS_FAKE_DOWNLOAD_ITEM_H_ | 155 #endif // CHROME_BROWSER_NTP_SNIPPETS_FAKE_DOWNLOAD_ITEM_H_ |
| OLD | NEW |