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

Side by Side Diff: chrome/browser/extensions/image_loading_tracker.cc

Issue 1167004: Adds the source ImageLoadingTracker to OnImageLoaded. I need this in a (Closed)
Patch Set: Created 10 years, 9 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/image_loading_tracker.h ('k') | chrome/browser/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698