From 2178814c0d188e0f67cbe4de708b5e8ac7283175 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Tue, 3 May 2011 10:38:35 +0000 Subject: Make sure right badge shows up on the Wrench menu for Linux and Mac. Also make sure the icon shows up on Linux and Mac (we were accidentally returning false from GetIconForCommandId, which works on Windows because we were not checking the return value). BUG=80647 TEST=Same as in http://codereview.chromium.org/6840038/, but for Linux and Mac. Review URL: http://codereview.chromium.org/6904129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83879 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/views/toolbar_view.cc | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'chrome/browser/ui/views/toolbar_view.cc') diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index 20c4715..58d35f5 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -111,10 +111,8 @@ ToolbarView::ToolbarView(Browser* browser) IDR_LOCATIONBG_POPUPMODE_EDGE); } - if (!IsUpgradeRecommended()) { - registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED, - NotificationService::AllSources()); - } + registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED, + NotificationService::AllSources()); registrar_.Add(this, NotificationType::MODULE_INCOMPATIBILITY_BADGE_CHANGE, NotificationService::AllSources()); } @@ -619,23 +617,6 @@ bool ToolbarView::IsUpgradeRecommended() { #endif } -int ToolbarView::GetUpgradeRecommendedBadge() const { -#if defined(OS_CHROMEOS) - return IDR_UPDATE_BADGE; -#else - switch (UpgradeDetector::GetInstance()->upgrade_notification_stage()) { - case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE: - return IDR_UPDATE_BADGE4; - case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH: - return IDR_UPDATE_BADGE3; - case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED: - return IDR_UPDATE_BADGE2; - default: - return IDR_UPDATE_BADGE; - } -#endif -} - bool ToolbarView::ShouldShowIncompatibilityWarning() { #if defined(OS_WIN) EnumerateModulesModel* loaded_modules = EnumerateModulesModel::GetInstance(); @@ -752,7 +733,9 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) { // Only one badge can be active at any given time. The Upgrade notification // is deemed most important, then the DLL conflict badge. if (IsUpgradeRecommended()) { - badge = *tp->GetBitmapNamed(GetUpgradeRecommendedBadge()); + badge = *tp->GetBitmapNamed( + UpgradeDetector::GetInstance()->GetIconResourceID( + UpgradeDetector::UPGRADE_ICON_TYPE_BADGE)); } else if (ShouldShowIncompatibilityWarning()) { #if defined(OS_WIN) if (!was_showing) -- cgit v1.1