| Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
|
| diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
|
| index 6ba3bf0d340c143416dae2fdfca4c943d48adf6a..a50816265429f9f597c407e4cc66ed6f8ad2db8d 100644
|
| --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
|
| +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
|
| @@ -9,6 +9,8 @@
|
| #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h"
|
| #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.h"
|
| +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sink.h"
|
| +#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_data_source.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_expandable_item.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_item.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_item.h"
|
| @@ -19,9 +21,26 @@
|
| #error "This file requires ARC support."
|
| #endif
|
|
|
| +@interface ContentSuggestionsCollectionUpdater ()<ContentSuggestionsDataSink>
|
| +
|
| +@property(nonatomic, strong) id<ContentSuggestionsDataSource> dataSource;
|
| +
|
| +@end
|
| +
|
| @implementation ContentSuggestionsCollectionUpdater
|
|
|
| @synthesize collectionViewController = _collectionViewController;
|
| +@synthesize dataSource = _dataSource;
|
| +
|
| +- (instancetype)initWithDataSource:
|
| + (id<ContentSuggestionsDataSource>)dataSource {
|
| + self = [super init];
|
| + if (self) {
|
| + _dataSource = dataSource;
|
| + _dataSource.dataSink = self;
|
| + }
|
| + return self;
|
| +}
|
|
|
| #pragma mark - Properties
|
|
|
| @@ -30,6 +49,9 @@
|
| _collectionViewController = collectionViewController;
|
| [collectionViewController loadModel];
|
| CollectionViewModel* model = collectionViewController.collectionViewModel;
|
| +
|
| + // Loads the data with the dataSource instead of hard coded value.
|
| +
|
| NSInteger sectionIdentifier = kSectionIdentifierEnumZero;
|
|
|
| // Stack Item.
|
| @@ -88,6 +110,13 @@
|
| }
|
| }
|
|
|
| +#pragma mark - ContentSuggestionsDataSink
|
| +
|
| +- (void)dataAvailable {
|
| + [self.dataSource getMoreData];
|
| + // Do something.
|
| +}
|
| +
|
| #pragma mark - Public methods
|
|
|
| - (void)addTextItem:(NSString*)title
|
|
|