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

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

Issue 2708623002: Add an ID to the ContentSuggestion (Closed)
Patch Set: Add tests Created 3 years, 10 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
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 210b089ec4282ddceda7c66e2e8a75572a3e6b6f..0c14da3a6868fa286676cc4153378560a5732568 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
@@ -10,6 +10,7 @@
#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_suggestion.h"
+#import "ios/chrome/browser/ui/content_suggestions/content_suggestion_identifier.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"
@@ -149,7 +150,8 @@ SectionIdentifier SectionIdentifierForInfo(
NSArray<ContentSuggestion*>* suggestions = [self.dataSource allSuggestions];
for (ContentSuggestion* suggestion in suggestions) {
- NSInteger sectionIdentifier = [self addSectionIfNeeded:suggestion.section];
+ NSInteger sectionIdentifier =
+ [self addSectionIfNeeded:suggestion.suggestionIdentifier.sectionInfo];
ContentSuggestionsArticleItem* articleItem =
[[ContentSuggestionsArticleItem alloc]
initWithType:ItemTypeForContentSuggestionType(suggestion.type)
@@ -157,9 +159,12 @@ SectionIdentifier SectionIdentifierForInfo(
subtitle:suggestion.text
image:suggestion.image
url:suggestion.url];
+
articleItem.publisher = suggestion.publisher;
articleItem.publishDate = suggestion.publishDate;
+ articleItem.suggestionIdentifier = suggestion.suggestionIdentifier;
+
[model addItem:articleItem toSectionWithIdentifier:sectionIdentifier];
}
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698