| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 AppListViewDelegate(Profile* profile, |
| 56 AppListControllerDelegate* controller); | 56 AppListControllerDelegate* controller); |
| 57 virtual ~AppListViewDelegate(); | 57 virtual ~AppListViewDelegate(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Updates the app list's current profile and ProfileMenuItems. | 60 // Configure the AppList for the given |profile|. |
| 61 void OnProfileChanged(); | 61 void SetProfile(Profile* profile); |
| 62 |
| 63 // Updates the speech webview and start page for the current |profile_|. |
| 64 void SetUpSearchUI(); |
| 65 |
| 66 // Updates the app list's ProfileMenuItems for the current |profile_|. |
| 67 void SetUpProfileSwitcher(); |
| 68 |
| 69 // Updates the app list's custom launcher pages for the current |profile_|. |
| 70 void SetUpCustomLauncherPages(); |
| 62 | 71 |
| 63 // Overridden from app_list::AppListViewDelegate: | 72 // Overridden from app_list::AppListViewDelegate: |
| 64 virtual bool ForceNativeDesktop() const OVERRIDE; | 73 virtual bool ForceNativeDesktop() const OVERRIDE; |
| 65 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE; | 74 virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE; |
| 66 virtual app_list::AppListModel* GetModel() OVERRIDE; | 75 virtual app_list::AppListModel* GetModel() OVERRIDE; |
| 67 virtual app_list::SpeechUIModel* GetSpeechUI() OVERRIDE; | 76 virtual app_list::SpeechUIModel* GetSpeechUI() OVERRIDE; |
| 68 virtual void GetShortcutPathForApp( | 77 virtual void GetShortcutPathForApp( |
| 69 const std::string& app_id, | 78 const std::string& app_id, |
| 70 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; | 79 const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE; |
| 71 virtual void StartSearch() OVERRIDE; | 80 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; | 132 virtual void GoogleSignedOut(const std::string& username) OVERRIDE; |
| 124 | 133 |
| 125 // Overridden from ProfileInfoCacheObserver: | 134 // Overridden from ProfileInfoCacheObserver: |
| 126 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; | 135 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; |
| 127 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, | 136 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, |
| 128 const base::string16& profile_name) OVERRIDE; | 137 const base::string16& profile_name) OVERRIDE; |
| 129 virtual void OnProfileNameChanged( | 138 virtual void OnProfileNameChanged( |
| 130 const base::FilePath& profile_path, | 139 const base::FilePath& profile_path, |
| 131 const base::string16& old_profile_name) OVERRIDE; | 140 const base::string16& old_profile_name) OVERRIDE; |
| 132 | 141 |
| 133 scoped_ptr<app_list::SearchController> search_controller_; | |
| 134 // Unowned pointer to the controller. | 142 // Unowned pointer to the controller. |
| 135 AppListControllerDelegate* controller_; | 143 AppListControllerDelegate* controller_; |
| 136 // Unowned pointer to the associated profile. May change if SetProfileByPath | 144 // Unowned pointer to the associated profile. May change if SetProfileByPath |
| 137 // is called. | 145 // is called. |
| 138 Profile* profile_; | 146 Profile* profile_; |
| 139 // Unowned pointer to the model owned by AppListSyncableService. Will change | 147 // Unowned pointer to the model owned by AppListSyncableService. Will change |
| 140 // if |profile_| changes. | 148 // if |profile_| changes. |
| 141 app_list::AppListModel* model_; | 149 app_list::AppListModel* model_; |
| 142 | 150 |
| 151 // Note: order ensures |search_controller_| is destroyed before |speech_ui_|. |
| 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 |