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

Unified Diff: chrome/browser/importer/reencode_favicon.cc

Issue 18501013: Move most importer code to chrome/utility/importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another gyp attempt 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
« no previous file with comments | « chrome/browser/importer/reencode_favicon.h ('k') | chrome/browser/importer/safari_importer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/reencode_favicon.cc
diff --git a/chrome/browser/importer/reencode_favicon.cc b/chrome/browser/importer/reencode_favicon.cc
deleted file mode 100644
index cbf261533e4ccd5ed192ddec91244aa263ee6555..0000000000000000000000000000000000000000
--- a/chrome/browser/importer/reencode_favicon.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/importer/reencode_favicon.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"
-#include "ui/gfx/favicon_size.h"
-#include "ui/gfx/size.h"
-
-bool ReencodeFavicon(const uint8* src_data,
- size_t src_len,
- std::vector<uint8>* 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;
-}
« no previous file with comments | « chrome/browser/importer/reencode_favicon.h ('k') | chrome/browser/importer/safari_importer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698