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 IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ |
6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ |
7 | 7 |
8 #import <set> | 8 #import <set> |
9 #import <vector> | 9 #import <vector> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 // after this call. There is no need to call RemoveObserver on the model from | 34 // after this call. There is no need to call RemoveObserver on the model from |
35 // here, as the observers are automatically deleted. | 35 // here, as the observers are automatically deleted. |
36 virtual void ReadingListModelBeingDeleted(const ReadingListModel* model) {} | 36 virtual void ReadingListModelBeingDeleted(const ReadingListModel* model) {} |
37 | 37 |
38 // Invoked when elements are about to be removed from the read or unread list. | 38 // Invoked when elements are about to be removed from the read or unread list. |
39 virtual void ReadingListWillRemoveUnreadEntry(const ReadingListModel* model, | 39 virtual void ReadingListWillRemoveUnreadEntry(const ReadingListModel* model, |
40 size_t index) {} | 40 size_t index) {} |
41 virtual void ReadingListWillRemoveReadEntry(const ReadingListModel* model, | 41 virtual void ReadingListWillRemoveReadEntry(const ReadingListModel* model, |
42 size_t index) {} | 42 size_t index) {} |
43 // Invoked when elements are moved from unread to read or from read to unread. | 43 // Invoked when elements are moved from unread to read or from read to unread. |
44 // |index| is the original position in the origin list. The element will be | 44 // |index| is the original position and |read| the origin status. The element |
45 // added to the beginning of the target list. | 45 // will change list and/or index but will not be deleted. |
46 virtual void ReadingListWillMoveEntry(const ReadingListModel* model, | 46 virtual void ReadingListWillMoveEntry(const ReadingListModel* model, |
47 size_t index) {} | 47 size_t index, |
| 48 bool read) {} |
48 | 49 |
49 // Invoked when elements are added to the read or the unread list. The new | 50 // Invoked when elements are added to the read or the unread list. The new |
50 // entries are always added at the beginning. these methods may be called | 51 // entries are always added at the beginning. these methods may be called |
51 // multiple time (to process changes coming from a synchronization for | 52 // multiple time (to process changes coming from a synchronization for |
52 // example) and they will be executed in call order, the last call will end up | 53 // example) and they will be executed in call order, the last call will end up |
53 // in first position. | 54 // in first position. |
54 virtual void ReadingListWillAddUnreadEntry(const ReadingListModel* model, | 55 virtual void ReadingListWillAddUnreadEntry(const ReadingListModel* model, |
55 const ReadingListEntry& entry) {} | 56 const ReadingListEntry& entry) {} |
56 | 57 |
57 virtual void ReadingListWillAddReadEntry(const ReadingListModel* model, | 58 virtual void ReadingListWillAddReadEntry(const ReadingListModel* model, |
(...skipping 11 matching lines...) Expand all Loading... |
69 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {} | 70 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {} |
70 | 71 |
71 protected: | 72 protected: |
72 ReadingListModelObserver() {} | 73 ReadingListModelObserver() {} |
73 virtual ~ReadingListModelObserver() {} | 74 virtual ~ReadingListModelObserver() {} |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver); | 76 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver); |
76 }; | 77 }; |
77 | 78 |
78 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ | 79 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ |
OLD | NEW |