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

Unified Diff: chrome/browser/ui/tabs/tab_audio_indicator.cc

Issue 14139022: Tab audio indicator: Tweak animation (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_audio_indicator.cc
diff --git a/chrome/browser/ui/tabs/tab_audio_indicator.cc b/chrome/browser/ui/tabs/tab_audio_indicator.cc
index 941fd9e046b2026780508060c68ad2c6c1060a60..5f5faf2f23fb32b2244ebd3f77ba5e558544e954 100644
--- a/chrome/browser/ui/tabs/tab_audio_indicator.cc
+++ b/chrome/browser/ui/tabs/tab_audio_indicator.cc
@@ -20,25 +20,26 @@ const size_t kEqualizerColumnCount = 3;
// The equalizer cycles between these frames. An equalizer frame is 2 columns
// where each column ranges from 0 to 4.
const size_t kEqualizerFrames[][kEqualizerColumnCount] = {
- { 0, 1, 2 },
- { 1, 2, 3 },
- { 2, 3, 2 },
- { 3, 2, 1 },
- { 2, 1, 0 },
- { 1, 0, 1 },
- { 0, 1, 2 },
- { 0, 0, 2 },
- { 0, 0, 1 },
- { 1, 0, 0 },
- { 2, 1, 0 },
- { 1, 0, 1 },
+ { 1, 1, 1 },
+ { 1, 2, 2 },
+ { 2, 2, 3 },
+ { 3, 3, 2 },
+ { 3, 2, 1 },
+ { 2, 1, 2 },
+ { 1, 2, 3 },
+ { 2, 1, 2 },
+ { 3, 2, 1 },
+ { 3, 2, 1 },
+ { 2, 3, 2 },
+ { 1, 2, 3 },
+ { 2, 1, 2 },
};
// The space between equalizer levels.
const int kEqualizerColumnPadding = 1;
// The duration of each equalizer frame.
-const size_t kAnimationCycleDurationMs = 300;
+const size_t kAnimationCycleDurationMs = 250;
// The duration of the "ending" animation once audio stops playing.
const size_t kAnimationEndingDurationMs = 1000;
@@ -96,12 +97,12 @@ void TabAudioIndicator::Paint(gfx::Canvas* canvas, const gfx::Rect& rect) {
int x = rect.right();
std::vector<int> levels = GetCurrentEqualizerLevels();
for (int i = levels.size() - 1; i >= 0; --i) {
+ x -= image->width();
if (levels[i] == 0)
continue;
// Shift the image down by the level.
int y = rect.bottom() - levels[i] * 2;
- x -= image->width();
canvas->DrawImageInt(*image, x, y);
// Clip the equalizer column so the favicon doesn't obscure it.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698