[mac] Allow the OSX App Launcher menu to be invalidated.
[chromium-blink-merge.git] / ui / app_list / cocoa / apps_search_box_controller.h
blobd28c67a62e8a7749807d3a5ae288dd48a1fe3e6b
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_BOX_CONTROLLER_H_
6 #define UI_APP_LIST_COCOA_APPS_SEARCH_BOX_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"
14 namespace app_list {
15 class AppListMenu;
16 class AppListViewDelegate;
17 class SearchBoxModel;
18 class SearchBoxModelObserverBridge;
21 @class AppListMenuController;
22 @class HoverImageMenuButton;
23 @class SearchTextField;
25 @protocol AppsSearchBoxDelegate<NSTextFieldDelegate>
27 - (app_list::AppListViewDelegate*)appListDelegate;
28 - (app_list::SearchBoxModel*)searchBoxModel;
29 - (void)modelTextDidChange;
31 @end
33 // Controller for the search box in the topmost portion of the app list.
34 APP_LIST_EXPORT
35 @interface AppsSearchBoxController : NSViewController<NSTextFieldDelegate> {
36 @private
37 base::scoped_nsobject<SearchTextField> searchTextField_;
38 base::scoped_nsobject<NSImageView> searchImageView_;
39 base::scoped_nsobject<HoverImageMenuButton> menuButton_;
40 base::scoped_nsobject<AppListMenuController> menuController_;
41 scoped_ptr<app_list::SearchBoxModelObserverBridge> bridge_;
42 scoped_ptr<app_list::AppListMenu> appListMenu_;
44 id<AppsSearchBoxDelegate> delegate_; // Weak. Owns us.
47 @property(assign, nonatomic) id<AppsSearchBoxDelegate> delegate;
49 - (id)initWithFrame:(NSRect)frame;
50 - (void)clearSearch;
52 // Rebuild the menu due to changes from the AppListViewDelegate.
53 - (void)rebuildMenu;
55 @end
57 @interface AppsSearchBoxController (TestingAPI)
59 - (NSTextField*)searchTextField;
60 - (NSPopUpButton*)menuControl;
61 - (app_list::AppListMenu*)appListMenu;
63 @end
65 #endif // UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_