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

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

Issue 2818453002: Download favicon from server for suggested articles (Closed)
Patch Set: Address comments Created 3 years, 8 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 00daaae76b23a69668c80036f8e1ec1972d4c767..a775e4614961d087b0c20e3194aa76cd7d0f77ea 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
@@ -476,6 +476,18 @@ SectionIdentifier SectionIdentifierForInfo(
weakItem.attributes = attributes;
}];
+ __weak ContentSuggestionsCollectionUpdater* weakSelf = self;
+ [self.dataSource
+ fetchFaviconImageForSuggestion:articleItem.suggestionIdentifier
+ completion:^void(UIImage* favicon) {
+ if (!weakItem || !weakSelf)
+ return;
+
+ weakItem.attributes =
+ [FaviconAttributes attributesWithImage:favicon];
+ [weakSelf reconfigure:weakItem];
+ }];
+
return articleItem;
}

Powered by Google App Engine
This is Rietveld 408576698