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

Unified Diff: chrome/browser/ui/views/tabs/tab.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/tabs/tab_audio_indicator_unittest.cc ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.h
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h
index 0c432304ba61b72cacfa3173cdf43491d2567e33..2ea8a9fb5f212c804bed93be23953236f207652e 100644
--- a/chrome/browser/ui/views/tabs/tab.h
+++ b/chrome/browser/ui/views/tabs/tab.h
@@ -10,7 +10,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/ui/tabs/tab_audio_indicator.h"
#include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
#include "ui/base/layout.h"
#include "ui/gfx/animation/animation_delegate.h"
@@ -38,8 +37,7 @@ class ImageButton;
// A View that renders a Tab, either in a TabStrip or in a DraggedTabView.
//
///////////////////////////////////////////////////////////////////////////////
-class Tab : public TabAudioIndicator::Delegate,
- public gfx::AnimationDelegate,
+class Tab : public gfx::AnimationDelegate,
public views::ButtonListener,
public views::ContextMenuController,
public views::View {
@@ -153,9 +151,6 @@ class Tab : public TabAudioIndicator::Delegate,
typedef std::list<ImageCacheEntry> ImageCache;
- // Overridden from TabAudioIndicator::Delegate:
- virtual void ScheduleAudioIndicatorPaint() OVERRIDE;
-
// Overridden from gfx::AnimationDelegate:
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
@@ -198,6 +193,10 @@ class Tab : public TabAudioIndicator::Delegate,
const gfx::Rect& GetTitleBounds() const;
const gfx::Rect& GetIconBounds() const;
+ // Invoked from Layout to adjust the position of the favicon or audio
+ // indicator for mini tabs.
+ void MaybeAdjustLeftForMiniTab(gfx::Rect* bounds) const;
+
// Invoked from SetData after |data_| has been updated to the new data.
void DataChanged(const TabRendererData& old);
@@ -217,9 +216,10 @@ class Tab : public TabAudioIndicator::Delegate,
int tab_id);
void PaintActiveTabBackground(gfx::Canvas* canvas);
- // Paints the icon at the specified coordinates, mirrored for RTL if needed.
+ // Paints the icon, audio indicator icon, etc., mirrored for RTL if needed.
void PaintIcon(gfx::Canvas* canvas);
void PaintCaptureState(gfx::Canvas* canvas, gfx::Rect bounds);
+ void PaintAudioIndicator(gfx::Canvas* canvas);
void PaintTitle(gfx::Canvas* canvas, SkColor title_color);
// Invoked if data_.network_state changes, or the network_state is not none.
@@ -233,6 +233,9 @@ class Tab : public TabAudioIndicator::Delegate,
// Returns whether the Tab should display a favicon.
bool ShouldShowIcon() const;
+ // Returns whether the Tab should display the audio indicator.
+ bool ShouldShowAudioIndicator() const;
+
// Returns whether the Tab should display a close button.
bool ShouldShowCloseBox() const;
@@ -321,8 +324,6 @@ class Tab : public TabAudioIndicator::Delegate,
scoped_refptr<gfx::AnimationContainer> animation_container_;
- scoped_ptr<TabAudioIndicator> tab_audio_indicator_;
-
views::ImageButton* close_button_;
ui::ThemeProvider* theme_provider_;
@@ -334,6 +335,7 @@ class Tab : public TabAudioIndicator::Delegate,
// The bounds of various sections of the display.
gfx::Rect favicon_bounds_;
gfx::Rect title_bounds_;
+ gfx::Rect audio_indicator_bounds_;
// The offset used to paint the inactive background image.
gfx::Point background_offset_;
@@ -353,6 +355,10 @@ class Tab : public TabAudioIndicator::Delegate,
// changes and layout appropriately.
bool showing_icon_;
+ // Whether we're showing the audio indicator. It is cached so that we can
+ // detect when it changes and layout appropriately.
+ bool showing_audio_indicator_;
+
// Whether we are showing the close button. It is cached so that we can
// detect when it changes and layout appropriately.
bool showing_close_button_;
« no previous file with comments | « chrome/browser/ui/tabs/tab_audio_indicator_unittest.cc ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698