Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm

Issue 2638413006: Add ContentSuggestionsMediator (Closed)
Patch Set: Format Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..68c32ab775c5bb5cb77db29a2829f1acdc8c50f8 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, weak) 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,10 @@
_collectionViewController = collectionViewController;
[collectionViewController loadModel];
CollectionViewModel* model = collectionViewController.collectionViewModel;
+
+ // TODO(crbug.com/686728): Load the data with the dataSource instead of hard
+ // coded value.
+
NSInteger sectionIdentifier = kSectionIdentifierEnumZero;
// Stack Item.
@@ -88,6 +111,12 @@
}
}
+#pragma mark - ContentSuggestionsDataSink
+
+- (void)dataAvailable {
+ // TODO(crbug.com/686728): Get the new data from the DataSource.
+}
+
#pragma mark - Public methods
- (void)addTextItem:(NSString*)title

Powered by Google App Engine
This is Rietveld 408576698