Chromium Code Reviews| Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| index c99c63fae6c0f9031e5aba28356c75398d822312..8d329b81160a48ecb41c007ff5a54eed20040084 100644 |
| --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| @@ -36,7 +36,6 @@ |
| #import "chrome/browser/ui/cocoa/new_tab_button.h" |
| #import "chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.h" |
| #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
| -#import "chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h" |
| #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" |
| #import "chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h" |
| #import "chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.h" |
| @@ -1612,12 +1611,10 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { |
| if (newState == kTabDone || oldState != newState || |
| oldHasIcon != newHasIcon) { |
| NSView* iconView = nil; |
| + NSImageView* audioIndicatorView = nil; |
| if (newHasIcon) { |
| if (newState == kTabDone) { |
| NSImageView* imageView = [self iconImageViewForContents:contents]; |
| - TabAudioIndicatorViewMac* tabAudioIndicatorViewMac = |
| - base::mac::ObjCCast<TabAudioIndicatorViewMac>( |
| - [tabController iconView]); |
| ui::ThemeProvider* theme = [[tabStripView_ window] themeProvider]; |
| if (theme && [tabController projecting]) { |
| @@ -1658,22 +1655,20 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { |
| animationContainer:animationContainer_.get()] autorelease]; |
| iconView = recordingView; |
| - } else if (chrome::IsPlayingAudio(contents) || |
| - [tabAudioIndicatorViewMac isAnimating]) { |
| - if (!tabAudioIndicatorViewMac) { |
| - NSRect frame = |
| - NSMakeRect(0, 0, kIconWidthAndHeight, kIconWidthAndHeight); |
| - tabAudioIndicatorViewMac = [[[TabAudioIndicatorViewMac alloc] |
| - initWithFrame:frame] autorelease]; |
| - [tabAudioIndicatorViewMac |
| - setAnimationContainer:animationContainer_.get()]; |
| - } |
| - [tabAudioIndicatorViewMac |
| - setIsPlayingAudio:chrome::IsPlayingAudio(contents)]; |
| - [tabAudioIndicatorViewMac setBackgroundImage:[imageView image]]; |
| - iconView = tabAudioIndicatorViewMac; |
| } else { |
| iconView = imageView; |
| + |
| + if (theme && chrome::IsPlayingAudio(contents)) { |
| + NSImage* const image = |
| + theme->GetNSImageNamed(IDR_TAB_AUDIO_INDICATOR); |
| + if (image) { |
| + NSRect frame; |
|
sail
2013/09/11 22:21:55
initialize to NSZeroRect
|
| + frame.size = [image size]; |
| + audioIndicatorView = |
| + [[[NSImageView alloc] initWithFrame:frame] autorelease]; |
| + [audioIndicatorView setImage:image]; |
| + } |
| + } |
| } |
| } else if (newState == kTabCrashed) { |
| NSImage* oldImage = [[self iconImageViewForContents:contents] image]; |
| @@ -1699,6 +1694,7 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { |
| //DCHECK_LE(NSMaxX([iconView frame]), |
| // NSWidth([[tabController view] frame]) - kTabOverlap); |
| } |
| + [tabController setAudioIndicatorView:audioIndicatorView]; |
| } |
| } |