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

Side by Side Diff: ui/app_list/cocoa/apps_collection_view_drag_manager.h

Issue 187483005: Extending the Views-on-Mac experiment: whole app list grid. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: still compiles r263560 + crrev/195793005 Created 6 years, 8 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
(Empty)
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.
4
5 #ifndef UI_APP_LIST_COCOA_APPS_COLLECTION_VIEW_DRAG_MANAGER_H_
6 #define UI_APP_LIST_COCOA_APPS_COLLECTION_VIEW_DRAG_MANAGER_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "base/mac/scoped_nsobject.h"
11 #include "ui/app_list/app_list_export.h"
12
13 @class AppsGridController;
14 @class ItemDragController;
15
16 // Manager for the state associated with dragging an NSCollectionViewItem in the
17 // AppsGridController. It is also a factory for the NSCollectionView pages in
18 // the grid, allowing items to be dragged between pages.
19 APP_LIST_EXPORT
20 @interface AppsCollectionViewDragManager : NSObject {
21 @private
22 base::scoped_nsobject<ItemDragController> itemDragController_;
23 AppsGridController* gridController_; // Weak. Owns us.
24
25 NSSize cellSize_;
26 size_t rows_;
27 size_t columns_;
28
29 // Index of the last known position of the item currently being dragged.
30 size_t itemDragIndex_;
31
32 // Model index of the item being dragged, or NSNotFound if nothing was hit on
33 // the last mouseDown.
34 size_t itemHitIndex_;
35
36 // Location in the window of the last mouseDown event.
37 NSPoint mouseDownLocation_;
38
39 // Whether the current mouse action has converted into an item drag.
40 BOOL dragging_;
41 }
42
43 - (id)initWithCellSize:(NSSize)cellSize
44 rows:(size_t)rows
45 columns:(size_t)columns
46 gridController:(AppsGridController*)gridController;
47
48 // Make an empty NSCollectionView with draggable items in the given |pageFrame|.
49 - (NSCollectionView*)makePageWithFrame:(NSRect)pageFrame;
50
51 - (void)cancelDrag;
52
53 @end
54
55 @interface AppsCollectionViewDragManager (TestingAPI)
56
57 - (void)onMouseDownInPage:(NSCollectionView*)page
58 withEvent:(NSEvent*)theEvent;
59 - (void)onMouseDragged:(NSEvent*)theEvent;
60 - (void)onMouseUp:(NSEvent*)theEvent;
61
62 @end
63
64 #endif // UI_APP_LIST_COCOA_APPS_COLLECTION_VIEW_DRAG_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/app_list/app_list_switches.cc ('k') | ui/app_list/cocoa/apps_collection_view_drag_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698