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

Side by Side Diff: components/reading_list/ios/reading_list_store_delegate.h

Issue 2763233003: Move ReadingList model to components/reading_list/core (Closed)
Patch Set: feedback Created 3 years, 9 months 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_READING_LIST_IOS_READING_LIST_STORE_DELEGATE_H_
6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_DELEGATE_H_
7
8 #include <map>
9
10 #include "base/macros.h"
11
12 class ReadingListEntry;
13
14 // The delegate to handle callbacks from the ReadingListStore.
15 class ReadingListStoreDelegate {
16 public:
17 using ReadingListEntries = std::map<GURL, ReadingListEntry>;
18 // These three methods handle callbacks from a ReadingListStore.
19 // This method is called when the local store is loaded. |entries| contains
20 // the ReadingListEntry present on the device before sync starts.
21 virtual void StoreLoaded(std::unique_ptr<ReadingListEntries> entries) = 0;
22 // Handle sync events.
23 // Called to add a new entry to the model.
24 // |entry| must not already exist in the model.
25 virtual void SyncAddEntry(std::unique_ptr<ReadingListEntry> entry) = 0;
26
27 // Called to merge a sync entry with a local entry in the model.
28 // A local entry with the same URL must exist in the local store and have an
29 // older UpdateTime.
30 // Return a pointer to the merged entry.
31 virtual ReadingListEntry* SyncMergeEntry(
32 std::unique_ptr<ReadingListEntry> entry) = 0;
33
34 // Called to remove an entry to the model.
35 virtual void SyncRemoveEntry(const GURL& url) = 0;
36
37 protected:
38 ReadingListStoreDelegate() {}
39 virtual ~ReadingListStoreDelegate() {}
40
41 private:
42 DISALLOW_COPY_AND_ASSIGN(ReadingListStoreDelegate);
43 };
44
45 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/reading_list/ios/reading_list_store.cc ('k') | components/reading_list/ios/reading_list_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698