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