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

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

Issue 2708623002: Add an ID to the ContentSuggestion (Closed)
Patch Set: 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
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 6e2c9a374327468ed7525c3cf60551133f5886b5..d66ca531ee895f0b69270f2665afd60619d393df 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,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_id.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"
@@ -184,7 +185,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.suggestionID.sectionInfo];
ContentSuggestionsArticleItem* articleItem =
[[ContentSuggestionsArticleItem alloc]
initWithType:ItemTypeForContentSuggestionType(suggestion.type)
@@ -192,6 +194,7 @@ SectionIdentifier SectionIdentifierForInfo(
subtitle:suggestion.text
image:suggestion.image
url:suggestion.url];
+ articleItem.suggestionID = suggestion.suggestionID;
[model addItem:articleItem toSectionWithIdentifier:sectionIdentifier];
}

Powered by Google App Engine
This is Rietveld 408576698