| Index: chrome/browser/cocoa/location_bar_view_mac.mm
|
| ===================================================================
|
| --- chrome/browser/cocoa/location_bar_view_mac.mm (revision 42362)
|
| +++ chrome/browser/cocoa/location_bar_view_mac.mm (working copy)
|
| @@ -630,12 +630,11 @@
|
| if (!page_action_->default_icon_path().empty())
|
| icon_paths.push_back(page_action_->default_icon_path());
|
|
|
| - tracker_ = new ImageLoadingTracker(this, icon_paths.size());
|
| for (std::vector<std::string>::iterator iter = icon_paths.begin();
|
| iter != icon_paths.end(); ++iter) {
|
| - tracker_->PostLoadImageTask(extension->GetResource(*iter),
|
| - gfx::Size(Extension::kPageActionIconMaxSize,
|
| - Extension::kPageActionIconMaxSize));
|
| + tracker_.PostLoadImageTask(extension->GetResource(*iter),
|
| + gfx::Size(Extension::kPageActionIconMaxSize,
|
| + Extension::kPageActionIconMaxSize));
|
| }
|
|
|
| registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE,
|
| @@ -643,8 +642,6 @@
|
| }
|
|
|
| LocationBarViewMac::PageActionImageView::~PageActionImageView() {
|
| - if (tracker_)
|
| - tracker_->StopTrackingImageLoad();
|
| }
|
|
|
| NSSize LocationBarViewMac::PageActionImageView::GetPreferredImageSize() {
|
| @@ -689,28 +686,24 @@
|
| }
|
| }
|
|
|
| -void LocationBarViewMac::PageActionImageView::OnImageLoaded(SkBitmap* image,
|
| - size_t index) {
|
| +void LocationBarViewMac::PageActionImageView::OnImageLoaded(
|
| + SkBitmap* image, int 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();
|
| + int total_icons = static_cast<int>(page_action_->icon_paths()->size());
|
| if (!page_action_->default_icon_path().empty())
|
| total_icons++;
|
| - DCHECK(static_cast<int>(index) < total_icons);
|
| + DCHECK(index < total_icons);
|
|
|
| // Map the index of the loaded image back to its name. If we ever get an
|
| // index greater than the number of icons, it must be the default icon.
|
| if (image) {
|
| - if (index < page_action_->icon_paths()->size())
|
| + if (index < total_icons)
|
| page_action_icons_[page_action_->icon_paths()->at(index)] = *image;
|
| else
|
| page_action_icons_[page_action_->default_icon_path()] = *image;
|
| }
|
|
|
| - // If we are done, release the tracker.
|
| - if (static_cast<int>(index) == (total_icons - 1))
|
| - tracker_ = NULL;
|
| -
|
| owner_->UpdatePageActions();
|
|
|
| if (preview_enabled_)
|
|
|