Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / app_list / cocoa / apps_grid_view_item.h
blob6106050a99413f9a2174218860665d4b9bfa5c26
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_APPS_GRID_VIEW_ITEM_H_
6 #define UI_APP_LIST_COCOA_APPS_GRID_VIEW_ITEM_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/app_list/app_list_export.h"
12 #import "ui/base/cocoa/tracking_area.h"
14 namespace app_list {
15 class AppListItem;
16 class ItemModelObserverBridge;
19 // AppsGridViewItem is the controller for an NSButton representing an app item
20 // on an NSCollectionView controlled by an AppsGridController.
21 APP_LIST_EXPORT
22 @interface AppsGridViewItem : NSCollectionViewItem {
23 @private
24 scoped_ptr<app_list::ItemModelObserverBridge> observerBridge_;
25 base::scoped_nsobject<NSProgressIndicator> progressIndicator_;
27 // Used to highlight the background on hover.
28 ui::ScopedCrTrackingArea trackingArea_;
31 @property(readonly, nonatomic) NSProgressIndicator* progressIndicator;
33 // Designated initializer. |tileSize| is the size of tiles in the grid.
34 - (id)initWithSize:(NSSize)tileSize;
36 // Set the represented model, updating views. Clears if |itemModel| is NULL.
37 - (void)setModel:(app_list::AppListItem*)itemModel;
39 // Model accessor, via the |observerBridge_|.
40 - (app_list::AppListItem*)model;
42 // Return the button portion of the item, showing the icon and title.
43 - (NSButton*)button;
45 // Generate and return a context menu, populated using the represented model.
46 - (NSMenu*)contextMenu;
48 // Take a snapshot of the grid cell with correct layout, then hide the button.
49 // If |isRestore| is true, the snapshot includes the label and items hidden for
50 // the initial snapshot are restored.
51 - (NSBitmapImageRep*)dragRepresentationForRestore:(BOOL)isRestore;
53 @end
55 #endif // UI_APP_LIST_COCOA_APPS_GRID_VIEW_ITEM_H_