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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_projecting_image_view.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h"
6 6
7 @implementation TabProjectingImageView 7 @implementation TabProjectingImageView
8 8
9 - (id)initWithFrame:(NSRect)rect 9 - (id)initWithFrame:(NSRect)rect
10 backgroundImage:(NSImage*)backgroundImage 10 backgroundImage:(NSImage*)backgroundImage
11 projectorImage:(NSImage*)projectorImage 11 projectorImage:(NSImage*)projectorImage
12 throbImage:(NSImage*)throbImage 12 throbImage:(NSImage*)throbImage
13 durationMS:(int)durationMS { 13 durationMS:(int)durationMS
14 animationContainer:(ui::AnimationContainer*)animationContainer {
14 if ((self = [super initWithFrame:rect 15 if ((self = [super initWithFrame:rect
15 backgroundImage:backgroundImage 16 backgroundImage:backgroundImage
16 throbImage:throbImage 17 throbImage:throbImage
17 durationMS:durationMS 18 durationMS:durationMS
18 throbPosition:kThrobPositionOverlay])) { 19 throbPosition:kThrobPositionOverlay
20 animationContainer:animationContainer])) {
19 projectorImage_.reset([projectorImage retain]); 21 projectorImage_.reset([projectorImage retain]);
20 } 22 }
21 return self; 23 return self;
22 } 24 }
23 25
24 - (void)drawRect:(NSRect)rect { 26 - (void)drawRect:(NSRect)rect {
25 // For projecting mode, we need to draw 3 centered icons of different sizes: 27 // For projecting mode, we need to draw 3 centered icons of different sizes:
26 // - glow: 32x32 28 // - glow: 32x32
27 // - projection sheet: 16x16 29 // - projection sheet: 16x16
28 // - favicon: 12x12 (0.75*16) 30 // - favicon: 12x12 (0.75*16)
(...skipping 22 matching lines...) Expand all
51 operation:NSCompositeSourceOver 53 operation:NSCompositeSourceOver
52 fraction:1]; 54 fraction:1];
53 55
54 [throbImage_ drawInRect:[self bounds] 56 [throbImage_ drawInRect:[self bounds]
55 fromRect:NSZeroRect 57 fromRect:NSZeroRect
56 operation:NSCompositeSourceOver 58 operation:NSCompositeSourceOver
57 fraction:throbAnimation_->GetCurrentValue()]; 59 fraction:throbAnimation_->GetCurrentValue()];
58 } 60 }
59 61
60 @end 62 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698