OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/image_loading_tracker.h" | 5 #include "chrome/browser/extensions/image_loading_tracker.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 void ImageLoadingTracker::PostLoadImageTask(const ExtensionResource& resource, | 103 void ImageLoadingTracker::PostLoadImageTask(const ExtensionResource& resource, |
104 const gfx::Size& max_size) { | 104 const gfx::Size& max_size) { |
105 ChromeThread::PostTask( | 105 ChromeThread::PostTask( |
106 ChromeThread::FILE, FROM_HERE, | 106 ChromeThread::FILE, FROM_HERE, |
107 new LoadImageTask(this, resource, max_size, posted_count_++)); | 107 new LoadImageTask(this, resource, max_size, posted_count_++)); |
108 } | 108 } |
109 | 109 |
110 void ImageLoadingTracker::OnImageLoaded(SkBitmap* image, size_t index) { | 110 void ImageLoadingTracker::OnImageLoaded(SkBitmap* image, size_t index) { |
111 if (observer_) | 111 if (observer_) |
112 observer_->OnImageLoaded(image, index); | 112 observer_->OnImageLoaded(this, image, index); |
113 | 113 |
114 if (image) | 114 if (image) |
115 delete image; | 115 delete image; |
116 | 116 |
117 if (--image_count_ == 0) | 117 if (--image_count_ == 0) |
118 Release(); // We are no longer needed. | 118 Release(); // We are no longer needed. |
119 } | 119 } |
OLD | NEW |