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

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: more 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 GetAllPagesWithExpired(
50 const MultipleOfflinePageItemCallback& callback) override;
51 void GetOfflineIdsForClientId(
52 const ClientId& client_id,
53 const MultipleOfflineIdCallback& callback) override;
54 void GetPageByOfflineId(
55 int64_t offline_id,
56 const SingleOfflinePageItemCallback& callback) override;
57 void GetPagesByURL(
58 const GURL& url,
59 URLSearchMode url_search_mode,
60 const MultipleOfflinePageItemCallback& callback) override;
61 void ExpirePages(const std::vector<int64_t>& offline_ids,
62 const base::Time& expiration_time,
63 const base::Callback<void(bool)>& callback) override;
64 ClientPolicyController* GetPolicyController() override;
65 bool is_loaded() const override;
66 OfflineEventLogger* GetLogger() override;
67
68 private:
69 ClientPolicyController policy_controller_;
70 std::vector<int64_t> offline_ids_;
71 };
72
73 } // namespace offline_pages
74
75 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698