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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 1974013002: Replace SkBitmap with gfx::Image in the ImageFetcher API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync again Created 4 years, 7 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 | « components/ntp_snippets/ntp_snippets_service.h ('k') | components/suggestions/image_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 448c31a6acce280820f5d0f8ce06910b45af1311..aa53f82f0ba84866e6e6132e7255ce376cf7cf0d 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -27,6 +27,7 @@
#include "components/prefs/pref_service.h"
#include "components/suggestions/proto/suggestions.pb.h"
#include "components/variations/variations_associated_data.h"
+#include "ui/gfx/image/image.h"
using image_fetcher::ImageFetcher;
using suggestions::ChromeSuggestion;
@@ -173,8 +174,8 @@ bool ContainsSnippet(const NTPSnippet::PtrVector& haystack,
void WrapImageFetchedCallback(
const NTPSnippetsService::ImageFetchedCallback& callback,
const GURL& snippet_id_url,
- const SkBitmap* bitmap) {
- callback.Run(snippet_id_url.spec(), bitmap);
+ const gfx::Image& image) {
+ callback.Run(snippet_id_url.spec(), image);
}
} // namespace
@@ -280,7 +281,8 @@ void NTPSnippetsService::FetchSnippetImage(
return snippet->id() == snippet_id;
});
if (it == snippets_.end()) {
- callback.Run(snippet_id, nullptr);
+ gfx::Image empty_image;
+ callback.Run(snippet_id, empty_image);
return;
}
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.h ('k') | components/suggestions/image_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698