12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef UI_APP_LIST_COCOA_APP_LIST_VIEW_CONTROLLER_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define UI_APP_LIST_COCOA_APP_LIST_VIEW_CONTROLLER_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#import <Cocoa/Cocoa.h>
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
10eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/mac/scoped_nsobject.h"
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/scoped_ptr.h"
12c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "ui/app_list/app_list_export.h"
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#import "ui/app_list/cocoa/apps_pagination_model_observer.h"
14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#import "ui/app_list/cocoa/apps_search_box_controller.h"
157d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#import "ui/app_list/cocoa/apps_search_results_controller.h"
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace app_list {
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class AppListViewDelegate;
19868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class AppListModel;
203551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)class AppListModelObserverBridge;
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)@class AppListPagerView;
24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@class AppsGridController;
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Controller for the top-level view of the app list UI. It creates and hosts an
27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// AppsGridController (displaying an AppListModel), pager control to navigate
287d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// between pages in the grid, and search entry box with a pop up menu.
29c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)APP_LIST_EXPORT
30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@interface AppListViewController : NSViewController<AppsPaginationModelObserver,
317d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)                                                    AppsSearchBoxDelegate,
327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)                                                    AppsSearchResultsDelegate> {
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) @private
34eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::scoped_nsobject<AppsGridController> appsGridController_;
35eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::scoped_nsobject<AppListPagerView> pagerControl_;
36eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::scoped_nsobject<AppsSearchBoxController> appsSearchBoxController_;
37eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::scoped_nsobject<AppsSearchResultsController>
38eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      appsSearchResultsController_;
397dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
4046d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)  // Subview for drawing the background.
417dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  base::scoped_nsobject<NSView> backgroundView_;
427dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
437dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  // Subview of |backgroundView_| that slides out when search results are shown.
44eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::scoped_nsobject<NSView> contentsView_;
457dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Progress indicator that is visible while the delegate is NULL.
475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  base::scoped_nsobject<NSProgressIndicator> loadingIndicator_;
485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
491320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  app_list::AppListViewDelegate* delegate_;  // Weak. Owned by AppListService.
501320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
513551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)  scoped_ptr<app_list::AppListModelObserverBridge>
523551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)      app_list_model_observer_bridge_;
537d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  BOOL showingSearchResults_;
542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
56a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)@property(readonly, nonatomic) AppsSearchBoxController*
57a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    searchBoxController;
58a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)- (app_list::AppListViewDelegate*)delegate;
601320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci- (void)setDelegate:(app_list::AppListViewDelegate*)newDelegate;
61a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)- (void)onProfilesChanged;
622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)@end
642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@interface AppListViewController (TestingAPI)
66868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
67a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)@property(nonatomic, readonly) BOOL showingSearchResults;
68a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
697dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch- (AppsGridController*)appsGridController;
707dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch- (NSSegmentedControl*)pagerControl;
717dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch- (NSView*)backgroundView;
727dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
73868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@end
74868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // UI_APP_LIST_COCOA_APP_LIST_VIEW_CONTROLLER_H_
76