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

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

Issue 10912088: favicon handler: Consider all frames when receiving favicons from the history db (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years, 3 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/favicon/favicon_handler.cc ('k') | chrome/browser/favicon/favicon_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_service.cc
diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc
index ec34ed10c7f7294048dfbf4d5237783c30a80f5b..ad4a79dfbd1672fc657b7b593a2010a763161e06 100644
--- a/chrome/browser/favicon/favicon_service.cc
+++ b/chrome/browser/favicon/favicon_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/favicon/favicon_service.h"
+#include "chrome/browser/favicon/favicon_util.h"
#include "chrome/browser/favicon/select_favicon_frames.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_backend.h"
@@ -229,24 +230,13 @@ void FaviconService::GetFaviconImageCallback(
Handle handle,
std::vector<history::FaviconBitmapResult> favicon_bitmap_results,
history::IconURLSizesMap icon_url_sizes_map) {
- std::vector<SkBitmap> sk_bitmaps;
- for (size_t i = 0; i < favicon_bitmap_results.size(); ++i) {
- if (favicon_bitmap_results[i].is_valid()) {
- scoped_refptr<base::RefCountedMemory> bitmap_data =
- favicon_bitmap_results[i].bitmap_data;
- SkBitmap out_bitmap;
- if (gfx::PNGCodec::Decode(bitmap_data->front(), bitmap_data->size(),
- &out_bitmap)) {
- sk_bitmaps.push_back(out_bitmap);
- }
- }
- }
history::FaviconImageResult image_result;
- image_result.image = gfx::Image(SelectFaviconFrames(
- sk_bitmaps, ui::GetSupportedScaleFactors(), desired_size_in_dip, NULL));
- image_result.icon_url = favicon_bitmap_results.empty() ?
+ image_result.image = FaviconUtil::SelectFaviconFramesFromPNGs(
+ favicon_bitmap_results,
+ ui::GetSupportedScaleFactors(),
+ desired_size_in_dip);
+ image_result.icon_url = image_result.image.IsEmpty() ?
GURL() : favicon_bitmap_results[0].icon_url;
-
callback.Run(handle, image_result);
}
« no previous file with comments | « chrome/browser/favicon/favicon_handler.cc ('k') | chrome/browser/favicon/favicon_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698