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 #ifndef UI_APP_LIST_COCOA_APPS_GRID_CONTROLLER_H_ | 5 #ifndef UI_APP_LIST_COCOA_APPS_GRID_CONTROLLER_H_ |
6 #define UI_APP_LIST_COCOA_APPS_GRID_CONTROLLER_H_ | 6 #define UI_APP_LIST_COCOA_APPS_GRID_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
| 11 #include <memory> |
| 12 |
11 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "ui/app_list/app_list_export.h" | 14 #include "ui/app_list/app_list_export.h" |
14 #import "ui/app_list/cocoa/app_list_pager_view.h" | 15 #import "ui/app_list/cocoa/app_list_pager_view.h" |
15 #import "ui/app_list/cocoa/scroll_view_with_no_scrollbars.h" | 16 #import "ui/app_list/cocoa/scroll_view_with_no_scrollbars.h" |
16 | 17 |
17 namespace app_list { | 18 namespace app_list { |
18 class AppListModel; | 19 class AppListModel; |
19 class AppListViewDelegate; | 20 class AppListViewDelegate; |
20 class AppsGridDelegateBridge; | 21 class AppsGridDelegateBridge; |
21 } | 22 } |
22 | 23 |
23 @class AppsGridViewItem; | 24 @class AppsGridViewItem; |
24 @protocol AppsPaginationModelObserver; | 25 @protocol AppsPaginationModelObserver; |
25 @class AppsCollectionViewDragManager; | 26 @class AppsCollectionViewDragManager; |
26 | 27 |
27 // Controls a grid of views, representing AppListItemList sub models. | 28 // Controls a grid of views, representing AppListItemList sub models. |
28 APP_LIST_EXPORT | 29 APP_LIST_EXPORT |
29 @interface AppsGridController : NSViewController<GestureScrollDelegate, | 30 @interface AppsGridController : NSViewController<GestureScrollDelegate, |
30 AppListPagerDelegate, | 31 AppListPagerDelegate, |
31 NSCollectionViewDelegate> { | 32 NSCollectionViewDelegate> { |
32 @private | 33 @private |
33 app_list::AppListViewDelegate* delegate_; // Weak. Owned by view controller. | 34 app_list::AppListViewDelegate* delegate_; // Weak. Owned by view controller. |
34 scoped_ptr<app_list::AppsGridDelegateBridge> bridge_; | 35 std::unique_ptr<app_list::AppsGridDelegateBridge> bridge_; |
35 | 36 |
36 base::scoped_nsobject<AppsCollectionViewDragManager> dragManager_; | 37 base::scoped_nsobject<AppsCollectionViewDragManager> dragManager_; |
37 base::scoped_nsobject<NSMutableArray> pages_; | 38 base::scoped_nsobject<NSMutableArray> pages_; |
38 base::scoped_nsobject<NSMutableArray> items_; | 39 base::scoped_nsobject<NSMutableArray> items_; |
39 base::scoped_nsobject<NSTimer> scrollWhileDraggingTimer_; | 40 base::scoped_nsobject<NSTimer> scrollWhileDraggingTimer_; |
40 | 41 |
41 id<AppsPaginationModelObserver> paginationObserver_; | 42 id<AppsPaginationModelObserver> paginationObserver_; |
42 | 43 |
43 // Index of the currently visible page. | 44 // Index of the currently visible page. |
44 size_t visiblePage_; | 45 size_t visiblePage_; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 @end | 118 @end |
118 | 119 |
119 @interface AppsGridController(TestingAPI) | 120 @interface AppsGridController(TestingAPI) |
120 | 121 |
121 - (AppsCollectionViewDragManager*)dragManager; | 122 - (AppsCollectionViewDragManager*)dragManager; |
122 - (size_t)scheduledScrollPage; | 123 - (size_t)scheduledScrollPage; |
123 | 124 |
124 @end | 125 @end |
125 | 126 |
126 #endif // UI_APP_LIST_COCOA_APPS_GRID_CONTROLLER_H_ | 127 #endif // UI_APP_LIST_COCOA_APPS_GRID_CONTROLLER_H_ |
OLD | NEW |