Index: chrome/browser/ui/gtk/browser_toolbar_gtk.cc |
diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc |
index 09e62850b732594fd3d716817c9be99a753b785f..6460bec5b735bdb03a3aa31cb029b4ffb4feef79 100644 |
--- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc |
+++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc |
@@ -20,6 +20,9 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/themes/theme_service.h" |
#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/global_error_delegate.h" |
+#include "chrome/browser/ui/global_error_service.h" |
+#include "chrome/browser/ui/global_error_service_factory.h" |
#include "chrome/browser/ui/gtk/accelerators_gtk.h" |
#include "chrome/browser/ui/gtk/back_forward_button_gtk.h" |
#include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
@@ -619,16 +622,29 @@ bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { |
gboolean BrowserToolbarGtk::OnWrenchMenuButtonExpose(GtkWidget* sender, |
GdkEventExpose* expose) { |
- const SkBitmap* badge = NULL; |
+ int resource_id = 0; |
if (UpgradeDetector::GetInstance()->notify_upgrade()) { |
- badge = theme_service_->GetBitmapNamed( |
- UpgradeDetector::GetInstance()->GetIconResourceID( |
- UpgradeDetector::UPGRADE_ICON_TYPE_BADGE)); |
+ resource_id = UpgradeDetector::GetInstance()->GetIconResourceID( |
+ UpgradeDetector::UPGRADE_ICON_TYPE_BADGE); |
} else { |
- return FALSE; |
+ const std::vector<GlobalErrorDelegate*>& errors = |
+ GlobalErrorServiceFactory::GetForProfile( |
+ browser_->profile())->GetErrorDelegates(); |
+ for (std::vector<GlobalErrorDelegate*>::const_iterator |
+ it = errors.begin(); it != errors.end(); ++it) { |
+ GlobalErrorDelegate* error = *it; |
+ if (error->HasBadge()) { |
+ resource_id = error->GetBadgeResourceID(); |
+ break; |
+ } |
+ } |
} |
+ if (!resource_id) |
+ return FALSE; |
+ |
// Draw the chrome app menu icon onto the canvas. |
+ const SkBitmap* badge = theme_service_->GetBitmapNamed(resource_id); |
gfx::CanvasSkiaPaint canvas(expose, false); |
int x_offset = base::i18n::IsRTL() ? 0 : |
sender->allocation.width - badge->width(); |