| Index: chrome/browser/ui/views/location_bar/page_action_image_view.h
|
| diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.h b/chrome/browser/ui/views/location_bar/page_action_image_view.h
|
| index 8e1118d866b3f26a70a195980682878e510ed167..bc382f878aa0b51fc5b1cd658085f3727332881e 100644
|
| --- a/chrome/browser/ui/views/location_bar/page_action_image_view.h
|
| +++ b/chrome/browser/ui/views/location_bar/page_action_image_view.h
|
| @@ -9,7 +9,7 @@
|
| #include <string>
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "chrome/browser/extensions/image_loading_tracker.h"
|
| +#include "chrome/browser/extensions/extension_action_icon_factory.h"
|
| #include "chrome/browser/ui/views/extensions/extension_popup.h"
|
| #include "chrome/common/extensions/extension_action.h"
|
| #include "ui/views/context_menu_controller.h"
|
| @@ -29,10 +29,10 @@ class MenuRunner;
|
| // PageActionImageView is used by the LocationBarView to display the icon for a
|
| // given PageAction and notify the extension when the icon is clicked.
|
| class PageActionImageView : public views::ImageView,
|
| - public ImageLoadingTracker::Observer,
|
| public views::WidgetObserver,
|
| public views::ContextMenuController,
|
| public content::NotificationObserver,
|
| + public ExtensionActionIconFactory::Observer,
|
| public ExtensionAction::IconAnimation::Observer {
|
| public:
|
| PageActionImageView(LocationBarView* owner,
|
| @@ -54,11 +54,6 @@ class PageActionImageView : public views::ImageView,
|
| virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
|
| virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
|
|
|
| - // Overridden from ImageLoadingTracker:
|
| - virtual void OnImageLoaded(const gfx::Image& image,
|
| - const std::string& extension_id,
|
| - int index) OVERRIDE;
|
| -
|
| // Overridden from views::WidgetObserver:
|
| virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
|
|
|
| @@ -71,6 +66,9 @@ class PageActionImageView : public views::ImageView,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) OVERRIDE;
|
|
|
| + // Overriden from ExtensionActionIconFactory::Observer.
|
| + virtual void OnIconUpdated() OVERRIDE;
|
| +
|
| // Overridden from ui::AcceleratorTarget:
|
| virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
|
| virtual bool CanHandleAccelerators() const OVERRIDE;
|
| @@ -104,9 +102,10 @@ class PageActionImageView : public views::ImageView,
|
| // The corresponding browser.
|
| Browser* browser_;
|
|
|
| - // The object that is waiting for the image loading to complete
|
| - // asynchronously.
|
| - ImageLoadingTracker tracker_;
|
| + // The object that page action will use to create icon for us.
|
| + // It may load icon asynchronously (in which case initial icon returned by
|
| + // the action will be blank), so we have to observe it for icon's updates.
|
| + scoped_ptr<ExtensionActionIconFactory> icon_factory_;
|
|
|
| // The tab id we are currently showing the icon for.
|
| int current_tab_id_;
|
|
|