| 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_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTR
OLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTR
OLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTR
OLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CONTR
OLLER_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" | 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 11 | 11 |
| 12 @class ContentSuggestion; | 12 @class ContentSuggestionsSectionInformation; |
| 13 @protocol ContentSuggestionsCommands; | 13 @protocol ContentSuggestionsCommands; |
| 14 @protocol ContentSuggestionsDataSource; | 14 @protocol ContentSuggestionsDataSource; |
| 15 @protocol ContentSuggestionIdentification; | 15 @protocol SuggestedContent; |
| 16 | 16 |
| 17 // CollectionViewController to display the suggestions items. | 17 // CollectionViewController to display the suggestions items. |
| 18 @interface ContentSuggestionsViewController : CollectionViewController | 18 @interface ContentSuggestionsViewController : CollectionViewController |
| 19 | 19 |
| 20 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style | 20 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 21 dataSource:(id<ContentSuggestionsDataSource>)dataSource | 21 dataSource:(id<ContentSuggestionsDataSource>)dataSource |
| 22 NS_DESIGNATED_INITIALIZER; | 22 NS_DESIGNATED_INITIALIZER; |
| 23 | 23 |
| 24 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style | 24 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 25 NS_UNAVAILABLE; | 25 NS_UNAVAILABLE; |
| 26 | 26 |
| 27 // Handler for the commands sent by the ContentSuggestionsViewController. | 27 // Handler for the commands sent by the ContentSuggestionsViewController. |
| 28 @property(nonatomic, weak) id<ContentSuggestionsCommands> | 28 @property(nonatomic, weak) id<ContentSuggestionsCommands> |
| 29 suggestionCommandHandler; | 29 suggestionCommandHandler; |
| 30 // Override from superclass to have a more specific type. | 30 // Override from superclass to have a more specific type. |
| 31 @property(nonatomic, readonly) | 31 @property(nonatomic, readonly) |
| 32 CollectionViewModel<CollectionViewItem<ContentSuggestionIdentification>*>* | 32 CollectionViewModel<CollectionViewItem<SuggestedContent>*>* |
| 33 collectionViewModel; | 33 collectionViewModel; |
| 34 | 34 |
| 35 // Removes the entry at |indexPath|, from the collection and its model. | 35 // Removes the entry at |indexPath|, from the collection and its model. |
| 36 - (void)dismissEntryAtIndexPath:(NSIndexPath*)indexPath; | 36 - (void)dismissEntryAtIndexPath:(NSIndexPath*)indexPath; |
| 37 // Removes the |section|. | 37 // Removes the |section|. |
| 38 - (void)dismissSection:(NSInteger)section; | 38 - (void)dismissSection:(NSInteger)section; |
| 39 // Adds the |suggestions| to the collection and its model. | 39 // Adds the |suggestions| to the collection and its model in the section |
| 40 - (void)addSuggestions:(NSArray<ContentSuggestion*>*)suggestions; | 40 // corresponding to |sectionInfo|. |
| 41 - (void)addSuggestions: |
| 42 (NSArray<CollectionViewItem<SuggestedContent>*>*)suggestions |
| 43 toSectionInfo:(ContentSuggestionsSectionInformation*)sectionInfo; |
| 41 | 44 |
| 42 @end | 45 @end |
| 43 | 46 |
| 44 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CO
NTROLLER_H_ | 47 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_VIEW_CO
NTROLLER_H_ |
| OLD | NEW |