diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-23 17:41:48 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-23 17:41:48 +0000 |
commit | 3250a9685849b81e915c74474ac0fbb7fca4d16a (patch) | |
tree | 10a98ceb4c5044af3da5d48304a91a12f4bb45f4 /chrome/browser | |
parent | 9f221e935d57a911844598748f9fde346a96e464 (diff) | |
download | chromium_src-3250a9685849b81e915c74474ac0fbb7fca4d16a.zip chromium_src-3250a9685849b81e915c74474ac0fbb7fca4d16a.tar.gz chromium_src-3250a9685849b81e915c74474ac0fbb7fca4d16a.tar.bz2 |
Revert 42283 - Adds the source ImageLoadingTracker to OnImageLoaded. I need this in a
callback so that I can identify where the image is coming from.
[Reverter's note: There is nothing wrong with this CL per se, except that I'm going to
make it obsolete in my next checkin, so since noone is relying on this change yet, it
is better to revert it than to have a painful merge]
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1167004
TBR=sky@chromium.org
Review URL: http://codereview.chromium.org/1077011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/extensions/browser_action_button.mm | 3 | ||||
-rw-r--r-- | chrome/browser/cocoa/location_bar_view_mac.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/location_bar_view_mac.mm | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/image_loading_tracker.cc | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/image_loading_tracker.h | 10 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_actions_toolbar_gtk.cc | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/location_bar_view_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/location_bar_view_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/browser_actions_container.cc | 3 | ||||
-rw-r--r-- | chrome/browser/views/browser_actions_container.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.h | 3 |
12 files changed, 17 insertions, 29 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_action_button.mm b/chrome/browser/cocoa/extensions/browser_action_button.mm index 0a2579b..dabba77 100644 --- a/chrome/browser/cocoa/extensions/browser_action_button.mm +++ b/chrome/browser/cocoa/extensions/browser_action_button.mm @@ -62,8 +62,7 @@ class ExtensionImageTrackerBridge : public NotificationObserver, } // ImageLoadingTracker::Observer implementation. - void OnImageLoaded(ImageLoadingTracker* source, SkBitmap* image, - size_t index) { + void OnImageLoaded(SkBitmap* image, size_t index) { if (image) [owner_ setDefaultIcon:gfx::SkBitmapToNSImage(*image)]; tracker_ = NULL; diff --git a/chrome/browser/cocoa/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar_view_mac.h index ad9ca8e..393acf3 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.h +++ b/chrome/browser/cocoa/location_bar_view_mac.h @@ -241,9 +241,7 @@ class LocationBarViewMac : public AutocompleteEditController, virtual void OnMousePressed(NSRect bounds); // Overridden from ImageLoadingTracker. - virtual void OnImageLoaded(ImageLoadingTracker* source, - SkBitmap* image, - size_t index); + virtual void OnImageLoaded(SkBitmap* image, size_t index); // Called to notify the Page Action that it should determine whether to be // visible or hidden. |contents| is the TabContents that is active, |url| diff --git a/chrome/browser/cocoa/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar_view_mac.mm index 8604b0b..affcdfab 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.mm +++ b/chrome/browser/cocoa/location_bar_view_mac.mm @@ -689,8 +689,8 @@ void LocationBarViewMac::PageActionImageView::OnMousePressed(NSRect bounds) { } } -void LocationBarViewMac::PageActionImageView::OnImageLoaded( - ImageLoadingTracker* source, SkBitmap* image, size_t index) { +void LocationBarViewMac::PageActionImageView::OnImageLoaded(SkBitmap* image, + size_t index) { // We loaded icons()->size() icons, plus one extra if the Page Action had // a default icon. int total_icons = page_action_->icon_paths()->size(); diff --git a/chrome/browser/extensions/image_loading_tracker.cc b/chrome/browser/extensions/image_loading_tracker.cc index 35b736d..a6eafca 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(this, image, index); + observer_->OnImageLoaded(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 c908bab..23f7b71 100644 --- a/chrome/browser/extensions/image_loading_tracker.h +++ b/chrome/browser/extensions/image_loading_tracker.h @@ -21,22 +21,18 @@ 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(ImageLoadingTracker* source, - SkBitmap* image, - size_t index) = 0; + virtual void OnImageLoaded(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). diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc index c652d0b..31d3c24 100644 --- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc @@ -132,8 +132,7 @@ class BrowserActionButton : public NotificationObserver, } // ImageLoadingTracker::Observer implementation. - void OnImageLoaded(ImageLoadingTracker* source, SkBitmap* image, - size_t index) { + void OnImageLoaded(SkBitmap* image, size_t index) { if (image) { default_skbitmap_ = *image; default_icon_ = gfx::GdkPixbufFromSkBitmap(image); diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index 5bc1d5e..34346bb 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -1178,8 +1178,8 @@ void LocationBarViewGtk::PageActionViewGtk::UpdateVisibility( } } -void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded( - ImageLoadingTracker* source, SkBitmap* image, size_t index) { +void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded(SkBitmap* image, + size_t index) { // We loaded icons()->size() icons, plus one extra if the page action had // a default icon. size_t total_icons = page_action_->icon_paths()->size(); diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h index 6c92981..2037a2e 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.h +++ b/chrome/browser/gtk/location_bar_view_gtk.h @@ -193,8 +193,7 @@ class LocationBarViewGtk : public AutocompleteEditController, void UpdateVisibility(TabContents* contents, GURL url); // A callback from ImageLoadingTracker for when the image has loaded. - virtual void OnImageLoaded(ImageLoadingTracker* source, SkBitmap* image, - size_t index); + virtual void OnImageLoaded(SkBitmap* image, size_t index); // Simulate left mouse click on the page action button. void TestActivatePageAction(); diff --git a/chrome/browser/views/browser_actions_container.cc b/chrome/browser/views/browser_actions_container.cc index 5fa57ab..0f3eff7 100644 --- a/chrome/browser/views/browser_actions_container.cc +++ b/chrome/browser/views/browser_actions_container.cc @@ -142,8 +142,7 @@ void BrowserActionButton::ButtonPressed(views::Button* sender, panel_->OnBrowserActionExecuted(this, false); // inspect_with_devtools } -void BrowserActionButton::OnImageLoaded(ImageLoadingTracker* source, - SkBitmap* image, size_t index) { +void BrowserActionButton::OnImageLoaded(SkBitmap* image, size_t index) { if (image) default_icon_ = *image; diff --git a/chrome/browser/views/browser_actions_container.h b/chrome/browser/views/browser_actions_container.h index 6b4f123..09e1ee2 100644 --- a/chrome/browser/views/browser_actions_container.h +++ b/chrome/browser/views/browser_actions_container.h @@ -69,8 +69,7 @@ class BrowserActionButton : public views::MenuButton, virtual void ButtonPressed(views::Button* sender, const views::Event& event); // Overridden from ImageLoadingTracker. - virtual void OnImageLoaded(ImageLoadingTracker* source, SkBitmap* image, - size_t index); + virtual void OnImageLoaded(SkBitmap* image, size_t index); // Overridden from NotificationObserver: virtual void Observe(NotificationType type, diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index fec0d7f..a7b996a 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -1561,8 +1561,8 @@ void LocationBarView::PageActionImageView::ShowInfoBubble() { ShowInfoBubbleImpl(ASCIIToWide(tooltip_), GetColor(false, TEXT)); } -void LocationBarView::PageActionImageView::OnImageLoaded( - ImageLoadingTracker* source, SkBitmap* image, size_t index) { +void LocationBarView::PageActionImageView::OnImageLoaded(SkBitmap* image, + size_t index) { // We loaded icons()->size() icons, plus one extra if the page action had // a default icon. size_t total_icons = page_action_->icon_paths()->size(); diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index b856845..ce41ec7 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -439,8 +439,7 @@ class LocationBarView : public LocationBar, virtual void ShowInfoBubble(); // Overridden from ImageLoadingTracker. - virtual void OnImageLoaded(ImageLoadingTracker* source, SkBitmap* image, - size_t index); + virtual void OnImageLoaded(SkBitmap* image, size_t index); // Overridden from ExtensionContextMenuModelModel::Delegate virtual void InspectPopup(ExtensionAction* action); |