OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_COCOA_ANIMATABLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_ANIMATABLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_COCOA_ANIMATABLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_ANIMATABLE_VIEW_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 #import "chrome/browser/ui/cocoa/background_gradient_view.h" | 11 #import "chrome/browser/ui/cocoa/background_gradient_view.h" |
12 #import "chrome/browser/ui/cocoa/view_resizer.h" | 12 #import "chrome/browser/ui/cocoa/view_resizer.h" |
13 | 13 |
14 // A view that provides an animatable height property. Provides methods to | 14 // A view that provides an animatable height property. Provides methods to |
15 // animate to a new height, set a new height immediately, or cancel any running | 15 // animate to a new height, set a new height immediately, or cancel any running |
16 // animations. | 16 // animations. |
17 // | 17 // |
18 // AnimatableView sends an |animationDidEnd:| message to its delegate when the | 18 // AnimatableView sends an |animationDidEnd:| message to its delegate when the |
19 // animation ends normally and an |animationDidStop:| message when the animation | 19 // animation ends normally and an |animationDidStop:| message when the animation |
20 // was canceled (even when canceled as a result of a new animation starting). | 20 // was canceled (even when canceled as a result of a new animation starting). |
21 | 21 |
22 @interface AnimatableView : BackgroundGradientView<NSAnimationDelegate> { | 22 @interface AnimatableView : BackgroundGradientView<NSAnimationDelegate> { |
23 @protected | 23 @protected |
24 IBOutlet id delegate_; // weak, used to send animation ended messages. | 24 IBOutlet id delegate_; // weak, used to send animation ended messages. |
25 | 25 |
26 @private | 26 @private |
27 scoped_nsobject<NSAnimation> currentAnimation_; | 27 base::scoped_nsobject<NSAnimation> currentAnimation_; |
28 id<ViewResizer> resizeDelegate_; // weak, usually owns us | 28 id<ViewResizer> resizeDelegate_; // weak, usually owns us |
29 } | 29 } |
30 | 30 |
31 // Properties for bindings. | 31 // Properties for bindings. |
32 @property(assign, nonatomic) id delegate; | 32 @property(assign, nonatomic) id delegate; |
33 @property(assign, nonatomic) id<ViewResizer> resizeDelegate; | 33 @property(assign, nonatomic) id<ViewResizer> resizeDelegate; |
34 | 34 |
35 // Gets the current height of the view. If an animation is currently running, | 35 // Gets the current height of the view. If an animation is currently running, |
36 // this will give the current height at the time of the call, not the target | 36 // this will give the current height at the time of the call, not the target |
37 // height at the end of the animation. | 37 // height at the end of the animation. |
(...skipping 10 matching lines...) Expand all Loading... |
48 // Cancels any running animations, leaving the view at its current | 48 // Cancels any running animations, leaving the view at its current |
49 // (mid-animation) height. | 49 // (mid-animation) height. |
50 - (void)stopAnimation; | 50 - (void)stopAnimation; |
51 | 51 |
52 // Gets the progress of any current animation. | 52 // Gets the progress of any current animation. |
53 - (NSAnimationProgress)currentAnimationProgress; | 53 - (NSAnimationProgress)currentAnimationProgress; |
54 | 54 |
55 @end | 55 @end |
56 | 56 |
57 #endif // CHROME_BROWSER_UI_COCOA_ANIMATABLE_VIEW_H_ | 57 #endif // CHROME_BROWSER_UI_COCOA_ANIMATABLE_VIEW_H_ |
OLD | NEW |