| 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_BOX_CONTROLLER_H_ | |
| 6 #define UI_APP_LIST_COCOA_APPS_SEARCH_BOX_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 | |
| 15 namespace app_list { | |
| 16 class AppListMenu; | |
| 17 class AppListModel; | |
| 18 class AppListViewDelegate; | |
| 19 class SearchBoxModel; | |
| 20 class SearchBoxModelObserverBridge; | |
| 21 } | |
| 22 | |
| 23 @class AppListMenuController; | |
| 24 @class HoverImageMenuButton; | |
| 25 @class SearchTextField; | |
| 26 | |
| 27 @protocol AppsSearchBoxDelegate<NSTextFieldDelegate> | |
| 28 | |
| 29 - (app_list::AppListViewDelegate*)appListDelegate; | |
| 30 - (app_list::SearchBoxModel*)searchBoxModel; | |
| 31 - (app_list::AppListModel*)appListModel; | |
| 32 - (void)modelTextDidChange; | |
| 33 | |
| 34 @end | |
| 35 | |
| 36 // Controller for the search box in the topmost portion of the app list. | |
| 37 APP_LIST_EXPORT | |
| 38 @interface AppsSearchBoxController : NSViewController<NSTextFieldDelegate> { | |
| 39 @private | |
| 40 base::scoped_nsobject<SearchTextField> searchTextField_; | |
| 41 base::scoped_nsobject<NSImageView> searchImageView_; | |
| 42 base::scoped_nsobject<HoverImageMenuButton> menuButton_; | |
| 43 base::scoped_nsobject<AppListMenuController> menuController_; | |
| 44 std::unique_ptr<app_list::SearchBoxModelObserverBridge> bridge_; | |
| 45 std::unique_ptr<app_list::AppListMenu> appListMenu_; | |
| 46 | |
| 47 id<AppsSearchBoxDelegate> delegate_; // Weak. Owns us. | |
| 48 } | |
| 49 | |
| 50 @property(assign, nonatomic) id<AppsSearchBoxDelegate> delegate; | |
| 51 | |
| 52 - (id)initWithFrame:(NSRect)frame; | |
| 53 - (void)clearSearch; | |
| 54 | |
| 55 // Rebuild the menu due to changes from the AppListViewDelegate. | |
| 56 - (void)rebuildMenu; | |
| 57 | |
| 58 @end | |
| 59 | |
| 60 @interface AppsSearchBoxController (TestingAPI) | |
| 61 | |
| 62 - (NSTextField*)searchTextField; | |
| 63 - (NSPopUpButton*)menuControl; | |
| 64 - (app_list::AppListMenu*)appListMenu; | |
| 65 | |
| 66 @end | |
| 67 | |
| 68 #endif // UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ | |
| OLD | NEW |