app_list_view_delegate.h revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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;
18class SearchBuilder;
19
20namespace gfx {
21class ImageSkia;
22}
23
24#if defined(USE_ASH)
25class AppSyncUIStateWatcher;
26#endif
27
28class AppListViewDelegate : public app_list::AppListViewDelegate {
29 public:
30  // The delegate will take ownership of the controller.
31  AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile);
32  virtual ~AppListViewDelegate();
33
34 private:
35  // Overridden from app_list::AppListViewDelegate:
36  virtual void SetModel(app_list::AppListModel* model) OVERRIDE;
37  virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE;
38  virtual void ActivateAppListItem(app_list::AppListItemModel* item,
39                                   int event_flags) OVERRIDE;
40  virtual void StartSearch() OVERRIDE;
41  virtual void StopSearch() OVERRIDE;
42  virtual void OpenSearchResult(const app_list::SearchResult& result,
43                                int event_flags) OVERRIDE;
44  virtual void InvokeSearchResultAction(const app_list::SearchResult& result,
45                                        int action_index,
46                                        int event_flags) OVERRIDE;
47  virtual void Dismiss() OVERRIDE;
48  virtual void ViewClosing() OVERRIDE;
49  virtual void ViewActivationChanged(bool active) OVERRIDE;
50  virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
51  virtual string16 GetCurrentUserName() OVERRIDE;
52  virtual string16 GetCurrentUserEmail() OVERRIDE;
53  virtual void OpenSettings() OVERRIDE;
54  virtual void OpenFeedback() OVERRIDE;
55
56  scoped_ptr<app_list::SigninDelegate> signin_delegate_;
57  scoped_ptr<AppsModelBuilder> apps_builder_;
58  scoped_ptr<SearchBuilder> search_builder_;
59  scoped_ptr<AppListControllerDelegate> controller_;
60  Profile* profile_;
61
62#if defined(USE_ASH)
63  scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_;
64#endif
65
66  DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate);
67};
68
69#endif  // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
70