| 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 and |read| the origin status. The element | 44 // |index| is the original position in the origin list. The element will be |
| 45 // will change list and/or index but will not be deleted. | 45 // added to the beginning of the target list. |
| 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) {} | |
| 49 | 48 |
| 50 // Invoked when elements are added to the read or the unread list. The new | 49 // Invoked when elements are added to the read or the unread list. The new |
| 51 // entries are always added at the beginning. these methods may be called | 50 // entries are always added at the beginning. these methods may be called |
| 52 // multiple time (to process changes coming from a synchronization for | 51 // multiple time (to process changes coming from a synchronization for |
| 53 // example) and they will be executed in call order, the last call will end up | 52 // example) and they will be executed in call order, the last call will end up |
| 54 // in first position. | 53 // in first position. |
| 55 virtual void ReadingListWillAddUnreadEntry(const ReadingListModel* model, | 54 virtual void ReadingListWillAddUnreadEntry(const ReadingListModel* model, |
| 56 const ReadingListEntry& entry) {} | 55 const ReadingListEntry& entry) {} |
| 57 | 56 |
| 58 virtual void ReadingListWillAddReadEntry(const ReadingListModel* model, | 57 virtual void ReadingListWillAddReadEntry(const ReadingListModel* model, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 70 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {} | 69 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {} |
| 71 | 70 |
| 72 protected: | 71 protected: |
| 73 ReadingListModelObserver() {} | 72 ReadingListModelObserver() {} |
| 74 virtual ~ReadingListModelObserver() {} | 73 virtual ~ReadingListModelObserver() {} |
| 75 | 74 |
| 76 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver); | 75 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver); |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ | 78 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_OBSERVER_H_ |
| OLD | NEW |