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

Unified Diff: chrome/browser/favicon/favicon_util.cc

Issue 18501013: Move most importer code to chrome/utility/importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CanImport Created 7 years, 5 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/favicon/favicon_util.cc
diff --git a/chrome/browser/favicon/favicon_util.cc b/chrome/browser/favicon/favicon_util.cc
index 21c9d754086d5b4d63f7c7223e7d699a6db67750..eb4564d8d6fd90af37a631a7c823389b13370917 100644
--- a/chrome/browser/favicon/favicon_util.cc
+++ b/chrome/browser/favicon/favicon_util.cc
@@ -200,30 +200,3 @@ size_t FaviconUtil::SelectBestFaviconFromBitmaps(
DCHECK_EQ(1u, selected_bitmap_indices.size());
return selected_bitmap_indices[0];
}
-
-// static
-bool FaviconUtil::ReencodeFavicon(const unsigned char* src_data,
- size_t src_len,
- std::vector<unsigned char>* png_data) {
- // Decode the favicon using WebKit's image decoder.
- SkBitmap decoded = content::DecodeImage(
- src_data,
- gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize),
- src_len);
- if (decoded.empty())
- return false; // Unable to decode.
-
- if (decoded.width() != gfx::kFaviconSize ||
- decoded.height() != gfx::kFaviconSize) {
- // The bitmap is not the correct size, re-sample.
- int new_width = decoded.width();
- int new_height = decoded.height();
- gfx::CalculateFaviconTargetSize(&new_width, &new_height);
- decoded = skia::ImageOperations::Resize(
- decoded, skia::ImageOperations::RESIZE_LANCZOS3, new_width, new_height);
- }
-
- // Encode our bitmap as a PNG.
- gfx::PNGCodec::EncodeBGRASkBitmap(decoded, false, png_data);
- return true;
-}

Powered by Google App Engine
This is Rietveld 408576698