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

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

Issue 23531053: ui/base/animation -> ui/gfx/animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 7 years, 3 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/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/gfx/animation/animation_delegate.h"
8 8
9 class ThrobbingImageViewAnimationDelegate : public ui::AnimationDelegate { 9 class ThrobbingImageViewAnimationDelegate : public gfx::AnimationDelegate {
10 public: 10 public:
11 ThrobbingImageViewAnimationDelegate(NSView* view) : view_(view) {} 11 ThrobbingImageViewAnimationDelegate(NSView* view) : view_(view) {}
12 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { 12 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE {
13 [view_ setNeedsDisplay:YES]; 13 [view_ setNeedsDisplay:YES];
14 } 14 }
15 private: 15 private:
16 NSView* view_; // weak 16 NSView* view_; // weak
17 }; 17 };
18 18
19 @implementation ThrobbingImageView 19 @implementation ThrobbingImageView
20 20
21 - (id)initWithFrame:(NSRect)rect 21 - (id)initWithFrame:(NSRect)rect
22 backgroundImage:(NSImage*)backgroundImage 22 backgroundImage:(NSImage*)backgroundImage
23 throbImage:(NSImage*)throbImage 23 throbImage:(NSImage*)throbImage
24 durationMS:(int)durationMS 24 durationMS:(int)durationMS
25 throbPosition:(ThrobPosition)throbPosition 25 throbPosition:(ThrobPosition)throbPosition
26 animationContainer:(ui::AnimationContainer*)animationContainer { 26 animationContainer:(gfx::AnimationContainer*)animationContainer {
27 if ((self = [super initWithFrame:rect])) { 27 if ((self = [super initWithFrame:rect])) {
28 backgroundImage_.reset([backgroundImage retain]); 28 backgroundImage_.reset([backgroundImage retain]);
29 throbImage_.reset([throbImage retain]); 29 throbImage_.reset([throbImage retain]);
30 30
31 delegate_.reset(new ThrobbingImageViewAnimationDelegate(self)); 31 delegate_.reset(new ThrobbingImageViewAnimationDelegate(self));
32 throbAnimation_.reset(new ui::ThrobAnimation(delegate_.get())); 32 throbAnimation_.reset(new gfx::ThrobAnimation(delegate_.get()));
33 throbAnimation_->SetContainer(animationContainer); 33 throbAnimation_->SetContainer(animationContainer);
34 throbAnimation_->SetThrobDuration(durationMS); 34 throbAnimation_->SetThrobDuration(durationMS);
35 throbAnimation_->StartThrobbing(-1); 35 throbAnimation_->StartThrobbing(-1);
36 36
37 throbPosition_ = throbPosition; 37 throbPosition_ = throbPosition;
38 } 38 }
39 return self; 39 return self;
40 } 40 }
41 41
42 - (void)dealloc { 42 - (void)dealloc {
(...skipping 17 matching lines...) Expand all
60 } else { 60 } else {
61 throbImageBounds = b; 61 throbImageBounds = b;
62 } 62 }
63 [throbImage_ drawInRect:throbImageBounds 63 [throbImage_ drawInRect:throbImageBounds
64 fromRect:NSZeroRect 64 fromRect:NSZeroRect
65 operation:NSCompositeSourceOver 65 operation:NSCompositeSourceOver
66 fraction:throbAnimation_->GetCurrentValue()]; 66 fraction:throbAnimation_->GetCurrentValue()];
67 } 67 }
68 68
69 @end 69 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/throbbing_image_view.h ('k') | chrome/browser/ui/cocoa/tabs/throbbing_image_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698