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

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

Issue 2772583005: Pass UIImage instead of gfx::Image in ContentSuggestions (Closed)
Patch Set: 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 f9ed02e30fc690818d4f1c6b6cb78b973e29daab..44e05aade968a6fd039c9e9271509ff6a934b8d9 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
@@ -302,12 +302,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.CopyUIImage());
stkhapugin 2017/03/24 16:31:40 This returns a retained UIImage. You need to use i
gambard 2017/03/28 07:22:28 Done.
+ }));
}
#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