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

Unified Diff: chrome/browser/ui/app_list/extension_app_model_builder.cc

Issue 400893002: Resize webstore icons to a known size before placing them in the app list model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix include Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/extension_app_model_builder.cc
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder.cc b/chrome/browser/ui/app_list/extension_app_model_builder.cc
index 9c27a75ebe4e3cf7b4994fe6fdaf392cdc2421c9..1a79a27077c091852e27e32ac368991851f6914a 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder.cc
@@ -24,9 +24,11 @@
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/pref_names.h"
+#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/image/image_skia_operations.h"
using extensions::Extension;
@@ -104,9 +106,18 @@ void ExtensionAppModelBuilder::OnBeginExtensionInstall(
existing_item->SetIsInstalling(true);
return;
}
+
+ // Icons from the webstore can be unusual sizes. Once installed,
+ // ExtensionAppItem uses extension_misc::EXTENSION_ICON_MEDIUM (48) to load
+ // it, so be consistent with that.
+ gfx::Size icon_size(extension_misc::EXTENSION_ICON_MEDIUM,
+ extension_misc::EXTENSION_ICON_MEDIUM);
+ gfx::ImageSkia resized(gfx::ImageSkiaOperations::CreateResizedImage(
+ params.installing_icon, skia::ImageOperations::RESIZE_BEST, icon_size));
+
InsertApp(CreateAppItem(params.extension_id,
params.extension_name,
- params.installing_icon,
+ resized,
params.is_platform_app));
SetHighlightedApp(params.extension_id);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698