app_list_view_delegate.h revision 90dce4d38c5ff5333bea97d859d4e484e27edf0c
1// Copyright (c) 2012 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. 4 5#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 6#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 7 8#include <string> 9 10#include "base/basictypes.h" 11#include "base/compiler_specific.h" 12#include "base/memory/scoped_ptr.h" 13#include "ui/app_list/app_list_view_delegate.h" 14 15class AppListControllerDelegate; 16class AppsModelBuilder; 17class Profile; 18 19namespace app_list { 20class SearchController; 21} 22 23namespace gfx { 24class ImageSkia; 25} 26 27#if defined(USE_ASH) 28class AppSyncUIStateWatcher; 29#endif 30 31class AppListViewDelegate : public app_list::AppListViewDelegate { 32 public: 33 // The delegate will take ownership of the controller. 34 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile); 35 virtual ~AppListViewDelegate(); 36 37 private: 38 // Overridden from app_list::AppListViewDelegate: 39 virtual void SetModel(app_list::AppListModel* model) OVERRIDE; 40 virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE; 41 virtual void ActivateAppListItem(app_list::AppListItemModel* item, 42 int event_flags) OVERRIDE; 43 virtual void StartSearch() OVERRIDE; 44 virtual void StopSearch() OVERRIDE; 45 virtual void OpenSearchResult(app_list::SearchResult* result, 46 int event_flags) OVERRIDE; 47 virtual void InvokeSearchResultAction(app_list::SearchResult* result, 48 int action_index, 49 int event_flags) OVERRIDE; 50 virtual void Dismiss() OVERRIDE; 51 virtual void ViewClosing() OVERRIDE; 52 virtual void ViewActivationChanged(bool active) OVERRIDE; 53 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; 54 virtual string16 GetCurrentUserName() OVERRIDE; 55 virtual string16 GetCurrentUserEmail() OVERRIDE; 56 virtual void OpenSettings() OVERRIDE; 57 virtual void OpenHelp() OVERRIDE; 58 virtual void OpenFeedback() OVERRIDE; 59 60 scoped_ptr<app_list::SigninDelegate> signin_delegate_; 61 scoped_ptr<AppsModelBuilder> apps_builder_; 62 scoped_ptr<app_list::SearchController> search_controller_; 63 scoped_ptr<AppListControllerDelegate> controller_; 64 Profile* profile_; 65 66#if defined(USE_ASH) 67 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; 68#endif 69 70 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); 71}; 72 73#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ 74