OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/app_list/cocoa/item_drag_controller.h" | 5 #import "ui/app_list/cocoa/item_drag_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "ui/app_list/cocoa/apps_grid_view_item.h" | 8 #import "ui/app_list/cocoa/apps_grid_view_item.h" |
9 #include "ui/base/cocoa/window_size_constants.h" | 9 #include "ui/base/cocoa/window_size_constants.h" |
10 | 10 |
11 namespace { | |
12 | |
13 // Scale to transform the grid cell when a drag starts. Note that 1.5 ensures | 11 // Scale to transform the grid cell when a drag starts. Note that 1.5 ensures |
14 // that integers are used for the layer bounds when the grid cell dimensions | 12 // that integers are used for the layer bounds when the grid cell dimensions |
15 // are even. | 13 // are even. |
16 const CGFloat kDraggingIconScale = 1.5; | 14 const CGFloat kDraggingIconScale = 1.5; |
17 | 15 |
18 const NSTimeInterval kAnimationDuration = 0.2; | 16 const NSTimeInterval kAnimationDuration = 0.2; |
19 NSString* const kGrowAnimationKey = @"growAnimation"; | |
20 | 17 |
21 } // namespace | |
22 | 18 |
23 @interface ItemDragController () | 19 @interface ItemDragController () |
24 | 20 |
25 - (void)animateTransformFrom:(CATransform3D)fromValue | 21 - (void)animateTransformFrom:(CATransform3D)fromValue |
26 useDelegate:(BOOL)useDelegate; | 22 useDelegate:(BOOL)useDelegate; |
27 | 23 |
28 - (void)clearAnimations; | 24 - (void)clearAnimations; |
29 | 25 |
30 @end | 26 @end |
31 | 27 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 if (!finished) | 175 if (!finished) |
180 return; | 176 return; |
181 | 177 |
182 DCHECK(shrinking_); | 178 DCHECK(shrinking_); |
183 [self clearAnimations]; | 179 [self clearAnimations]; |
184 [dragLayer_ setContents:nil]; | 180 [dragLayer_ setContents:nil]; |
185 [[self view] setHidden:YES]; | 181 [[self view] setHidden:YES]; |
186 } | 182 } |
187 | 183 |
188 @end | 184 @end |
OLD | NEW |