summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:27:14 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:27:14 +0000
commitb474c7410486d0ff97734c8ad4f2c740558d28ce (patch)
treea387c6057297780ae5afcaf7a5573ceb5628564d /chrome/browser/extensions
parent02000dbb8511e4e35d7d90ca494062eda8348149 (diff)
downloadchromium_src-b474c7410486d0ff97734c8ad4f2c740558d28ce.zip
chromium_src-b474c7410486d0ff97734c8ad4f2c740558d28ce.tar.gz
chromium_src-b474c7410486d0ff97734c8ad4f2c740558d28ce.tar.bz2
Adds the source ImageLoadingTracker to OnImageLoaded. I need this in a
callback so that I can identify where the image is coming from. BUG=none TEST=none Review URL: http://codereview.chromium.org/1167004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/image_loading_tracker.cc2
-rw-r--r--chrome/browser/extensions/image_loading_tracker.h10
2 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/extensions/image_loading_tracker.cc b/chrome/browser/extensions/image_loading_tracker.cc
index a6eafca..35b736d 100644
--- a/chrome/browser/extensions/image_loading_tracker.cc
+++ b/chrome/browser/extensions/image_loading_tracker.cc
@@ -109,7 +109,7 @@ void ImageLoadingTracker::PostLoadImageTask(const ExtensionResource& resource,
void ImageLoadingTracker::OnImageLoaded(SkBitmap* image, size_t index) {
if (observer_)
- observer_->OnImageLoaded(image, index);
+ observer_->OnImageLoaded(this, image, index);
if (image)
delete image;
diff --git a/chrome/browser/extensions/image_loading_tracker.h b/chrome/browser/extensions/image_loading_tracker.h
index 23f7b71..c908bab 100644
--- a/chrome/browser/extensions/image_loading_tracker.h
+++ b/chrome/browser/extensions/image_loading_tracker.h
@@ -21,18 +21,22 @@ class Size;
// Consider abstracting out a FilePathProvider (ExtensionResource) and moving
// back to chrome/browser/ if other subsystems want to use it.
class ImageLoadingTracker
- : public base::RefCountedThreadSafe<ImageLoadingTracker> {
+ : public base::RefCountedThreadSafe<ImageLoadingTracker> {
public:
class Observer {
public:
// 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.
- virtual void OnImageLoaded(SkBitmap* image, size_t index) = 0;
+ virtual void OnImageLoaded(ImageLoadingTracker* source,
+ SkBitmap* image,
+ size_t index) = 0;
};
ImageLoadingTracker(Observer* observer, size_t image_count)
- : observer_(observer), image_count_(image_count), posted_count_(0) {
+ : observer_(observer),
+ image_count_(image_count),
+ posted_count_(0) {
AddRef(); // We hold on to a reference to ourself to make sure we don't
// get deleted until we get a response from image loading (see
// ImageLoadingDone).