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_APP_LIST_VIEW_CONTROLLER_H_
6 #define UI_APP_LIST_COCOA_APP_LIST_VIEW_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 #import "ui/app_list/cocoa/apps_pagination_model_observer.h"
14 #import "ui/app_list/cocoa/apps_search_box_controller.h"
15 #import "ui/app_list/cocoa/apps_search_results_controller.h"
18 class AppListViewDelegate
;
20 class AppListModelObserverBridge
;
23 @
class AppListPagerView
;
24 @
class AppsGridController
;
26 // Controller for the top-level view of the app list UI. It creates and hosts an
27 // AppsGridController (displaying an AppListModel), pager control to navigate
28 // between pages in the grid, and search entry box with a pop up menu.
30 @interface AppListViewController
: NSViewController
<AppsPaginationModelObserver
,
31 AppsSearchBoxDelegate
,
32 AppsSearchResultsDelegate
> {
34 base::scoped_nsobject
<AppsGridController
> appsGridController_
;
35 base::scoped_nsobject
<AppListPagerView
> pagerControl_
;
36 base::scoped_nsobject
<AppsSearchBoxController
> appsSearchBoxController_
;
37 base::scoped_nsobject
<AppsSearchResultsController
>
38 appsSearchResultsController_
;
40 // Subview for drawing the background.
41 base::scoped_nsobject
<NSView
> backgroundView_
;
43 // Subview of |backgroundView_| that slides out when search results are shown.
44 base::scoped_nsobject
<NSView
> contentsView_
;
46 // Progress indicator that is visible while the delegate is NULL.
47 base::scoped_nsobject
<NSProgressIndicator
> loadingIndicator_
;
49 app_list::AppListViewDelegate
* delegate_
; // Weak. Owned by AppListService.
51 scoped_ptr
<app_list::AppListModelObserverBridge
>
52 app_list_model_observer_bridge_
;
53 BOOL showingSearchResults_
;
56 @
property(readonly
, nonatomic
) AppsSearchBoxController
*
59 - (app_list::AppListViewDelegate
*)delegate
;
60 - (void)setDelegate
:(app_list::AppListViewDelegate
*)newDelegate
;
61 - (void)onProfilesChanged
;
65 @interface
AppListViewController (TestingAPI
)
67 @
property(nonatomic
, readonly
) BOOL showingSearchResults
;
69 - (AppsGridController
*)appsGridController
;
70 - (NSSegmentedControl
*)pagerControl
;
71 - (NSView
*)backgroundView
;
75 #endif // UI_APP_LIST_COCOA_APP_LIST_VIEW_CONTROLLER_H_