Index: chrome/browser/ui/views/toolbar/browser_action_view.cc |
diff --git a/chrome/browser/ui/views/toolbar/browser_action_view.cc b/chrome/browser/ui/views/toolbar/browser_action_view.cc |
index 780e8c365efc650fa5fb270f81e98e1f88e85532..ddd873449441778107023a219cb08937df954fd5 100644 |
--- a/chrome/browser/ui/views/toolbar/browser_action_view.cc |
+++ b/chrome/browser/ui/views/toolbar/browser_action_view.cc |
@@ -115,6 +115,7 @@ BrowserActionButton::BrowserActionButton(const Extension* extension, |
BrowserActionView::Delegate* delegate) |
: MenuButton(this, base::string16(), NULL, false), |
browser_(browser), |
+ icon_observer_(NULL), |
Finnur
2014/02/10 11:20:57
Move this line down one to avoid compile error see
|
browser_action_( |
extensions::ExtensionActionManager::Get(browser->profile())-> |
GetBrowserAction(*extension)), |
@@ -311,6 +312,15 @@ void BrowserActionButton::Observe(int type, |
void BrowserActionButton::OnIconUpdated() { |
UpdateState(); |
+ if (icon_observer_) { |
+ int tab_id = delegate_->GetCurrentTabId(); |
+ gfx::Size spacing(0, ToolbarView::kVertSpacing); |
+ gfx::ImageSkia icon = *icon_factory_.GetIcon(tab_id).ToImageSkia(); |
+ if (!IsEnabled(tab_id)) |
+ icon = gfx::ImageSkiaOperations::CreateTransparentImage(icon, .25); |
Finnur
2014/02/10 10:41:41
This is copied almost verbatim from GetIconWithBad
|
+ icon_observer_->OnIconUpdated( |
+ browser_action_->GetIconWithBadge(icon, tab_id, spacing)); |
+ } |
} |
bool BrowserActionButton::Activate() { |