platformKeys: Add per-extension sign permissions.
[chromium-blink-merge.git] / ui / app_list / cocoa / apps_search_results_controller.h
blob063fde6e6d944523f906c72319b7d17998bd919a
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_SEARCH_RESULTS_CONTROLLER_H_
6 #define UI_APP_LIST_COCOA_APPS_SEARCH_RESULTS_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/app_list/app_list_export.h"
13 #include "ui/app_list/app_list_model.h"
14 #import "ui/base/cocoa/tracking_area.h"
16 namespace app_list {
17 class AppsSearchResultsModelBridge;
18 class SearchResult;
21 @class AppsSearchResultsCell;
23 @protocol AppsSearchResultsDelegate<NSObject>
25 - (app_list::AppListModel*)appListModel;
26 - (void)openResult:(app_list::SearchResult*)result;
28 @end
30 // Controller for the search results displayed when a user types in the app list
31 // search box. Results display in an NSTableView with a single column. Each row
32 // has an icon on the left, and one or two lines of formatted text describing
33 // the result.
34 APP_LIST_EXPORT
35 @interface AppsSearchResultsController
36 : NSViewController<NSTableViewDelegate, NSTableViewDataSource> {
37 @private
38 base::scoped_nsobject<NSTableView> tableView_;
39 ui::ScopedCrTrackingArea trackingArea_;
40 NSPoint lastMouseDownInView_;
41 NSInteger hoveredRowIndex_;
42 scoped_ptr<app_list::AppsSearchResultsModelBridge> bridge_;
43 NSObject<AppsSearchResultsDelegate>* delegate_; // Weak. Owns us.
46 @property(assign, nonatomic) NSObject<AppsSearchResultsDelegate>* delegate;
47 @property(readonly, nonatomic) app_list::AppListModel::SearchResults* results;
48 @property(readonly, nonatomic) NSTableView* tableView;
50 - (id)initWithAppsSearchResultsFrameSize:(NSSize)size;
52 // Returns true when handling Enter, to activate the highlighted search result,
53 // or up/down to navigate results.
54 - (BOOL)handleCommandBySelector:(SEL)command;
56 @end
58 #endif // UI_APP_LIST_COCOA_APPS_SEARCH_RESULTS_CONTROLLER_H_