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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 12374042: Mac: Audio indicator in each tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 7 years, 10 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 | « no previous file | chrome/browser/ui/cocoa/tabs/throbbing_image_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1f0c0cb3d3837ea482460b741bb2eef400cc5e93..17c28f8094acac4689326f1d81ae9868e742dab9 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -111,6 +111,9 @@ 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 {
@@ -1604,6 +1607,20 @@ 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 {
iconView = imageView;
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/throbbing_image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698