| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ | 5 #ifndef UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ |
| 6 #define UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ | 6 #define UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/app_list/app_list_export.h" | 12 #include "ui/app_list/app_list_export.h" |
| 13 | 13 |
| 14 namespace app_list { | 14 namespace app_list { |
| 15 class AppListMenu; |
| 16 class AppListViewDelegate; |
| 15 class SearchBoxModel; | 17 class SearchBoxModel; |
| 16 class SearchBoxModelObserverBridge; | 18 class SearchBoxModelObserverBridge; |
| 17 } | 19 } |
| 18 | 20 |
| 21 @class AppListMenuController; |
| 22 @class HoverImageMenuButton; |
| 19 @class SearchTextField; | 23 @class SearchTextField; |
| 20 | 24 |
| 21 @protocol AppsSearchBoxDelegate<NSTextFieldDelegate> | 25 @protocol AppsSearchBoxDelegate<NSTextFieldDelegate> |
| 22 | 26 |
| 27 - (app_list::AppListViewDelegate*)appListDelegate; |
| 23 - (app_list::SearchBoxModel*)searchBoxModel; | 28 - (app_list::SearchBoxModel*)searchBoxModel; |
| 24 - (void)modelTextDidChange; | 29 - (void)modelTextDidChange; |
| 25 | 30 |
| 26 @end | 31 @end |
| 27 | 32 |
| 28 // Controller for the search box in the topmost portion of the app list. | 33 // Controller for the search box in the topmost portion of the app list. |
| 29 APP_LIST_EXPORT | 34 APP_LIST_EXPORT |
| 30 @interface AppsSearchBoxController : NSViewController<NSTextFieldDelegate> { | 35 @interface AppsSearchBoxController : NSViewController<NSTextFieldDelegate> { |
| 31 @private | 36 @private |
| 32 scoped_nsobject<SearchTextField> searchTextField_; | 37 scoped_nsobject<SearchTextField> searchTextField_; |
| 33 scoped_nsobject<NSImageView> searchImageView_; | 38 scoped_nsobject<NSImageView> searchImageView_; |
| 39 scoped_nsobject<HoverImageMenuButton> menuButton_; |
| 40 scoped_nsobject<AppListMenuController> menuController_; |
| 34 scoped_ptr<app_list::SearchBoxModelObserverBridge> bridge_; | 41 scoped_ptr<app_list::SearchBoxModelObserverBridge> bridge_; |
| 42 scoped_ptr<app_list::AppListMenu> appListMenu_; |
| 35 | 43 |
| 36 id<AppsSearchBoxDelegate> delegate_; // Weak. Owns us. | 44 id<AppsSearchBoxDelegate> delegate_; // Weak. Owns us. |
| 37 } | 45 } |
| 38 | 46 |
| 39 @property(assign, nonatomic) id<AppsSearchBoxDelegate> delegate; | 47 @property(assign, nonatomic) id<AppsSearchBoxDelegate> delegate; |
| 40 | 48 |
| 41 - (id)initWithFrame:(NSRect)frame; | 49 - (id)initWithFrame:(NSRect)frame; |
| 42 - (void)clearSearch; | 50 - (void)clearSearch; |
| 43 | 51 |
| 44 @end | 52 @end |
| 45 | 53 |
| 46 @interface AppsSearchBoxController (TestingAPI) | 54 @interface AppsSearchBoxController (TestingAPI) |
| 47 | 55 |
| 48 - (NSTextField*)searchTextField; | 56 - (NSTextField*)searchTextField; |
| 57 - (NSPopUpButton*)menuControl; |
| 58 - (app_list::AppListMenu*)appListMenu; |
| 49 | 59 |
| 50 @end | 60 @end |
| 51 | 61 |
| 52 #endif // UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ | 62 #endif // UI_APP_LIST_COCOA_APPS_SEARCH_BOX_CONTROLLER_H_ |
| OLD | NEW |