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

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

Issue 10868003: chromeos: Fix pixelated icons in app list and launcher (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on tony's cl, get rid of icon cache and worker thread Created 8 years, 3 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/app_list/extension_app_item.cc
diff --git a/chrome/browser/ui/app_list/extension_app_item.cc b/chrome/browser/ui/app_list/extension_app_item.cc
index 079973fbc16c9a5238e54a0390110ce175e76c9f..db24fc3c1bcc12829c43648650c663459982b081 100644
--- a/chrome/browser/ui/app_list/extension_app_item.cc
+++ b/chrome/browser/ui/app_list/extension_app_item.cc
@@ -139,14 +139,13 @@ const Extension* ExtensionAppItem::GetExtension() const {
}
void ExtensionAppItem::LoadImage(const Extension* extension) {
- tracker_.reset(new ImageLoadingTracker(this));
- tracker_->LoadImage(extension,
- extension->GetIconResource(
- extension_misc::EXTENSION_ICON_LARGE,
- ExtensionIconSet::MATCH_BIGGER),
- gfx::Size(extension_misc::EXTENSION_ICON_LARGE,
- extension_misc::EXTENSION_ICON_LARGE),
- ImageLoadingTracker::DONT_CACHE);
+ icon_.reset(new extensions::IconImage(
+ extension,
+ extension->icons(),
+ extension_misc::EXTENSION_ICON_MEDIUM,
pkotwicz 2012/09/07 19:24:49 Just to confirm, you are changing the size of the
xiyuan 2012/09/07 20:05:59 This is actually the right size to use. We show 48
+ Extension::GetDefaultIcon(true),
+ this));
+ OnExtensionIconImageChanged(icon_.get());
tbarzic 2012/09/07 17:14:07 optional: I think SetIcon(icon_->image_skia()) wou
xiyuan 2012/09/07 20:05:59 Done.
}
void ExtensionAppItem::ShowExtensionOptions() {
@@ -178,18 +177,10 @@ void ExtensionAppItem::StartExtensionUninstall() {
uninstaller->Run();
}
-void ExtensionAppItem::OnImageLoaded(const gfx::Image& image,
- const std::string& extension_id,
- int tracker_index) {
- if (!image.IsEmpty()) {
- gfx::ImageSkia image_skia = *image.ToImageSkia();
- image_skia.MakeThreadSafe();
- SetIcon(image_skia);
- } else {
- gfx::ImageSkia image_skia(Extension::GetDefaultIcon(true /* is_app */));
- image_skia.MakeThreadSafe();
- SetIcon(image_skia);
- }
+void ExtensionAppItem::OnExtensionIconImageChanged(
+ extensions::IconImage* image) {
+ DCHECK(icon_.get() == image);
+ SetIcon(icon_->image_skia());
}
bool ExtensionAppItem::IsItemForCommandIdDynamic(int command_id) const {

Powered by Google App Engine
This is Rietveld 408576698