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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.mm

Issue 13867007: Tab audio indicator: Use animation container on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h"
6 6
7 #include "chrome/browser/ui/tabs/tab_audio_indicator.h" 7 #include "chrome/browser/ui/tabs/tab_audio_indicator.h"
8 #include "ui/gfx/canvas_skia_paint.h" 8 #include "ui/gfx/canvas_skia_paint.h"
9 #include "ui/gfx/image/image.h" 9 #include "ui/gfx/image/image.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 - (void)setIsPlayingAudio:(BOOL)isPlayingAudio { 43 - (void)setIsPlayingAudio:(BOOL)isPlayingAudio {
44 tabAudioIndicator_->SetIsPlayingAudio(isPlayingAudio); 44 tabAudioIndicator_->SetIsPlayingAudio(isPlayingAudio);
45 } 45 }
46 46
47 - (void)setBackgroundImage:(NSImage*)backgroundImage { 47 - (void)setBackgroundImage:(NSImage*)backgroundImage {
48 gfx::Image image([backgroundImage retain]); 48 gfx::Image image([backgroundImage retain]);
49 tabAudioIndicator_->set_favicon(*image.ToImageSkia()); 49 tabAudioIndicator_->set_favicon(*image.ToImageSkia());
50 } 50 }
51 51
52 - (void)setAnimationContainer:(ui::AnimationContainer*)animationContainer {
53 tabAudioIndicator_->SetAnimationContainer(animationContainer);
54 }
55
52 - (BOOL)isAnimating { 56 - (BOOL)isAnimating {
53 return tabAudioIndicator_->IsAnimating(); 57 return tabAudioIndicator_->IsAnimating();
54 } 58 }
55 59
56 - (void)drawRect:(NSRect)rect { 60 - (void)drawRect:(NSRect)rect {
57 gfx::CanvasSkiaPaint canvas(rect, false); 61 gfx::CanvasSkiaPaint canvas(rect, false);
58 canvas.set_composite_alpha(true); 62 canvas.set_composite_alpha(true);
59 tabAudioIndicator_->Paint(&canvas, gfx::Rect(NSRectToCGRect([self bounds]))); 63 tabAudioIndicator_->Paint(&canvas, gfx::Rect(NSRectToCGRect([self bounds])));
60 } 64 }
61 65
62 @end 66 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h ('k') | chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698