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

Side by Side Diff: ash/launcher/launcher_button.cc

Issue 10392173: Flash window by pulsing their launcher icon state indicator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some cleanup Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/launcher/launcher_button.h" 5 #include "ash/launcher/launcher_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/launcher/launcher_button_host.h" 9 #include "ash/launcher/launcher_button_host.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 views::ImageView::OnPaint(canvas); 66 views::ImageView::OnPaint(canvas);
67 } 67 }
68 } 68 }
69 69
70 // ui::AnimationDelegate overrides. 70 // ui::AnimationDelegate overrides.
71 void AnimationProgressed(const ui::Animation* animation) OVERRIDE { 71 void AnimationProgressed(const ui::Animation* animation) OVERRIDE {
72 SchedulePaint(); 72 SchedulePaint();
73 } 73 }
74 74
75 void ShowAttention(bool show) { 75 void ShowAttention(bool show) {
76 if (show) 76 if (show) {
77 // It's less disruptive if we don't start the pulsing at 0.
78 animation_.Reset(0.375);
77 animation_.StartThrobbing(-1); 79 animation_.StartThrobbing(-1);
78 else 80 } else {
79 animation_.Reset(); 81 animation_.Reset(0.0);
82 }
80 } 83 }
81 84
82 private: 85 private:
83 ui::ThrobAnimation animation_; 86 ui::ThrobAnimation animation_;
84 87
85 DISALLOW_COPY_AND_ASSIGN(BarView); 88 DISALLOW_COPY_AND_ASSIGN(BarView);
86 }; 89 };
87 90
88 LauncherButton::IconView::IconView() : icon_size_(kIconHeight) { 91 LauncherButton::IconView::IconView() : icon_size_(kIconHeight) {
89 } 92 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_RUNNING; 310 bar_id = IDR_AURA_LAUNCHER_UNDERLINE_RUNNING;
308 311
309 bar_->SetImage(rb.GetImageNamed(bar_id).ToSkBitmap()); 312 bar_->SetImage(rb.GetImageNamed(bar_id).ToSkBitmap());
310 } 313 }
311 314
312 Layout(); 315 Layout();
313 SchedulePaint(); 316 SchedulePaint();
314 } 317 }
315 } // namespace internal 318 } // namespace internal
316 } // namespace ash 319 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698