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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/throbbing_image_view.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, 9 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
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/throbbing_image_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/throbbing_image_view.h" 5 #import "chrome/browser/ui/cocoa/tabs/throbbing_image_view.h"
6 6
7 #include "ui/base/animation/animation_delegate.h" 7 #include "ui/base/animation/animation_delegate.h"
8 8
9 class ThrobbingImageViewAnimationDelegate : public ui::AnimationDelegate { 9 class ThrobbingImageViewAnimationDelegate : public ui::AnimationDelegate {
10 public: 10 public:
(...skipping 16 matching lines...) Expand all
27 throbImage_.reset([throbImage retain]); 27 throbImage_.reset([throbImage retain]);
28 28
29 delegate_.reset(new ThrobbingImageViewAnimationDelegate(self)); 29 delegate_.reset(new ThrobbingImageViewAnimationDelegate(self));
30 throbAnimation_.reset(new ui::ThrobAnimation(delegate_.get())); 30 throbAnimation_.reset(new ui::ThrobAnimation(delegate_.get()));
31 throbAnimation_->SetThrobDuration(durationMS); 31 throbAnimation_->SetThrobDuration(durationMS);
32 throbAnimation_->StartThrobbing(-1); 32 throbAnimation_->StartThrobbing(-1);
33 } 33 }
34 return self; 34 return self;
35 } 35 }
36 36
37 - (void)setTweenType:(ui::Tween::Type)type {
38 throbAnimation_->SetTweenType(type);
39 }
40
37 - (void)dealloc { 41 - (void)dealloc {
38 throbAnimation_->Stop(); 42 throbAnimation_->Stop();
39 [super dealloc]; 43 [super dealloc];
40 } 44 }
41 45
42 - (void)drawRect:(NSRect)rect { 46 - (void)drawRect:(NSRect)rect {
43 [backgroundImage_ drawInRect:[self bounds] 47 [backgroundImage_ drawInRect:[self bounds]
44 fromRect:NSZeroRect 48 fromRect:NSZeroRect
45 operation:NSCompositeSourceOver 49 operation:NSCompositeSourceOver
46 fraction:1]; 50 fraction:1];
47 [throbImage_ drawInRect:[self bounds] 51 [throbImage_ drawInRect:[self bounds]
48 fromRect:NSZeroRect 52 fromRect:NSZeroRect
49 operation:NSCompositeSourceOver 53 operation:NSCompositeSourceOver
50 fraction:throbAnimation_->GetCurrentValue()]; 54 fraction:throbAnimation_->GetCurrentValue()];
51 } 55 }
52 56
53 @end 57 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/throbbing_image_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698