summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 10:38:35 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 10:38:35 +0000
commit2178814c0d188e0f67cbe4de708b5e8ac7283175 (patch)
tree42bb3635e2ee1eca6fef4055cb3c50fe66a2ee49 /chrome/browser/ui/views
parentd5004f4d1560b5ba423350ab311fe2060093c9bb (diff)
downloadchromium_src-2178814c0d188e0f67cbe4de708b5e8ac7283175.zip
chromium_src-2178814c0d188e0f67cbe4de708b5e8ac7283175.tar.gz
chromium_src-2178814c0d188e0f67cbe4de708b5e8ac7283175.tar.bz2
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
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc27
-rw-r--r--chrome/browser/ui/views/toolbar_view.h4
2 files changed, 6 insertions, 25 deletions
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)
diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h
index 53616fc..a5a6c8e 100644
--- a/chrome/browser/ui/views/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar_view.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_VIEW_H_
#pragma once
+#include <set>
#include <vector>
#include "base/memory/ref_counted.h"
@@ -144,9 +145,6 @@ class ToolbarView : public AccessiblePaneView,
// Returns true if we should show the upgrade recommended dot.
bool IsUpgradeRecommended();
- // Retrieve which badge we should show when recommending an upgrade.
- int GetUpgradeRecommendedBadge() const;
-
// Returns true if we should show the background page badge.
bool ShouldShowBackgroundPageBadge();