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

Side by Side Diff: components/reading_list/ios/reading_list_model_observer.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_MODEL_OBSERVER_H_
6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_OBSERVER_H_
7
8 #include <set>
9 #include <vector>
10
11 #include "components/reading_list/ios/reading_list_entry.h"
12
13 class GURL;
14 class ReadingListModel;
15
16 // Observer for the Reading List model. In the observer methods care should be
17 // taken to not modify the model.
18 class ReadingListModelObserver {
19 public:
20 // Invoked when the model has finished loading. Until this method is called it
21 // is unsafe to use the model.
22 virtual void ReadingListModelLoaded(const ReadingListModel* model) = 0;
23
24 // Invoked when the batch updates are about to start. It will only be called
25 // once before ReadingListModelCompletedBatchUpdates, even if several updates
26 // are taking place at the same time.
27 virtual void ReadingListModelBeganBatchUpdates(
28 const ReadingListModel* model) {}
29
30 // Invoked when the batch updates have completed. This is called once all
31 // batch updates are completed.
32 virtual void ReadingListModelCompletedBatchUpdates(
33 const ReadingListModel* model) {}
34
35 // Invoked from the destructor of the model. The model is no longer valid
36 // after this call. There is no need to call RemoveObserver on the model from
37 // here, as the observers are automatically deleted.
38 virtual void ReadingListModelBeingDeleted(const ReadingListModel* model) {}
39
40 // Invoked when elements are about to be removed from the read or unread list.
41 virtual void ReadingListWillRemoveEntry(const ReadingListModel* model,
42 const GURL& url) {}
43 // Invoked when elements |MarkEntryUpdated| is called on an entry. This means
44 // that the order of the entry may change and read/unread list may change
45 // too.
46 virtual void ReadingListWillMoveEntry(const ReadingListModel* model,
47 const GURL& url) {}
48
49 // Invoked when elements |MarkEntryUpdated| has been called on an entry. This
50 // means that the order of the entry may have changed and read/unread list may
51 // have changed too.
52 virtual void ReadingListDidMoveEntry(const ReadingListModel* model,
53 const GURL& url) {}
54
55 // Invoked when elements are added.
56 virtual void ReadingListWillAddEntry(const ReadingListModel* model,
57 const ReadingListEntry& entry) {}
58
59 // Invoked when elements have been added. This method is called after the
60 // the entry has been added to the model and the entry can now be retrieved
61 // from the model.
62 // |source| says where the entry came from.
63 virtual void ReadingListDidAddEntry(const ReadingListModel* model,
64 const GURL& url,
65 reading_list::EntrySource source) {}
66
67 // Invoked when an entry is about to change.
68 virtual void ReadingListWillUpdateEntry(const ReadingListModel* model,
69 const GURL& url) {}
70
71 // Called after all the changes signaled by calls to the "Will" methods are
72 // done. All the "Will" methods are called as necessary, then the changes
73 // are applied and then this method is called.
74 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {}
75
76 protected:
77 ReadingListModelObserver() {}
78 virtual ~ReadingListModelObserver() {}
79
80 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver);
81 };
82
83 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_OBSERVER_H_
OLDNEW
« no previous file with comments | « components/reading_list/ios/reading_list_model_impl.cc ('k') | components/reading_list/ios/reading_list_model_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698