| 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 17c28f8094acac4689326f1d81ae9868e742dab9..31d2130114d5e5b85860e705b53e125bfa779e98 100644
|
| --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| @@ -37,6 +37,7 @@
|
| #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"
|
| @@ -111,9 +112,6 @@ const CGFloat kProjectingIconWidthAndHeight = 32.0;
|
| // Throbbing duration on webrtc "this web page is watching you" favicon overlay.
|
| const int kRecordingDurationMs = 1000;
|
|
|
| -// Throbbing duration on audio playing animation.
|
| -const int kAudioPlayingDurationMs = 2000;
|
| -
|
| // Helper class for doing NSAnimationContext calls that takes a bool to disable
|
| // all the work. Useful for code that wants to conditionally animate.
|
| class ScopedNSAnimationContextGroup {
|
| @@ -1575,6 +1573,9 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) {
|
| 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]) {
|
| @@ -1607,20 +1608,18 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) {
|
| autorelease];
|
|
|
| iconView = recordingView;
|
| - } else if (theme && chrome::IsPlayingAudio(contents)) {
|
| - NSImage* audioImage =
|
| - theme->GetNSImageNamed(IDR_AUDIO_ANIMATION, true);
|
| - NSRect frame =
|
| - NSMakeRect(0, 0, kIconWidthAndHeight, kIconWidthAndHeight);
|
| - ThrobbingImageView* equalizerFaviconView =
|
| - [[[ThrobbingImageView alloc]
|
| - initWithFrame:frame
|
| - backgroundImage:[imageView image]
|
| - throbImage:audioImage
|
| - durationMS:kAudioPlayingDurationMs] autorelease];
|
| - [equalizerFaviconView setTweenType:ui::Tween::LINEAR];
|
| -
|
| - iconView = equalizerFaviconView;
|
| + } else if (chrome::IsPlayingAudio(contents) ||
|
| + [tabAudioIndicatorViewMac isAnimating]) {
|
| + if (!tabAudioIndicatorViewMac) {
|
| + NSRect frame =
|
| + NSMakeRect(0, 0, kIconWidthAndHeight, kIconWidthAndHeight);
|
| + tabAudioIndicatorViewMac = [[[TabAudioIndicatorViewMac alloc]
|
| + initWithFrame:frame] autorelease];
|
| + }
|
| + [tabAudioIndicatorViewMac
|
| + setIsPlayingAudio:chrome::IsPlayingAudio(contents)];
|
| + [tabAudioIndicatorViewMac setBackgroundImage:[imageView image]];
|
| + iconView = tabAudioIndicatorViewMac;
|
| } else {
|
| iconView = imageView;
|
| }
|
|
|