Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: chrome/browser/ui/toolbar/wrench_icon_painter.cc

Issue 395193003: Create a cross-platform helper class for badging the wrench menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/toolbar/wrench_icon_painter.cc
===================================================================
--- chrome/browser/ui/toolbar/wrench_icon_painter.cc (revision 283822)
+++ chrome/browser/ui/toolbar/wrench_icon_painter.cc (working copy)
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/toolbar/wrench_icon_painter.h"
+#include <algorithm>
+
#include "grit/theme_resources.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/animation/multi_animation.h"
@@ -30,47 +32,6 @@
} // namespace
-// static
-WrenchIconPainter::Severity WrenchIconPainter::SeverityFromUpgradeLevel(
- UpgradeDetector::UpgradeNotificationAnnoyanceLevel level) {
- switch (level) {
- case UpgradeDetector::UPGRADE_ANNOYANCE_NONE:
- return SEVERITY_NONE;
- case UpgradeDetector::UPGRADE_ANNOYANCE_LOW:
- return SEVERITY_LOW;
- case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED:
- return SEVERITY_MEDIUM;
- case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH:
- return SEVERITY_HIGH;
- case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE:
- return SEVERITY_HIGH;
- case UpgradeDetector::UPGRADE_ANNOYANCE_CRITICAL:
- return SEVERITY_HIGH;
- }
- NOTREACHED();
- return SEVERITY_NONE;
-}
-
-// static
-bool WrenchIconPainter::ShouldAnimateUpgradeLevel(
- UpgradeDetector::UpgradeNotificationAnnoyanceLevel level) {
- bool should_animate = true;
- if (level == UpgradeDetector::UPGRADE_ANNOYANCE_LOW) {
- // Only animate low severity upgrades once.
- static bool should_animate_low_severity = true;
- should_animate = should_animate_low_severity;
- should_animate_low_severity = false;
- }
- return should_animate;
-}
-
-// static
-WrenchIconPainter::Severity WrenchIconPainter::GlobalErrorSeverity() {
- // If you change this make sure to also change the menu icon and the bubble
- // icon.
- return SEVERITY_MEDIUM;
-}
-
WrenchIconPainter::WrenchIconPainter(Delegate* delegate)
: delegate_(delegate),
severity_(SEVERITY_NONE) {
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_icon_painter.h ('k') | chrome/browser/ui/toolbar/wrench_menu_badge_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698