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" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 class AppSyncUIStateWatcher; | 45 class AppSyncUIStateWatcher; |
46 #endif | 46 #endif |
47 | 47 |
48 class AppListViewDelegate : public app_list::AppListViewDelegate, | 48 class AppListViewDelegate : public app_list::AppListViewDelegate, |
49 public app_list::StartPageObserver, | 49 public app_list::StartPageObserver, |
50 public HotwordClient, | 50 public HotwordClient, |
51 public ProfileInfoCacheObserver, | 51 public ProfileInfoCacheObserver, |
52 public SigninManagerBase::Observer, | 52 public SigninManagerBase::Observer, |
53 public SigninManagerFactory::Observer { | 53 public SigninManagerFactory::Observer { |
54 public: | 54 public: |
55 AppListViewDelegate(Profile* profile, | 55 // Constructor. Does not take ownership of |controller_delegate|. |
56 AppListControllerDelegate* controller); | 56 // TODO(tapted): It should. |
57 explicit AppListViewDelegate(AppListControllerDelegate* controller_delegate); | |
Matt Giuca
2014/08/25 04:48:46
I don't see why you had to delete the Profile argu
tapted
2014/08/25 06:17:00
Done.
I think splitting the constructor is still
Matt Giuca
2014/08/26 01:29:45
Fair enough. Can you put back your comment about t
tapted
2014/08/26 02:43:57
Done.
| |
57 virtual ~AppListViewDelegate(); | 58 virtual ~AppListViewDelegate(); |
58 | 59 |
60 // Configure the AppList for the given |profile|. | |
61 void SetProfile(Profile* profile); | |
62 | |
59 private: | 63 private: |
60 // Updates the app list's current profile and ProfileMenuItems. | 64 // Updates the speech webview and start page for the current |profile_|. |
61 void OnProfileChanged(); | 65 void SetUpSearchUI(); |
66 | |
67 // Updates the app list's ProfileMenuItems for the current |profile_|. | |
68 void SetUpProfileSwitcher(); | |
69 | |
70 // Updates the app list's custom launcher pages for the current |profile_|. | |
71 void SetUpCustomLauncherPages(); | |
62 | 72 |
63 // Overridden from app_list::AppListViewDelegate: | 73 // Overridden from app_list::AppListViewDelegate: |
64 virtual bool ForceNativeDesktop() const OVERRIDE; | 74 virtual bool ForceNativeDesktop() const OVERRIDE; |
65 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE; | 75 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE; |
66 virtual app_list::AppListModel* GetModel() OVERRIDE; | 76 virtual app_list::AppListModel* GetModel() OVERRIDE; |
67 virtual app_list::SpeechUIModel* GetSpeechUI() OVERRIDE; | 77 virtual app_list::SpeechUIModel* GetSpeechUI() OVERRIDE; |
68 virtual void GetShortcutPathForApp( | 78 virtual void GetShortcutPathForApp( |
69 const std::string& app_id, | 79 const std::string& app_id, |
70 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 80 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
71 virtual void StartSearch() OVERRIDE; | 81 virtual void StartSearch() OVERRIDE; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 virtual void GoogleSignedOut(const std::string& username) OVERRIDE; | 133 virtual void GoogleSignedOut(const std::string& username) OVERRIDE; |
124 | 134 |
125 // Overridden from ProfileInfoCacheObserver: | 135 // Overridden from ProfileInfoCacheObserver: |
126 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; | 136 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; |
127 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, | 137 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, |
128 const base::string16& profile_name) OVERRIDE; | 138 const base::string16& profile_name) OVERRIDE; |
129 virtual void OnProfileNameChanged( | 139 virtual void OnProfileNameChanged( |
130 const base::FilePath& profile_path, | 140 const base::FilePath& profile_path, |
131 const base::string16& old_profile_name) OVERRIDE; | 141 const base::string16& old_profile_name) OVERRIDE; |
132 | 142 |
133 scoped_ptr<app_list::SearchController> search_controller_; | |
134 // Unowned pointer to the controller. | 143 // Unowned pointer to the controller. |
135 AppListControllerDelegate* controller_; | 144 AppListControllerDelegate* controller_; |
136 // Unowned pointer to the associated profile. May change if SetProfileByPath | 145 // Unowned pointer to the associated profile. May change if SetProfileByPath |
137 // is called. | 146 // is called. |
138 Profile* profile_; | 147 Profile* profile_; |
139 // Unowned pointer to the model owned by AppListSyncableService. Will change | 148 // Unowned pointer to the model owned by AppListSyncableService. Will change |
140 // if |profile_| changes. | 149 // if |profile_| changes. |
141 app_list::AppListModel* model_; | 150 app_list::AppListModel* model_; |
142 | 151 |
143 scoped_ptr<app_list::SpeechUIModel> speech_ui_; | 152 scoped_ptr<app_list::SpeechUIModel> speech_ui_; |
153 scoped_ptr<app_list::SearchController> search_controller_; | |
144 | 154 |
145 base::TimeDelta auto_launch_timeout_; | 155 base::TimeDelta auto_launch_timeout_; |
146 | 156 |
147 Users users_; | 157 Users users_; |
148 | 158 |
149 #if defined(USE_ASH) | 159 #if defined(USE_ASH) |
150 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; | 160 scoped_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; |
151 #endif | 161 #endif |
152 | 162 |
153 ObserverList<app_list::AppListViewDelegateObserver> observers_; | 163 ObserverList<app_list::AppListViewDelegateObserver> observers_; |
154 | 164 |
155 // Used to track the SigninManagers that this instance is observing so that | 165 // Used to track the SigninManagers that this instance is observing so that |
156 // this instance can be removed as an observer on its destruction. | 166 // this instance can be removed as an observer on its destruction. |
157 ScopedObserver<SigninManagerBase, AppListViewDelegate> scoped_observer_; | 167 ScopedObserver<SigninManagerBase, AppListViewDelegate> scoped_observer_; |
158 | 168 |
159 // Window contents of additional custom launcher pages. | 169 // Window contents of additional custom launcher pages. |
160 ScopedVector<apps::CustomLauncherPageContents> custom_page_contents_; | 170 ScopedVector<apps::CustomLauncherPageContents> custom_page_contents_; |
161 | 171 |
162 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); | 172 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); |
163 }; | 173 }; |
164 | 174 |
165 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 175 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
OLD | NEW |