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

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: 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/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 09151273e20cf3a7b39a952321b17813c3737e1a..8ed1f0eda308dfc21f4af0fdd9052bde16c48951 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -764,16 +764,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()) {
+ 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