Index: chrome/browser/ui/views/toolbar/browser_action_view.h |
diff --git a/chrome/browser/ui/views/toolbar/browser_action_view.h b/chrome/browser/ui/views/toolbar/browser_action_view.h |
index 7d8991964e172bb160ed14f9246e6dfbba420f01..118485cf915914c55b3430eaf50f70ad2cd7116e 100644 |
--- a/chrome/browser/ui/views/toolbar/browser_action_view.h |
+++ b/chrome/browser/ui/views/toolbar/browser_action_view.h |
@@ -111,6 +111,18 @@ class BrowserActionButton : public views::MenuButton, |
public content::NotificationObserver, |
public ExtensionActionIconFactory::Observer { |
public: |
+ // The IconObserver will receive a notification when the button's icon has |
+ // been updated. |
+ class IconObserver { |
+ public: |
+ virtual ~IconObserver() {} |
+ virtual void OnIconUpdated(const gfx::ImageSkia& icon) = 0; |
+ }; |
+ |
+ void set_icon_observer(IconObserver* icon_observer) { |
+ icon_observer_ = icon_observer; |
+ } |
Finnur
2014/02/19 11:46:31
nit: constructor should appear ahead of this funct
|
+ |
BrowserActionButton(const extensions::Extension* extension, |
Browser* browser_, |
BrowserActionView::Delegate* delegate); |
@@ -177,6 +189,9 @@ class BrowserActionButton : public views::MenuButton, |
// Returns icon factory for the button. |
ExtensionActionIconFactory& icon_factory() { return icon_factory_; } |
+ // Gets the icon of this button and its badge. |
+ gfx::ImageSkia GetIconWithBadge(); |
+ |
// Returns button icon so it can be accessed during tests. |
gfx::ImageSkia GetIconForTest(); |
@@ -230,6 +245,10 @@ class BrowserActionButton : public views::MenuButton, |
// Responsible for running the menu. |
scoped_ptr<views::MenuRunner> menu_runner_; |
+ // The observer that we need to notify when the icon of the button has been |
+ // updated. |
+ IconObserver* icon_observer_; |
+ |
friend class base::DeleteHelper<BrowserActionButton>; |
DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); |