Chromium Code Reviews| Index: ios/chrome/browser/ui/reading_list/reading_list_view_controller.h |
| diff --git a/ios/chrome/browser/ui/reading_list/reading_list_view_controller.h b/ios/chrome/browser/ui/reading_list/reading_list_view_controller.h |
| index 262f1854c238ebb8d0947dd58291ec3422747737..db19bbb76fe6049b76135fecabe6b54deca26b08 100644 |
| --- a/ios/chrome/browser/ui/reading_list/reading_list_view_controller.h |
| +++ b/ios/chrome/browser/ui/reading_list/reading_list_view_controller.h |
| @@ -17,31 +17,39 @@ class LargeIconService; |
| class ReadingListDownloadService; |
| class ReadingListModel; |
| +@class ReadingListViewController; |
| @class TabModel; |
| -// Audience for the ReadingListViewController, managing the visibility of the |
| -// toolbar and dismissing the Reading List View. |
| -@protocol ReadingListViewControllerAudience<NSObject> |
| +// Delegate for the ReadingListViewController, managing the visibility of the |
| +// toolbar, dismissing the Reading List View and opening elements. |
|
stkhapugin
2017/01/30 10:34:53
This protocol is becoming bloated, consider splitt
gambard
2017/01/31 09:35:40
For me it is still OK. But on a more general subje
|
| +@protocol ReadingListViewControllerDelegate<NSObject> |
| // Whether the collection has items. |
| -- (void)setCollectionHasItems:(BOOL)hasItems; |
| +- (void)readingListViewController: |
| + (ReadingListViewController*)readingListViewController |
| + hasItems:(BOOL)hasItems; |
| // Dismisses the Reading List View. |
| -- (void)dismiss; |
| +- (void)dismissReadingListViewController: |
| + (ReadingListViewController*)readingListViewController; |
| + |
| +// Displays a context menu attach to an element of the ReadingList View. |
|
stkhapugin
2017/01/30 10:34:53
I think your delegate displays a context menu, but
gambard
2017/01/31 09:35:40
Done.
|
| +- (void) |
| +readingListViewController:(ReadingListViewController*)readingListViewController |
| + didRecognizeLongPress:(UILongPressGestureRecognizer*)gestureRecognizer |
| + duringEdit:(BOOL)duringEdit; |
| + |
| +// Opens the entry at the indexPath. |
| +- (void)readingListViewController: |
| + (ReadingListViewController*)readingListViewController |
| + openItemAtIndexPath:(NSIndexPath*)indexPath; |
| @end |
| @interface ReadingListViewController |
| : CollectionViewController<ReadingListToolbarActions> |
| -@property(nonatomic, readonly) ReadingListModel* readingListModel; |
| -@property(weak, nonatomic, readonly) TabModel* tabModel; |
| -@property(nonatomic, readonly) favicon::LargeIconService* largeIconService; |
| -@property(nonatomic, readonly) |
| - ReadingListDownloadService* readingListDownloadService; |
| - |
| - (instancetype)initWithModel:(ReadingListModel*)model |
| - tabModel:(TabModel*)tabModel |
| largeIconService:(favicon::LargeIconService*)largeIconService |
| readingListDownloadService: |
| (ReadingListDownloadService*)readingListDownloadService |
| @@ -50,7 +58,17 @@ class ReadingListModel; |
| - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| NS_UNAVAILABLE; |
| -@property(nonatomic, weak) id<ReadingListViewControllerAudience> audience; |
| +@property(nonatomic, weak) id<ReadingListViewControllerDelegate> delegate; |
| +@property(nonatomic, readonly) ReadingListModel* readingListModel; |
| +@property(nonatomic, readonly) favicon::LargeIconService* largeIconService; |
| +@property(nonatomic, readonly) |
| + ReadingListDownloadService* readingListDownloadService; |
| + |
| +// Reloads all the data from the ReadingListModel. |
| +- (void)reloadData; |
| + |
| +// Stops observing the ReadingListModel. |
| +- (void)stopObservingReadingListModel; |
|
jif
2017/01/30 17:33:27
like we discussed offline, we can probably remove
|
| @end |