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

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

Issue 23513039: Replace animated tab audio indicator with static tab audio indicator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments from sky@. Also, rebased. Created 7 years, 3 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 | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/tabs/tab_audio_indicator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_audio_indicator.h
diff --git a/chrome/browser/ui/tabs/tab_audio_indicator.h b/chrome/browser/ui/tabs/tab_audio_indicator.h
deleted file mode 100644
index dcbdab2069fe7bb34b52537dde633a45e6ec96f8..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/tabs/tab_audio_indicator.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_TABS_TAB_AUDIO_INDICATOR_H_
-#define CHROME_BROWSER_UI_TABS_TAB_AUDIO_INDICATOR_H_
-
-#include <vector>
-
-#include "base/compiler_specific.h"
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "ui/gfx/animation/animation_delegate.h"
-#include "ui/gfx/image/image_skia.h"
-
-namespace gfx {
-class Animation;
-class AnimationContainer;
-class Canvas;
-class LinearAnimation;
-class Rect;
-}
-
-// This class is used to draw an animating tab audio indicator.
-class TabAudioIndicator : public gfx::AnimationDelegate {
- public:
- class Delegate {
- public:
- virtual void ScheduleAudioIndicatorPaint() = 0;
-
- protected:
- virtual ~Delegate() {}
- };
-
- explicit TabAudioIndicator(Delegate* delegate);
- virtual ~TabAudioIndicator();
-
- void set_favicon(const gfx::ImageSkia& favicon) { favicon_ = favicon; }
-
- void SetAnimationContainer(gfx::AnimationContainer* animation_container);
- void SetIsPlayingAudio(bool is_playing_audio);
- bool IsAnimating();
-
- void Paint(gfx::Canvas* canvas, const gfx::Rect& rect);
-
- private:
- enum State {
- STATE_NOT_ANIMATING,
- STATE_ANIMATING,
- STATE_ANIMATION_ENDING,
- };
-
- FRIEND_TEST_ALL_PREFIXES(TabAudioIndicatorTest, AnimationState);
- FRIEND_TEST_ALL_PREFIXES(TabAudioIndicatorTest, SchedulePaint);
-
- // AnimationDelegate:
- virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
-
- // Gets the equalizer levels for all 3 columns. The values are tweened between
- // the current and target frame.
- std::vector<int> GetCurrentEqualizerLevels() const;
-
- Delegate* delegate_;
- scoped_ptr<gfx::LinearAnimation> animation_;
- scoped_refptr<gfx::AnimationContainer> animation_container_;
- gfx::ImageSkia favicon_;
-
- // The equalizer frame that's currently being displayed.
- size_t frame_index_;
-
- // The equalizer levels that were last displayed. This is used to prevent
- // unnecessary drawing when animation progress doesn't result in equalizer
- // levels changing.
- std::vector<int> last_displayed_equalizer_levels_;
-
- State state_;
-
- DISALLOW_COPY_AND_ASSIGN(TabAudioIndicator);
-};
-
-#endif // CHROME_BROWSER_UI_TABS_TAB_AUDIO_INDICATOR_H_
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/tabs/tab_audio_indicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698