Chromium Code Reviews| 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..2a7070afad7e8c845e4939e1dbea7f83c53bfa1c 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; |
| + } |
| + |
| 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 icon with the badge. |
|
Finnur
2014/02/12 11:19:52
nit: s/icon with the badge/the icon of this button
|
| + gfx::ImageSkia BrowserActionButton::GetIconWithBadge(); |
|
Finnur
2014/02/12 11:19:52
Copy-paste error:
Remove "BrowserActionButton::"
|
| + |
| // 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); |