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

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

Issue 10821035: wip Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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/ui/webui/ntp/app_launcher_handler.cc ('k') | chrome/renderer/chrome_render_view_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8bfa40bca9094b8a8c92b56f9a54243c17d9dcc5..4da3bef02a08f018774fbfa15801df67e8296458 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
@@ -125,10 +125,12 @@ void FaviconWebUIHandler::OnFaviconDataAvailable(
int id = consumer_.GetClientData(favicon_service, request_handle);
scoped_ptr<StringValue> color_value;
- if (favicon.is_valid())
- color_value.reset(GetDominantColorCssString(favicon.bitmap_data));
- else
+ if (favicon.is_valid() && favicon.variants.size() > 0) {
+ color_value.reset(
+ GetDominantColorCssString(favicon.variants[0].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);
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.cc ('k') | chrome/renderer/chrome_render_view_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698