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

Unified Diff: ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm

Issue 2772583005: Pass UIImage instead of gfx::Image in ContentSuggestions (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « no previous file | ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
index d2f6398bc491542467fdaba4b85bcbdd4108c018..6b3aab55065ca504f46ef5ac81174675f6066dce 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
@@ -307,12 +307,18 @@ ntp_snippets::ContentSuggestion::ID SuggestionIDForSectionID(
- (void)fetchImageForSuggestion:
(ContentSuggestionIdentifier*)suggestionIdentifier
- callback:(void (^)(const gfx::Image&))callback {
+ callback:(void (^)(UIImage*))callback {
self.contentService->FetchSuggestionImage(
SuggestionIDForSectionID(
[self categoryWrapperForSectionInfo:suggestionIdentifier.sectionInfo],
suggestionIdentifier.IDInSection),
- base::BindBlockArc(callback));
+ base::BindBlockArc(^(const gfx::Image& image) {
+ if (image.IsEmpty() || !callback) {
+ return;
+ }
+
+ callback([image.ToUIImage() copy]);
+ }));
}
#pragma mark - Private
« no previous file with comments | « no previous file | ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698