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 COMPONENTS_READING_LIST_CORE_READING_LIST_MODEL_OBSERVER_H_ | 5 #ifndef COMPONENTS_READING_LIST_CORE_READING_LIST_MODEL_OBSERVER_H_ |
6 #define COMPONENTS_READING_LIST_CORE_READING_LIST_MODEL_OBSERVER_H_ | 6 #define COMPONENTS_READING_LIST_CORE_READING_LIST_MODEL_OBSERVER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 // once before ReadingListModelCompletedBatchUpdates, even if several updates | 25 // once before ReadingListModelCompletedBatchUpdates, even if several updates |
26 // are taking place at the same time. | 26 // are taking place at the same time. |
27 virtual void ReadingListModelBeganBatchUpdates( | 27 virtual void ReadingListModelBeganBatchUpdates( |
28 const ReadingListModel* model) {} | 28 const ReadingListModel* model) {} |
29 | 29 |
30 // Invoked when the batch updates have completed. This is called once all | 30 // Invoked when the batch updates have completed. This is called once all |
31 // batch updates are completed. | 31 // batch updates are completed. |
32 virtual void ReadingListModelCompletedBatchUpdates( | 32 virtual void ReadingListModelCompletedBatchUpdates( |
33 const ReadingListModel* model) {} | 33 const ReadingListModel* model) {} |
34 | 34 |
| 35 // Invoked before the destruction of the model. |
| 36 virtual void ReadingListModelBeingShutdown(const ReadingListModel* model) {} |
| 37 |
35 // Invoked from the destructor of the model. The model is no longer valid | 38 // 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 | 39 // after this call. There is no need to call RemoveObserver on the model from |
37 // here, as the observers are automatically deleted. | 40 // here, as the observers are automatically deleted. |
38 virtual void ReadingListModelBeingDeleted(const ReadingListModel* model) {} | 41 virtual void ReadingListModelBeingDeleted(const ReadingListModel* model) {} |
39 | 42 |
40 // Invoked when elements are about to be removed from the read or unread list. | 43 // Invoked when elements are about to be removed from the read or unread list. |
41 virtual void ReadingListWillRemoveEntry(const ReadingListModel* model, | 44 virtual void ReadingListWillRemoveEntry(const ReadingListModel* model, |
42 const GURL& url) {} | 45 const GURL& url) {} |
43 // Invoked when elements |MarkEntryUpdated| is called on an entry. This means | 46 // 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 | 47 // that the order of the entry may change and read/unread list may change |
(...skipping 29 matching lines...) Expand all Loading... |
74 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {} | 77 virtual void ReadingListDidApplyChanges(ReadingListModel* model) {} |
75 | 78 |
76 protected: | 79 protected: |
77 ReadingListModelObserver() {} | 80 ReadingListModelObserver() {} |
78 virtual ~ReadingListModelObserver() {} | 81 virtual ~ReadingListModelObserver() {} |
79 | 82 |
80 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver); | 83 DISALLOW_COPY_AND_ASSIGN(ReadingListModelObserver); |
81 }; | 84 }; |
82 | 85 |
83 #endif // COMPONENTS_READING_LIST_CORE_READING_LIST_MODEL_OBSERVER_H_ | 86 #endif // COMPONENTS_READING_LIST_CORE_READING_LIST_MODEL_OBSERVER_H_ |
OLD | NEW |