OLD | NEW |
1 | 1 |
2 // Copyright 2016 The Chromium Authors. All rights reserved. | 2 // Copyright 2016 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #ifndef COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_BRIDGE_OBSERVER_H_ | 6 #ifndef COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_BRIDGE_OBSERVER_H_ |
7 #define COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_BRIDGE_OBSERVER_H_ | 7 #define COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_BRIDGE_OBSERVER_H_ |
8 | 8 |
9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 - (void)readingListModel:(const ReadingListModel*)model | 29 - (void)readingListModel:(const ReadingListModel*)model |
30 willAddEntry:(const ReadingListEntry&)entry; | 30 willAddEntry:(const ReadingListEntry&)entry; |
31 | 31 |
32 - (void)readingListModel:(const ReadingListModel*)model | 32 - (void)readingListModel:(const ReadingListModel*)model |
33 didAddEntry:(const GURL&)url | 33 didAddEntry:(const GURL&)url |
34 entrySource:(reading_list::EntrySource)source; | 34 entrySource:(reading_list::EntrySource)source; |
35 | 35 |
36 - (void)readingListModelBeganBatchUpdates:(const ReadingListModel*)model; | 36 - (void)readingListModelBeganBatchUpdates:(const ReadingListModel*)model; |
37 - (void)readingListModelCompletedBatchUpdates:(const ReadingListModel*)model; | 37 - (void)readingListModelCompletedBatchUpdates:(const ReadingListModel*)model; |
38 | 38 |
| 39 - (void)readingListModelBeingShutdown:(const ReadingListModel*)model; |
39 - (void)readingListModelBeingDeleted:(const ReadingListModel*)model; | 40 - (void)readingListModelBeingDeleted:(const ReadingListModel*)model; |
40 | 41 |
41 - (void)readingListModel:(const ReadingListModel*)model | 42 - (void)readingListModel:(const ReadingListModel*)model |
42 willUpdateEntry:(const GURL&)url; | 43 willUpdateEntry:(const GURL&)url; |
43 | 44 |
44 @end | 45 @end |
45 | 46 |
46 // Observer for the Reading List model that translates all the callbacks to | 47 // Observer for the Reading List model that translates all the callbacks to |
47 // Objective-C calls. | 48 // Objective-C calls. |
48 class ReadingListModelBridge : public ReadingListModelObserver { | 49 class ReadingListModelBridge : public ReadingListModelObserver { |
49 public: | 50 public: |
50 explicit ReadingListModelBridge(id<ReadingListModelBridgeObserver> observer, | 51 explicit ReadingListModelBridge(id<ReadingListModelBridgeObserver> observer, |
51 ReadingListModel* model); | 52 ReadingListModel* model); |
52 ~ReadingListModelBridge() override; | 53 ~ReadingListModelBridge() override; |
53 | 54 |
54 private: | 55 private: |
55 void ReadingListModelBeganBatchUpdates( | 56 void ReadingListModelBeganBatchUpdates( |
56 const ReadingListModel* model) override; | 57 const ReadingListModel* model) override; |
57 | 58 |
58 void ReadingListModelCompletedBatchUpdates( | 59 void ReadingListModelCompletedBatchUpdates( |
59 const ReadingListModel* model) override; | 60 const ReadingListModel* model) override; |
60 void ReadingListModelLoaded(const ReadingListModel* model) override; | 61 void ReadingListModelLoaded(const ReadingListModel* model) override; |
| 62 void ReadingListModelBeingShutdown(const ReadingListModel* model) override; |
61 void ReadingListModelBeingDeleted(const ReadingListModel* model) override; | 63 void ReadingListModelBeingDeleted(const ReadingListModel* model) override; |
62 void ReadingListWillRemoveEntry(const ReadingListModel* model, | 64 void ReadingListWillRemoveEntry(const ReadingListModel* model, |
63 const GURL& url) override; | 65 const GURL& url) override; |
64 void ReadingListWillMoveEntry(const ReadingListModel* model, | 66 void ReadingListWillMoveEntry(const ReadingListModel* model, |
65 const GURL& url) override; | 67 const GURL& url) override; |
66 void ReadingListWillAddEntry(const ReadingListModel* model, | 68 void ReadingListWillAddEntry(const ReadingListModel* model, |
67 const ReadingListEntry& entry) override; | 69 const ReadingListEntry& entry) override; |
68 void ReadingListDidAddEntry(const ReadingListModel* model, | 70 void ReadingListDidAddEntry(const ReadingListModel* model, |
69 const GURL& url, | 71 const GURL& url, |
70 reading_list::EntrySource source) override; | 72 reading_list::EntrySource source) override; |
71 void ReadingListDidApplyChanges(ReadingListModel* model) override; | 73 void ReadingListDidApplyChanges(ReadingListModel* model) override; |
72 void ReadingListWillUpdateEntry(const ReadingListModel* model, | 74 void ReadingListWillUpdateEntry(const ReadingListModel* model, |
73 const GURL& url) override; | 75 const GURL& url) override; |
74 | 76 |
75 __unsafe_unretained id<ReadingListModelBridgeObserver> observer_; | 77 __unsafe_unretained id<ReadingListModelBridgeObserver> observer_; |
76 ReadingListModel* model_; // weak | 78 ReadingListModel* model_; // weak |
77 | 79 |
78 DISALLOW_COPY_AND_ASSIGN(ReadingListModelBridge); | 80 DISALLOW_COPY_AND_ASSIGN(ReadingListModelBridge); |
79 }; | 81 }; |
80 | 82 |
81 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_BRIDGE_OBSERVER_H_ | 83 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_MODEL_BRIDGE_OBSERVER_H_ |
OLD | NEW |