OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import <QuartzCore/QuartzCore.h> | 6 #import <QuartzCore/QuartzCore.h> |
7 | 7 |
8 #import "chrome/browser/cocoa/animatable_view.h" | 8 #import "chrome/browser/cocoa/animatable_view.h" |
9 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 9 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 - (id)initWithView:(AnimatableView*)view | 22 - (id)initWithView:(AnimatableView*)view |
23 finalHeight:(CGFloat)height | 23 finalHeight:(CGFloat)height |
24 duration:(NSTimeInterval)duration; | 24 duration:(NSTimeInterval)duration; |
25 @end | 25 @end |
26 | 26 |
27 @implementation HeightAnimation | 27 @implementation HeightAnimation |
28 - (id)initWithView:(AnimatableView*)view | 28 - (id)initWithView:(AnimatableView*)view |
29 finalHeight:(CGFloat)height | 29 finalHeight:(CGFloat)height |
30 duration:(NSTimeInterval)duration { | 30 duration:(NSTimeInterval)duration { |
31 if ((self = [super gtm_initWithDuration:duration | 31 if ((self = [super gtm_initWithDuration:duration |
| 32 eventMask:NSLeftMouseDownMask |
32 animationCurve:NSAnimationEaseIn])) { | 33 animationCurve:NSAnimationEaseIn])) { |
33 view_ = view; | 34 view_ = view; |
34 startHeight_ = [view_ height]; | 35 startHeight_ = [view_ height]; |
35 endHeight_ = height; | 36 endHeight_ = height; |
36 [self setAnimationBlockingMode:NSAnimationNonblocking]; | 37 [self setAnimationBlockingMode:NSAnimationNonblocking]; |
37 [self setDelegate:view_]; | 38 [self setDelegate:view_]; |
38 } | 39 } |
39 return self; | 40 return self; |
40 } | 41 } |
41 | 42 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 - (void)animationDidEnd:(NSAnimation*)animation { | 101 - (void)animationDidEnd:(NSAnimation*)animation { |
101 if ([resizeDelegate_ respondsToSelector:@selector(setAnimationInProgress:)]) | 102 if ([resizeDelegate_ respondsToSelector:@selector(setAnimationInProgress:)]) |
102 [resizeDelegate_ setAnimationInProgress:NO]; | 103 [resizeDelegate_ setAnimationInProgress:NO]; |
103 if ([delegate_ respondsToSelector:@selector(animationDidEnd:)]) | 104 if ([delegate_ respondsToSelector:@selector(animationDidEnd:)]) |
104 [delegate_ animationDidEnd:animation]; | 105 [delegate_ animationDidEnd:animation]; |
105 currentAnimation_.reset(nil); | 106 currentAnimation_.reset(nil); |
106 } | 107 } |
107 | 108 |
108 @end | 109 @end |
OLD | NEW |