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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 1995493002: Change the ntp_snippet_service to use a gfx image instead of SkBitmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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') | no next file » | 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 ac45e1536e20311d133ebabfdf07818253dba598..1e48da9fafce28240434524ed971ae44774097fb 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -149,10 +149,7 @@ void WrapImageFetchedCallback(
const NTPSnippetsService::ImageFetchedCallback& callback,
const GURL& snippet_id_url,
const gfx::Image& image) {
- const SkBitmap* bitmap = nullptr;
- if (!image.IsEmpty())
- bitmap = image.ToSkBitmap();
- callback.Run(snippet_id_url.spec(), bitmap);
+ callback.Run(snippet_id_url.spec(), image);
}
} // namespace
@@ -248,7 +245,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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698