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 SigninDelegateObserverBridge
;
23 @
class AppListPagerView
;
24 @
class AppsGridController
;
25 @
class SigninViewController
;
27 // Controller for the top-level view of the app list UI. It creates and hosts an
28 // AppsGridController (displaying an AppListModel), pager control to navigate
29 // between pages in the grid, and search entry box with a pop up menu.
31 @interface AppListViewController
: NSViewController
<AppsPaginationModelObserver
,
32 AppsSearchBoxDelegate
,
33 AppsSearchResultsDelegate
> {
35 base::scoped_nsobject
<AppsGridController
> appsGridController_
;
36 base::scoped_nsobject
<AppListPagerView
> pagerControl_
;
37 base::scoped_nsobject
<AppsSearchBoxController
> appsSearchBoxController_
;
38 base::scoped_nsobject
<AppsSearchResultsController
>
39 appsSearchResultsController_
;
40 base::scoped_nsobject
<SigninViewController
> signinViewController_
;
42 // Subview for drawing the background. Hidden when the signin view is visible.
43 base::scoped_nsobject
<NSView
> backgroundView_
;
45 // Subview of |backgroundView_| that slides out when search results are shown.
46 base::scoped_nsobject
<NSView
> contentsView_
;
48 scoped_ptr
<app_list::AppListViewDelegate
> delegate_
;
49 scoped_ptr
<app_list::SigninDelegateObserverBridge
> signin_observer_bridge_
;
50 BOOL showingSearchResults_
;
53 - (app_list::AppListViewDelegate
*)delegate
;
54 - (void)setDelegate
:(scoped_ptr
<app_list::AppListViewDelegate
>)newDelegate
;
55 - (void)onSigninStatusChanged
;
59 @interface
AppListViewController (TestingAPI
)
61 - (AppsGridController
*)appsGridController
;
62 - (NSSegmentedControl
*)pagerControl
;
63 - (NSView
*)backgroundView
;
65 - (void)setDelegate
:(scoped_ptr
<app_list::AppListViewDelegate
>)newDelegate
66 withTestModel
:(scoped_ptr
<app_list::AppListModel
>)newModel
;
70 #endif // UI_APP_LIST_COCOA_APP_LIST_VIEW_CONTROLLER_H_