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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_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: 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/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index c90bc0a3d67aa5f31cab2b82fdcc0a58961d41e7..9b11ca98bf5ad849010f8c6949565a423ebea529 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -765,16 +765,22 @@ void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle,
WebApplicationInfo::IconInfo icon;
web_app->icons.push_back(icon);
- if (data.is_valid() && gfx::PNGCodec::Decode(data.image_data->front(),
- data.image_data->size(),
- &(web_app->icons[0].data))) {
- web_app->icons[0].url = GURL();
- web_app->icons[0].width = web_app->icons[0].data.width();
- web_app->icons[0].height = web_app->icons[0].data.height();
- } else {
- web_app->icons.clear();
+ bool bitmap_data_valid = false;
+ if (data.is_valid()) {
+ const history::FaviconDataElement& element = data.elements[0];
+ if (gfx::PNGCodec::Decode(element.bitmap_data->front(),
+ element.bitmap_data->size(),
+ &(web_app->icons[0].data))) {
+ bitmap_data_valid = true;
+ web_app->icons[0].url = GURL();
+ web_app->icons[0].width = web_app->icons[0].data.width();
+ web_app->icons[0].height = web_app->icons[0].data.height();
+ }
}
+ if (!bitmap_data_valid)
+ web_app->icons.clear();
+
scoped_refptr<CrxInstaller> installer(
CrxInstaller::Create(extension_service_, NULL));
installer->set_page_ordinal(install_info->page_ordinal);

Powered by Google App Engine
This is Rietveld 408576698