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

Unified Diff: chrome/browser/ui/webui/ntp/favicon_webui_handler.cc

Issue 10802066: Adds support for saving favicon size into history database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested by Sky and stevenjb 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 1002ddd2eca6082c4a130f393d9ce3704f11674f..acef5a5d967a5b0280e5f4a20ed8a3aef1441e77 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
@@ -119,16 +119,18 @@ void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) {
void FaviconWebUIHandler::OnFaviconDataAvailable(
FaviconService::Handle request_handle,
- history::FaviconData favicon) {
+ history::FaviconData favicon_data) {
FaviconService* favicon_service =
Profile::FromWebUI(web_ui())->GetFaviconService(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));
- else
+ if (favicon_data.is_valid()) {
+ history::FaviconDataElement element = favicon_data.elements[0];
+ color_value.reset(GetDominantColorCssString(element.bitmap_data));
+ } else {
color_value.reset(new StringValue("#919191"));
+ }
StringValue dom_id(dom_id_map_[id]);
web_ui()->CallJavascriptFunction("ntp.setStripeColor", dom_id, *color_value);

Powered by Google App Engine
This is Rietveld 408576698