OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 14 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "ui/app_list/app_list_view_delegate.h" | 17 #include "ui/app_list/app_list_view_delegate.h" |
18 #include "ui/app_list/signin_delegate_observer.h" | |
19 | 18 |
20 class AppListControllerDelegate; | 19 class AppListControllerDelegate; |
21 class AppsModelBuilder; | 20 class AppsModelBuilder; |
22 class Profile; | 21 class Profile; |
23 | 22 |
24 namespace app_list { | 23 namespace app_list { |
25 class SearchController; | 24 class SearchController; |
26 } | 25 } |
27 | 26 |
28 namespace base { | 27 namespace base { |
29 class FilePath; | 28 class FilePath; |
30 } | 29 } |
31 | 30 |
32 namespace content { | 31 namespace content { |
33 class NotificationDetails; | 32 class NotificationDetails; |
34 class NotificationSource; | 33 class NotificationSource; |
35 } | 34 } |
36 | 35 |
37 namespace gfx { | 36 namespace gfx { |
38 class ImageSkia; | 37 class ImageSkia; |
39 } | 38 } |
40 | 39 |
41 #if defined(USE_ASH) | 40 #if defined(USE_ASH) |
42 class AppSyncUIStateWatcher; | 41 class AppSyncUIStateWatcher; |
43 #endif | 42 #endif |
44 | 43 |
45 class AppListViewDelegate : public app_list::AppListViewDelegate, | 44 class AppListViewDelegate : public app_list::AppListViewDelegate, |
46 public app_list::SigninDelegateObserver, | |
47 public content::NotificationObserver, | 45 public content::NotificationObserver, |
48 public ProfileInfoCacheObserver { | 46 public ProfileInfoCacheObserver { |
49 public: | 47 public: |
50 // The delegate will take ownership of the controller. | 48 // The delegate will take ownership of the controller. |
51 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile); | 49 AppListViewDelegate(AppListControllerDelegate* controller, Profile* profile); |
52 virtual ~AppListViewDelegate(); | 50 virtual ~AppListViewDelegate(); |
53 | 51 |
54 private: | 52 private: |
55 void OnProfileChanged(); | 53 void OnProfileChanged(); |
56 | 54 |
(...skipping 12 matching lines...) Expand all Loading... |
69 virtual void InvokeSearchResultAction(app_list::SearchResult* result, | 67 virtual void InvokeSearchResultAction(app_list::SearchResult* result, |
70 int action_index, | 68 int action_index, |
71 int event_flags) OVERRIDE; | 69 int event_flags) OVERRIDE; |
72 virtual void Dismiss() OVERRIDE; | 70 virtual void Dismiss() OVERRIDE; |
73 virtual void ViewClosing() OVERRIDE; | 71 virtual void ViewClosing() OVERRIDE; |
74 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; | 72 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
75 virtual void OpenSettings() OVERRIDE; | 73 virtual void OpenSettings() OVERRIDE; |
76 virtual void OpenHelp() OVERRIDE; | 74 virtual void OpenHelp() OVERRIDE; |
77 virtual void OpenFeedback() OVERRIDE; | 75 virtual void OpenFeedback() OVERRIDE; |
78 | 76 |
79 // Overridden from app_list::SigninDelegateObserver: | |
80 virtual void OnSigninSuccess() OVERRIDE; | |
81 | |
82 // Overridden from content::NotificationObserver: | 77 // Overridden from content::NotificationObserver: |
83 virtual void Observe(int type, | 78 virtual void Observe(int type, |
84 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
85 const content::NotificationDetails& details) OVERRIDE; | 80 const content::NotificationDetails& details) OVERRIDE; |
86 | 81 |
87 // Overridden from ProfileInfoCacheObserver: | 82 // Overridden from ProfileInfoCacheObserver: |
88 virtual void OnProfileNameChanged( | 83 virtual void OnProfileNameChanged( |
89 const base::FilePath& profile_path, | 84 const base::FilePath& profile_path, |
90 const base::string16& old_profile_name) OVERRIDE; | 85 const base::string16& old_profile_name) OVERRIDE; |
91 | 86 |
92 scoped_ptr<app_list::SigninDelegate> signin_delegate_; | 87 scoped_ptr<app_list::SigninDelegate> signin_delegate_; |
93 scoped_ptr<AppsModelBuilder> apps_builder_; | 88 scoped_ptr<AppsModelBuilder> apps_builder_; |
94 scoped_ptr<app_list::SearchController> search_controller_; | 89 scoped_ptr<app_list::SearchController> search_controller_; |
95 scoped_ptr<AppListControllerDelegate> controller_; | 90 scoped_ptr<AppListControllerDelegate> controller_; |
96 Profile* profile_; | 91 Profile* profile_; |
97 app_list::AppListModel* model_; // Weak. Owned by AppListView. | 92 app_list::AppListModel* model_; // Weak. Owned by AppListView. |
98 | 93 |
99 content::NotificationRegistrar registrar_; | 94 content::NotificationRegistrar registrar_; |
100 #if defined(USE_ASH) | 95 #if defined(USE_ASH) |
101 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; | 96 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; |
102 #endif | 97 #endif |
103 | 98 |
104 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); | 99 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); |
105 }; | 100 }; |
106 | 101 |
107 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 102 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
OLD | NEW |