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

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

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comment 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
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1dedf03c251b9d5366c4883c47b3c310dd8da8e5..079973fbc16c9a5238e54a0390110ce175e76c9f 100644
--- a/chrome/browser/ui/app_list/extension_app_item.cc
+++ b/chrome/browser/ui/app_list/extension_app_item.cc
@@ -181,10 +181,15 @@ void ExtensionAppItem::StartExtensionUninstall() {
void ExtensionAppItem::OnImageLoaded(const gfx::Image& image,
const std::string& extension_id,
int tracker_index) {
- if (!image.IsEmpty())
- SetIcon(*image.ToImageSkia());
- else
- SetIcon(Extension::GetDefaultIcon(true /* is_app */));
+ 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);
+ }
}
bool ExtensionAppItem::IsItemForCommandIdDynamic(int command_id) const {
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698