summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/toolbar_view.cc
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 22:20:25 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 22:20:25 +0000
commite0ddd75a4e0c8b13e9d1b0b231399e2eed3420fd (patch)
tree119be1305c71b8f276c3078b166f541730d8660c /chrome/browser/ui/views/toolbar_view.cc
parent8ebabc4e5f83fe66ff719f732b99971eef067e99 (diff)
downloadchromium_src-e0ddd75a4e0c8b13e9d1b0b231399e2eed3420fd.zip
chromium_src-e0ddd75a4e0c8b13e9d1b0b231399e2eed3420fd.tar.gz
chromium_src-e0ddd75a4e0c8b13e9d1b0b231399e2eed3420fd.tar.bz2
Add a global error messages UI
This is change adds a new UI to show global error messages. Currenlty this only supports adding a wrench menu badge and wrench menu item. I'll add a buble view in later patches. See the bug for more info. BUG=95146 TEST= Review URL: http://codereview.chromium.org/7792088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/toolbar_view.cc')
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index c072ebe..2d62750 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -17,6 +17,8 @@
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/browser/ui/views/wrench_menu.h"
#include "chrome/browser/upgrade_detector.h"
+#include "chrome/browser/ui/global_error_service.h"
+#include "chrome/browser/ui/global_error_service_factory.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/accessibility/browser_accessibility_state.h"
@@ -266,7 +268,11 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
incompatibility_badge_showing = false;
#endif
- bool add_badge = IsUpgradeRecommended() || ShouldShowIncompatibilityWarning();
+ int error_badge_id = GlobalErrorServiceFactory::GetForProfile(
+ browser_->profile())->GetFirstBadgeResourceID();
+
+ bool add_badge = IsUpgradeRecommended() ||
+ ShouldShowIncompatibilityWarning() || error_badge_id;
if (!add_badge)
return icon;
@@ -291,6 +297,8 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
#else
NOTREACHED();
#endif
+ } else if (error_badge_id) {
+ badge = *tp->GetBitmapNamed(error_badge_id);
} else {
NOTREACHED();
}