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

Unified Diff: chrome/browser/search/suggestions/suggestions_ui.cc

Issue 2000653002: Replace the usage of SkBitmap with gfx::Image in the suggestion service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace SkBitmap with gfx::Image in the suggestions_service interface 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
Index: chrome/browser/search/suggestions/suggestions_ui.cc
diff --git a/chrome/browser/search/suggestions/suggestions_ui.cc b/chrome/browser/search/suggestions/suggestions_ui.cc
index de84dc44fc487998a1c0f7f139c57dd05f48b23e..9bd73d50239a163ca4b8ed95e08347f4ad598aeb 100644
--- a/chrome/browser/search/suggestions/suggestions_ui.cc
+++ b/chrome/browser/search/suggestions/suggestions_ui.cc
@@ -28,6 +28,7 @@
#include "net/base/escape.h"
#include "ui/base/l10n/time_format.h"
#include "ui/gfx/codec/png_codec.h"
+#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "url/gurl.h"
@@ -145,7 +146,7 @@ class SuggestionsSource : public content::URLDataSource {
// Callback for responses from each Thumbnail request.
void OnThumbnailAvailable(RequestContext* context, base::Closure barrier,
- const GURL& url, const SkBitmap* bitmap);
+ const GURL& url, const gfx::Image& image);
// Callback for when all requests are complete. Renders the output webpage and
// passes the result to the original caller.
@@ -249,10 +250,10 @@ void SuggestionsSource::OnThumbnailsFetched(RequestContext* context) {
void SuggestionsSource::OnThumbnailAvailable(RequestContext* context,
base::Closure barrier,
const GURL& url,
- const SkBitmap* bitmap) {
- if (bitmap) {
+ const gfx::Image& image) {
+ if (!image.IsEmpty()) {
std::vector<unsigned char> output;
- gfx::PNGCodec::EncodeBGRASkBitmap(*bitmap, false, &output);
+ gfx::PNGCodec::EncodeBGRASkBitmap(*image.ToSkBitmap(), false, &output);
std::string encoded_output;
base::Base64Encode(

Powered by Google App Engine
This is Rietveld 408576698