summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/image_loading_tracker.h
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 23:20:15 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 23:20:15 +0000
commit06a0c94e817354c8c12afe4748ce68a418b0ed1b (patch)
tree44a301796ccb8a0808eb77b10292de60cf04fcf4 /chrome/browser/extensions/image_loading_tracker.h
parent8ab402196ee4dc510e0162010789d43b96b54243 (diff)
downloadchromium_src-06a0c94e817354c8c12afe4748ce68a418b0ed1b.zip
chromium_src-06a0c94e817354c8c12afe4748ce68a418b0ed1b.tar.gz
chromium_src-06a0c94e817354c8c12afe4748ce68a418b0ed1b.tar.bz2
Show extension icons next to their top-level context menu items.
Also fix a bug in extension icon caching where we weren't keeping track of potential resizing done by ImageLoadingTracker before setting the cached SkBitmap. BUG=39494 TEST=Install an extension that includes an icon and uses the experimental context menu API. You should see the extension's icon in the context menu next to its top-level item. Review URL: http://codereview.chromium.org/2867008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/image_loading_tracker.h')
-rw-r--r--chrome/browser/extensions/image_loading_tracker.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/extensions/image_loading_tracker.h b/chrome/browser/extensions/image_loading_tracker.h
index 653a9a9..e32166a 100644
--- a/chrome/browser/extensions/image_loading_tracker.h
+++ b/chrome/browser/extensions/image_loading_tracker.h
@@ -43,6 +43,8 @@ class ImageLoadingTracker : public NotificationObserver {
class Observer {
public:
+ virtual ~Observer();
+
// Will be called when the image with the given index has loaded.
// The |image| is owned by the tracker, so the observer should make a copy
// if they need to access it after this call. |image| can be null if valid
@@ -72,10 +74,11 @@ class ImageLoadingTracker : public NotificationObserver {
// When an image has finished loaded and been resized on the file thread, it
// is posted back to this method on the original thread. This method then
// calls the observer's OnImageLoaded and deletes the ImageLoadingTracker if
- // it was the last image in the list.
+ // it was the last image in the list. The |original_size| should be the size
+ // of the image before any resizing was done.
// |image| may be null if the file failed to decode.
void OnImageLoaded(SkBitmap* image, const ExtensionResource& resource,
- int id);
+ const gfx::Size& original_size, int id);
// NotificationObserver method. If an extension is uninstalled while we're
// waiting for the image we remove the entry from load_map_.