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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 14245003: Wrench Icon: Only animate low severity status once (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/cocoa/toolbar/toolbar_controller.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index 08b7371da8005d7717c0477c3de5c65741d5add1..5ceaf288937e9402e0d601413cc34a079854f527 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -561,8 +561,17 @@ class NotificationBridge
WrenchToolbarButtonCell* cell =
base::mac::ObjCCastStrict<WrenchToolbarButtonCell>([wrenchButton_ cell]);
if (UpgradeDetector::GetInstance()->notify_upgrade()) {
- [cell setSeverity:WrenchIconPainter::SeverityFromUpgradeLevel(
- UpgradeDetector::GetInstance()->upgrade_notification_stage())];
+ WrenchIconPainter::Severity severity =
+ WrenchIconPainter::SeverityFromUpgradeLevel(
+ UpgradeDetector::GetInstance()->upgrade_notification_stage());
+ bool shouldAnimate = true;
+ if (severity == WrenchIconPainter::SEVERITY_LOW) {
+ // Only animate low severity upgrades once.
+ static bool sShouldAnimate = true;
+ shouldAnimate = sShouldAnimate;
+ sShouldAnimate = false;
+ }
+ [cell setSeverity:severity shouldAnimate:shouldAnimate];
return;
}
@@ -570,11 +579,12 @@ class NotificationBridge
browser_->profile())->GetHighestSeverityGlobalErrorWithWrenchMenuItem();
if (error) {
[cell setSeverity:WrenchIconPainter::SeverityFromGlobalErrorSeverity(
- error->GetSeverity())];
+ error->GetSeverity())
+ shouldAnimate:YES];
return;
}
- [cell setSeverity:WrenchIconPainter::SEVERITY_NONE];
+ [cell setSeverity:WrenchIconPainter::SEVERITY_NONE shouldAnimate:YES];
}
- (void)prefChanged:(const std::string&)prefName {
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.h » ('j') | chrome/browser/ui/views/toolbar_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698