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

Unified Diff: chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc

Issue 10870022: Change FaviconData to be able to return data for multiple bitmaps for same icon URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/ui/webui/ntp/android/bookmarks_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc b/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc
index 21199c05165c7ba3bcf495708cf7701e241681a0..05d8d35298bb7a479b8840bc52980b36dac5546b 100644
--- a/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc
+++ b/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc
@@ -21,6 +21,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/color_analysis.h"
+#include "ui/gfx/favicon_size.h"
using base::Int64ToString;
using content::BrowserThread;
@@ -353,10 +354,12 @@ void BookmarksHandler::HandleCreateHomeScreenBookmarkShortcut(
FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
profile, Profile::EXPLICIT_ACCESS);
- FaviconService::Handle handle = favicon_service->GetFaviconForURL(
+ FaviconService::Handle handle = favicon_service->GetRawFaviconForURL(
profile,
node->url(),
history::FAVICON | history::TOUCH_ICON,
+ gfx::kFaviconSize,
+ ui::SCALE_FACTOR_100P,
&cancelable_consumer_,
base::Bind(&BookmarksHandler::OnShortcutFaviconDataAvailable,
base::Unretained(this)));
@@ -366,13 +369,13 @@ void BookmarksHandler::HandleCreateHomeScreenBookmarkShortcut(
void BookmarksHandler::OnShortcutFaviconDataAvailable(
FaviconService::Handle handle,
- history::FaviconData favicon) {
+ const history::FaviconBitmapResult& bitmap_result) {
SkColor color = SK_ColorWHITE;
SkBitmap favicon_bitmap;
- if (favicon.is_valid()) {
- color = GetDominantColorForFavicon(favicon.image_data);
- gfx::PNGCodec::Decode(favicon.image_data->front(),
- favicon.image_data->size(),
+ if (bitmap_result.is_valid()) {
+ color = GetDominantColorForFavicon(bitmap_result.bitmap_data);
+ gfx::PNGCodec::Decode(bitmap_result.bitmap_data->front(),
+ bitmap_result.bitmap_data->size(),
&favicon_bitmap);
}

Powered by Google App Engine
This is Rietveld 408576698