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

Unified Diff: chrome/browser/ui/webui/ntp/favicon_webui_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/favicon_webui_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
index 16911422670874d82300bcead495da2c9c55a514..e226c5fd3e49adb5e6c27dd7418481167f9a2ae6 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
@@ -23,6 +23,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/color_analysis.h"
+#include "ui/gfx/favicon_size.h"
namespace {
@@ -109,10 +110,12 @@ void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) {
}
dom_id_map_[id_] = dom_id;
- FaviconService::Handle handle = favicon_service->GetFaviconForURL(
+ FaviconService::Handle handle = favicon_service->GetRawFaviconForURL(
Profile::FromWebUI(web_ui()),
url,
history::FAVICON,
+ gfx::kFaviconSize,
+ ui::SCALE_FACTOR_100P,
&consumer_,
base::Bind(&FaviconWebUIHandler::OnFaviconDataAvailable,
base::Unretained(this)));
@@ -121,14 +124,14 @@ void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) {
void FaviconWebUIHandler::OnFaviconDataAvailable(
FaviconService::Handle request_handle,
- history::FaviconData favicon) {
+ const history::FaviconBitmapResult& bitmap_result) {
FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
Profile::FromWebUI(web_ui()), Profile::EXPLICIT_ACCESS);
int id = consumer_.GetClientData(favicon_service, request_handle);
scoped_ptr<StringValue> color_value;
- if (favicon.is_valid())
- color_value.reset(GetDominantColorCssString(favicon.image_data));
+ if (bitmap_result.is_valid())
+ color_value.reset(GetDominantColorCssString(bitmap_result.bitmap_data));
else
color_value.reset(new StringValue("#919191"));

Powered by Google App Engine
This is Rietveld 408576698