Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: components/offline_pages/stub_offline_page_model.h

Issue 2489443002: Move all components/offline_pages/ files into component/offline_pages/core (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
6 #define COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
7
8 #include <set>
9 #include <string>
10 #include <vector>
11
12 #include "components/keyed_service/core/keyed_service.h"
13 #include "components/offline_pages/client_policy_controller.h"
14 #include "components/offline_pages/offline_page_model.h"
15
16 namespace offline_pages {
17
18 // Stub implementation of OfflinePageModel interface for testing. Besides using
19 // as a stub for tests, it may also be subclassed to mock specific methods
20 // needed for a set of tests.
21 class StubOfflinePageModel : public OfflinePageModel, public KeyedService {
22 public:
23 StubOfflinePageModel();
24 ~StubOfflinePageModel() override;
25
26 void AddObserver(Observer* observer) override;
27 void RemoveObserver(Observer* observer) override;
28 void SavePage(const SavePageParams& save_page_params,
29 std::unique_ptr<OfflinePageArchiver> archiver,
30 const SavePageCallback& callback) override;
31 void MarkPageAccessed(int64_t offline_id) override;
32 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
33 const DeletePageCallback& callback) override;
34 void DeletePagesByClientIds(const std::vector<ClientId>& client_ids,
35 const DeletePageCallback& callback) override;
36 void GetPagesMatchingQuery(
37 std::unique_ptr<OfflinePageModelQuery> query,
38 const MultipleOfflinePageItemCallback& callback) override;
39 void GetPagesByClientIds(
40 const std::vector<ClientId>& client_ids,
41 const MultipleOfflinePageItemCallback& callback) override;
42 void DeleteCachedPagesByURLPredicate(
43 const UrlPredicate& predicate,
44 const DeletePageCallback& callback) override;
45 void CheckPagesExistOffline(
46 const std::set<GURL>& urls,
47 const CheckPagesExistOfflineCallback& callback) override;
48 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override;
49 void GetOfflineIdsForClientId(
50 const ClientId& client_id,
51 const MultipleOfflineIdCallback& callback) override;
52 void GetPageByOfflineId(
53 int64_t offline_id,
54 const SingleOfflinePageItemCallback& callback) override;
55 void GetPagesByURL(
56 const GURL& url,
57 URLSearchMode url_search_mode,
58 const MultipleOfflinePageItemCallback& callback) override;
59 ClientPolicyController* GetPolicyController() override;
60 bool is_loaded() const override;
61 OfflineEventLogger* GetLogger() override;
62
63 private:
64 ClientPolicyController policy_controller_;
65 std::vector<int64_t> offline_ids_;
66 };
67
68 } // namespace offline_pages
69
70 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
OLDNEW
« no previous file with comments | « components/offline_pages/snapshot_controller_unittest.cc ('k') | components/offline_pages/stub_offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698