| 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/keyed_service/core/keyed_service.h" |
| 12 #include "components/offline_pages/offline_page_model.h" | 13 #include "components/offline_pages/offline_page_model.h" |
| 13 | 14 |
| 14 namespace offline_pages { | 15 namespace offline_pages { |
| 15 | 16 |
| 16 // Stub implementation of OfflinePageModel interface for testing. Besides using | 17 // Stub implementation of OfflinePageModel interface for testing. Besides using |
| 17 // as a stub for tests, it may also be subclassed to mock specific methods | 18 // as a stub for tests, it may also be subclassed to mock specific methods |
| 18 // needed for a set of tests. | 19 // needed for a set of tests. |
| 19 class StubOfflinePageModel : public OfflinePageModel { | 20 class StubOfflinePageModel : public OfflinePageModel, public KeyedService { |
| 20 public: | 21 public: |
| 21 StubOfflinePageModel(); | 22 StubOfflinePageModel(); |
| 22 ~StubOfflinePageModel() override; | 23 ~StubOfflinePageModel() override; |
| 23 | 24 |
| 24 void AddObserver(Observer* observer) override; | 25 void AddObserver(Observer* observer) override; |
| 25 void RemoveObserver(Observer* observer) override; | 26 void RemoveObserver(Observer* observer) override; |
| 26 void SavePage(const GURL& url, | 27 void SavePage(const GURL& url, |
| 27 const ClientId& client_id, | 28 const ClientId& client_id, |
| 28 int64_t proposed_offline_id, | 29 int64_t proposed_offline_id, |
| 29 std::unique_ptr<OfflinePageArchiver> archiver, | 30 std::unique_ptr<OfflinePageArchiver> archiver, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 bool is_loaded() const override; | 72 bool is_loaded() const override; |
| 72 OfflineEventLogger* GetLogger() override; | 73 OfflineEventLogger* GetLogger() override; |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 std::vector<int64_t> offline_ids_; | 76 std::vector<int64_t> offline_ids_; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace offline_pages | 79 } // namespace offline_pages |
| 79 | 80 |
| 80 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ | 81 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |