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
3 // found in the LICENSE file.
5 #ifndef UI_APP_LIST_COCOA_ITEM_DRAG_WINDOW_CONTROLLER_H_
6 #define UI_APP_LIST_COCOA_ITEM_DRAG_WINDOW_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
9 #import <QuartzCore/QuartzCore.h>
11 #include "base/mac/scoped_nsobject.h"
13 @
class AppsGridViewItem
;
15 // Controller to manage the animations and transient views that are used when
16 // dragging an app list item around the app list grid. When initiated, the item
17 // image (only) is grown in an animation, and sticks to the mouse cursor. When
18 // released, the label is added to the image and it shrinks and moves to the
19 // item location in the grid.
20 @interface ItemDragController
: NSViewController
{
22 base::scoped_nsobject
<CALayer
> dragLayer_
;
23 base::scoped_nsobject
<NSButton
> buttonToRestore_
;
25 NSTimeInterval growStart_
;
29 - (id
)initWithGridCellSize
:(NSSize
)size
;
31 - (void)initiate
:(AppsGridViewItem
*)item
32 mouseDownLocation
:(NSPoint
)mouseDownLocation
33 currentLocation
:(NSPoint
)currentLocation
34 timestamp
:(NSTimeInterval
)eventTimestamp
;
36 - (void)update
:(NSPoint
)currentLocation
37 timestamp
:(NSTimeInterval
)eventTimestamp
;
39 - (void)complete
:(AppsGridViewItem
*)item
40 targetOrigin
:(NSPoint
)targetOrigin
;
44 #endif // UI_APP_LIST_COCOA_ITEM_DRAG_WINDOW_CONTROLLER_H_