| 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 COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "components/offline_pages/offline_page_model.h" | 12 #include "components/offline_pages/offline_page_model.h" |
| 13 | 13 |
| 14 namespace offline_pages { | 14 namespace offline_pages { |
| 15 | 15 |
| 16 // Stub implementation of OfflinePageModel interface for testing. Besides using | 16 // Stub implementation of OfflinePageModel interface for testing. Besides using |
| 17 // as a stub for tests, it may also be subclassed to mock specific methods | 17 // as a stub for tests, it may also be subclassed to mock specific methods |
| 18 // needed for a set of tests. | 18 // needed for a set of tests. |
| 19 class StubOfflinePageModel : public OfflinePageModel { | 19 class StubOfflinePageModel : public OfflinePageModel { |
| 20 public: | 20 public: |
| 21 StubOfflinePageModel(); | 21 StubOfflinePageModel(); |
| 22 ~StubOfflinePageModel() override; | 22 ~StubOfflinePageModel() override; |
| 23 | 23 |
| 24 void AddObserver(Observer* observer) override; | 24 void AddObserver(Observer* observer) override; |
| 25 void RemoveObserver(Observer* observer) override; | 25 void RemoveObserver(Observer* observer) override; |
| 26 void SavePage(const GURL& url, | 26 void SavePage(const GURL& url, |
| 27 const ClientId& client_id, | 27 const ClientId& client_id, |
| 28 int64_t proposed_offline_id, |
| 28 std::unique_ptr<OfflinePageArchiver> archiver, | 29 std::unique_ptr<OfflinePageArchiver> archiver, |
| 29 const SavePageCallback& callback) override; | 30 const SavePageCallback& callback) override; |
| 30 void MarkPageAccessed(int64_t offline_id) override; | 31 void MarkPageAccessed(int64_t offline_id) override; |
| 31 void ClearAll(const base::Closure& callback) override; | 32 void ClearAll(const base::Closure& callback) override; |
| 32 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 33 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
| 33 const DeletePageCallback& callback) override; | 34 const DeletePageCallback& callback) override; |
| 34 void DeletePagesByURLPredicate(const UrlPredicate& predicate, | 35 void DeletePagesByURLPredicate(const UrlPredicate& predicate, |
| 35 const DeletePageCallback& callback) override; | 36 const DeletePageCallback& callback) override; |
| 36 void HasPages(const std::string& name_space, | 37 void HasPages(const std::string& name_space, |
| 37 const HasPagesCallback& callback) override; | 38 const HasPagesCallback& callback) override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 bool is_loaded() const override; | 70 bool is_loaded() const override; |
| 70 OfflineEventLogger* GetLogger() override; | 71 OfflineEventLogger* GetLogger() override; |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 std::vector<int64_t> offline_ids_; | 74 std::vector<int64_t> offline_ids_; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 } // namespace offline_pages | 77 } // namespace offline_pages |
| 77 | 78 |
| 78 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ | 79 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |