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

Unified Diff: extensions/browser/extension_icon_image.cc

Issue 882243002: [Extensions] Make extension actions use gfx::Image over gfx::ImageSkia. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 11 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 | « extensions/browser/extension_icon_image.h ('k') | extensions/browser/extension_icon_image_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_icon_image.cc
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc
index 5f237fff5cd9d4c8c0c929511c2472f20e786e58..5ebc40017920f6190631bb21baf4fb5030308d28 100644
--- a/extensions/browser/extension_icon_image.cc
+++ b/extensions/browser/extension_icon_image.cc
@@ -145,6 +145,7 @@ IconImage::IconImage(
gfx::Size resource_size(resource_size_in_dip, resource_size_in_dip);
source_ = new Source(this, resource_size);
image_skia_ = gfx::ImageSkia(source_, resource_size);
+ image_ = gfx::Image(image_skia_);
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_REMOVED,
@@ -226,6 +227,12 @@ void IconImage::OnImageLoaded(float scale, const gfx::Image& image_in) {
image_skia_.RemoveRepresentation(scale);
image_skia_.AddRepresentation(rep);
+ // Update the image to use the updated image skia.
+ // It's a shame we have to do this because it means that all the other
+ // representations stored on |image_| will be deleted, but unfortunately
+ // there's no way to combine the storage of two images.
+ image_ = gfx::Image(image_skia_);
+
FOR_EACH_OBSERVER(Observer, observers_, OnExtensionIconImageChanged(this));
}
« no previous file with comments | « extensions/browser/extension_icon_image.h ('k') | extensions/browser/extension_icon_image_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698