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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

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/views/toolbar_view.cc
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index d7e9f70a37159722c1388e1494f3b6b0e9e78772..d506a12b0588d6a6264b5b87415249d01500692d 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -815,15 +815,24 @@ void ToolbarView::UpdateWrenchButtonSeverity() {
incompatibility_badge_showing = false;
if (ShouldShowUpgradeRecommended()) {
- app_menu_->SetSeverity(WrenchIconPainter::SeverityFromUpgradeLevel(
- UpgradeDetector::GetInstance()->upgrade_notification_stage()));
+ WrenchIconPainter::Severity severity =
+ WrenchIconPainter::SeverityFromUpgradeLevel(
+ UpgradeDetector::GetInstance()->upgrade_notification_stage());
+ bool animate = true;
+ if (severity == WrenchIconPainter::SEVERITY_LOW) {
sky 2013/04/15 13:50:28 Could we consolidate this code in WrenchIconPainte
sail 2013/04/15 15:58:49 It's difficult to do because WrenchIconPainter can
sky 2013/04/15 16:54:55 Isn't this the only place that calls into WrenchIc
sail 2013/04/15 17:00:40 Right. We would still need to plumb extra informat
sail 2013/04/15 21:38:43 Actually, moving this to a static function in Wren
+ // Only animate low severity upgrades once.
+ static bool s_should_animate = true;
+ animate = s_should_animate;
+ s_should_animate = false;
+ }
+ app_menu_->SetSeverity(severity, animate);
return;
}
if (ShouldShowIncompatibilityWarning()) {
if (!was_showing)
content::RecordAction(UserMetricsAction("ConflictBadge"));
- app_menu_->SetSeverity(WrenchIconPainter::SEVERITY_HIGH);
+ app_menu_->SetSeverity(WrenchIconPainter::SEVERITY_HIGH, true);
incompatibility_badge_showing = true;
return;
}
@@ -834,11 +843,11 @@ void ToolbarView::UpdateWrenchButtonSeverity() {
service->GetHighestSeverityGlobalErrorWithWrenchMenuItem();
if (error) {
app_menu_->SetSeverity(WrenchIconPainter::SeverityFromGlobalErrorSeverity(
- error->GetSeverity()));
+ error->GetSeverity()), true);
return;
}
- app_menu_->SetSeverity(WrenchIconPainter::SEVERITY_NONE);
+ app_menu_->SetSeverity(WrenchIconPainter::SEVERITY_NONE, true);
}
void ToolbarView::OnShowHomeButtonChanged() {
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_icon_painter_unittest.cc ('k') | chrome/browser/ui/views/wrench_toolbar_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698