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 9b697a4f914250f669b14fff48456c99d50f7c60..cea029f34df01cadff76930319740a4a03710548 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/animation/animation_delegate.h" |
#include "ui/base/layout.h" |
@@ -40,8 +39,7 @@ class ImageButton; |
// A View that renders a Tab, either in a TabStrip or in a DraggedTabView. |
// |
/////////////////////////////////////////////////////////////////////////////// |
-class Tab : public TabAudioIndicator::Delegate, |
- public ui::AnimationDelegate, |
+class Tab : public ui::AnimationDelegate, |
public views::ButtonListener, |
public views::ContextMenuController, |
public views::View { |
@@ -155,9 +153,6 @@ class Tab : public TabAudioIndicator::Delegate, |
typedef std::list<ImageCacheEntry> ImageCache; |
- // Overridden from TabAudioIndicator::Delegate: |
- virtual void ScheduleAudioIndicatorPaint() OVERRIDE; |
- |
// Overridden from ui::AnimationDelegate: |
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; |
@@ -200,6 +195,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); |
@@ -218,9 +217,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. |
@@ -234,6 +234,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; |
@@ -322,8 +325,6 @@ class Tab : public TabAudioIndicator::Delegate, |
scoped_refptr<ui::AnimationContainer> animation_container_; |
- scoped_ptr<TabAudioIndicator> tab_audio_indicator_; |
- |
views::ImageButton* close_button_; |
ui::ThemeProvider* theme_provider_; |
@@ -335,6 +336,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_; |
@@ -354,6 +356,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_; |