diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-13 04:41:11 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-13 04:41:11 +0000 |
commit | 0dc6bcd85cbf6dd0b85743d9330c2311bcd3bc99 (patch) | |
tree | 2fbb6f8fb09db9c17304d5d0586d3524dd482b23 /chrome/browser/favicon/favicon_util.cc | |
parent | 848070e1955f2467111115ca9514c15f7f9f6182 (diff) | |
download | chromium_src-0dc6bcd85cbf6dd0b85743d9330c2311bcd3bc99.zip chromium_src-0dc6bcd85cbf6dd0b85743d9330c2311bcd3bc99.tar.gz chromium_src-0dc6bcd85cbf6dd0b85743d9330c2311bcd3bc99.tar.bz2 |
Move favicon decoding code used only by importers into chrome/browser/importer
This code depends on the WebKit image decoders and really should only run in
child processes. This moves the code into chrome/browser/importer in anticipation
of the importer code migrating out-of-process.
BUG=237267
Review URL: https://chromiumcodereview.appspot.com/18977003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/favicon/favicon_util.cc')
-rw-r--r-- | chrome/browser/favicon/favicon_util.cc | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/chrome/browser/favicon/favicon_util.cc b/chrome/browser/favicon/favicon_util.cc index 21c9d75..e53a71c 100644 --- a/chrome/browser/favicon/favicon_util.cc +++ b/chrome/browser/favicon/favicon_util.cc @@ -6,8 +6,6 @@ #include "chrome/browser/favicon/favicon_types.h" #include "chrome/browser/history/select_favicon_frames.h" -#include "content/public/browser/render_view_host.h" -#include "content/public/child/image_decoder_utils.h" #include "skia/ext/image_operations.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/codec/png_codec.h" @@ -15,7 +13,6 @@ #include "ui/gfx/image/image_png_rep.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/size.h" -#include "url/gurl.h" #if defined(OS_MACOSX) && !defined(OS_IOS) #include "base/mac/mac_util.h" @@ -200,30 +197,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; -} |