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

Unified Diff: chrome/browser/favicon/favicon_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/extensions/extension_web_ui.cc ('k') | chrome/browser/favicon/favicon_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_handler.cc
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc
index 80c4883a40fa7f91a58cf4e215da9c9f015678c8..b356664535f20b497c2b92d357b2277658dd73f4 100644
--- a/chrome/browser/favicon/favicon_handler.cc
+++ b/chrome/browser/favicon/favicon_handler.cc
@@ -416,8 +416,8 @@ void FaviconHandler::OnFaviconDataForInitialURL(
// to be expired (or the wrong url) we'll fetch later on. This way the
// user doesn't see a flash of the default favicon.
entry->GetFavicon().url = favicon.icon_url;
- if (favicon.is_valid())
- UpdateFavicon(entry, favicon.bitmap_data);
+ if (favicon.is_valid() && favicon.variants.size() > 0)
+ UpdateFavicon(entry, favicon.variants[0].bitmap_data); // XXX pass all variants
entry->GetFavicon().valid = true;
}
@@ -481,11 +481,11 @@ void FaviconHandler::OnFaviconData(FaviconService::Handle handle,
// No need to update the favicon url. By the time we get here
// UpdateFaviconURL will have set the favicon url.
if (favicon.icon_type == history::FAVICON) {
- if (favicon.is_valid()) {
+ if (favicon.is_valid() && favicon.variants.size() > 0) {
// There is a favicon, set it now. If expired we'll download the current
// one again, but at least the user will get some icon instead of the
// default and most likely the current one is fine anyway.
- UpdateFavicon(entry, favicon.bitmap_data);
+ UpdateFavicon(entry, favicon.variants[0].bitmap_data); // XXX all
}
if (!favicon.known_icon || favicon.expired) {
// We don't know the favicon, or it is out of date. Request the current
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | chrome/browser/favicon/favicon_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698