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/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
15 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
16 #include "base/scoped_observer.h" | 17 #include "base/scoped_observer.h" |
17 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 18 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
18 #include "chrome/browser/search/hotword_client.h" | 19 #include "chrome/browser/search/hotword_client.h" |
19 #include "chrome/browser/signin/signin_manager_factory.h" | 20 #include "chrome/browser/signin/signin_manager_factory.h" |
20 #include "chrome/browser/ui/app_list/start_page_observer.h" | 21 #include "chrome/browser/ui/app_list/start_page_observer.h" |
21 #include "components/signin/core/browser/signin_manager_base.h" | 22 #include "components/signin/core/browser/signin_manager_base.h" |
22 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
(...skipping 11 matching lines...) Expand all Loading... |
34 class LauncherPageEventDispatcher; | 35 class LauncherPageEventDispatcher; |
35 class SearchController; | 36 class SearchController; |
36 class SearchResourceManager; | 37 class SearchResourceManager; |
37 class SpeechUIModel; | 38 class SpeechUIModel; |
38 } | 39 } |
39 | 40 |
40 namespace base { | 41 namespace base { |
41 class FilePath; | 42 class FilePath; |
42 } | 43 } |
43 | 44 |
| 45 namespace content { |
| 46 struct SpeechRecognitionSessionPreamble; |
| 47 } |
| 48 |
44 namespace gfx { | 49 namespace gfx { |
45 class ImageSkia; | 50 class ImageSkia; |
46 } | 51 } |
47 | 52 |
48 #if defined(USE_ASH) | 53 #if defined(USE_ASH) |
49 class AppSyncUIStateWatcher; | 54 class AppSyncUIStateWatcher; |
50 #endif | 55 #endif |
51 | 56 |
52 class AppListViewDelegate : public app_list::AppListViewDelegate, | 57 class AppListViewDelegate : public app_list::AppListViewDelegate, |
53 public app_list::StartPageObserver, | 58 public app_list::StartPageObserver, |
54 public HotwordClient, | 59 public HotwordClient, |
55 public ProfileInfoCacheObserver, | 60 public ProfileInfoCacheObserver, |
56 public SigninManagerBase::Observer, | 61 public SigninManagerBase::Observer, |
57 public SigninManagerFactory::Observer, | 62 public SigninManagerFactory::Observer, |
58 public content::NotificationObserver { | 63 public content::NotificationObserver { |
59 public: | 64 public: |
60 // Constructs Chrome's AppListViewDelegate with a NULL Profile. | 65 // Constructs Chrome's AppListViewDelegate with a NULL Profile. |
61 // Does not take ownership of |controller|. TODO(tapted): It should. | 66 // Does not take ownership of |controller|. TODO(tapted): It should. |
62 explicit AppListViewDelegate(AppListControllerDelegate* controller); | 67 explicit AppListViewDelegate(AppListControllerDelegate* controller); |
63 ~AppListViewDelegate() override; | 68 ~AppListViewDelegate() override; |
64 | 69 |
65 // Configure the AppList for the given |profile|. | 70 // Configure the AppList for the given |profile|. |
66 void SetProfile(Profile* profile); | 71 void SetProfile(Profile* profile); |
67 Profile* profile() { return profile_; } | 72 Profile* profile() { return profile_; } |
68 | 73 |
| 74 // Invoked to toggle the status of speech recognition based on a hotword |
| 75 // trigger. |
| 76 void ToggleSpeechRecognitionForHotword( |
| 77 const scoped_refptr<content::SpeechRecognitionSessionPreamble>& preamble); |
| 78 |
69 // Overridden from app_list::AppListViewDelegate: | 79 // Overridden from app_list::AppListViewDelegate: |
70 bool ForceNativeDesktop() const override; | 80 bool ForceNativeDesktop() const override; |
71 void SetProfileByPath(const base::FilePath& profile_path) override; | 81 void SetProfileByPath(const base::FilePath& profile_path) override; |
72 app_list::AppListModel* GetModel() override; | 82 app_list::AppListModel* GetModel() override; |
73 app_list::SpeechUIModel* GetSpeechUI() override; | 83 app_list::SpeechUIModel* GetSpeechUI() override; |
74 void GetShortcutPathForApp( | 84 void GetShortcutPathForApp( |
75 const std::string& app_id, | 85 const std::string& app_id, |
76 const base::Callback<void(const base::FilePath&)>& callback) override; | 86 const base::Callback<void(const base::FilePath&)>& callback) override; |
77 void StartSearch() override; | 87 void StartSearch() override; |
78 void StopSearch() override; | 88 void StopSearch() override; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 void SetUpCustomLauncherPages(); | 127 void SetUpCustomLauncherPages(); |
118 | 128 |
119 // Overridden from app_list::StartPageObserver: | 129 // Overridden from app_list::StartPageObserver: |
120 void OnSpeechResult(const base::string16& result, bool is_final) override; | 130 void OnSpeechResult(const base::string16& result, bool is_final) override; |
121 void OnSpeechSoundLevelChanged(int16 level) override; | 131 void OnSpeechSoundLevelChanged(int16 level) override; |
122 void OnSpeechRecognitionStateChanged( | 132 void OnSpeechRecognitionStateChanged( |
123 app_list::SpeechRecognitionState new_state) override; | 133 app_list::SpeechRecognitionState new_state) override; |
124 | 134 |
125 // Overridden from HotwordClient: | 135 // Overridden from HotwordClient: |
126 void OnHotwordStateChanged(bool started) override; | 136 void OnHotwordStateChanged(bool started) override; |
127 void OnHotwordRecognized() override; | 137 void OnHotwordRecognized( |
| 138 const scoped_refptr<content::SpeechRecognitionSessionPreamble>& preamble) |
| 139 override; |
128 | 140 |
129 // Overridden from SigninManagerFactory::Observer: | 141 // Overridden from SigninManagerFactory::Observer: |
130 void SigninManagerCreated(SigninManagerBase* manager) override; | 142 void SigninManagerCreated(SigninManagerBase* manager) override; |
131 void SigninManagerShutdown(SigninManagerBase* manager) override; | 143 void SigninManagerShutdown(SigninManagerBase* manager) override; |
132 | 144 |
133 // Overridden from SigninManagerBase::Observer: | 145 // Overridden from SigninManagerBase::Observer: |
134 void GoogleSigninFailed(const GoogleServiceAuthError& error) override; | 146 void GoogleSigninFailed(const GoogleServiceAuthError& error) override; |
135 void GoogleSigninSucceeded(const std::string& account_id, | 147 void GoogleSigninSucceeded(const std::string& account_id, |
136 const std::string& username, | 148 const std::string& username, |
137 const std::string& password) override; | 149 const std::string& password) override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Window contents of additional custom launcher pages. | 199 // Window contents of additional custom launcher pages. |
188 ScopedVector<apps::CustomLauncherPageContents> custom_page_contents_; | 200 ScopedVector<apps::CustomLauncherPageContents> custom_page_contents_; |
189 | 201 |
190 // Registers for NOTIFICATION_APP_TERMINATING to unload custom launcher pages. | 202 // Registers for NOTIFICATION_APP_TERMINATING to unload custom launcher pages. |
191 content::NotificationRegistrar registrar_; | 203 content::NotificationRegistrar registrar_; |
192 | 204 |
193 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); | 205 DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); |
194 }; | 206 }; |
195 | 207 |
196 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ | 208 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_ |
OLD | NEW |