Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: chrome/browser/ui/app_list/start_page_service.h

Issue 676593003: Implement native speech recognition for the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix timeout. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/start_page_service.h
diff --git a/chrome/browser/ui/app_list/start_page_service.h b/chrome/browser/ui/app_list/start_page_service.h
index e2a7c824d9227d7159c96b1178eb35a32544c4b5..ba3ce96a0014dd5635a482138a79a1bbcc192e9f 100644
--- a/chrome/browser/ui/app_list/start_page_service.h
+++ b/chrome/browser/ui/app_list/start_page_service.h
@@ -25,6 +25,7 @@ class Profile;
namespace app_list {
+class AppListSpeechRecognizer;
class RecommendedApps;
class StartPageObserver;
@@ -53,14 +54,20 @@ class StartPageService : public KeyedService {
// They return essentially the same web contents but might return NULL when
// some flag disables the feature.
content::WebContents* GetStartPageContents();
- content::WebContents* GetSpeechRecognitionContents();
+ virtual content::WebContents* GetSpeechRecognitionContents();
RecommendedApps* recommended_apps() { return recommended_apps_.get(); }
Profile* profile() { return profile_; }
SpeechRecognitionState state() { return state_; }
- void OnSpeechResult(const base::string16& query, bool is_final);
- void OnSpeechSoundLevelChanged(int16 level);
- void OnSpeechRecognitionStateChanged(SpeechRecognitionState new_state);
+ virtual void OnSpeechResult(const base::string16& query, bool is_final);
+ virtual void OnSpeechSoundLevelChanged(int16 level);
+ virtual void OnSpeechRecognitionStateChanged(
+ SpeechRecognitionState new_state);
+
+ protected:
+ // Protected for testing.
+ explicit StartPageService(Profile* profile);
+ ~StartPageService() override;
private:
friend class StartPageServiceFactory;
@@ -74,9 +81,6 @@ class StartPageService : public KeyedService {
// getUserMedia() request from the web contents.
class StartPageWebContentsDelegate;
- explicit StartPageService(Profile* profile);
- ~StartPageService() override;
-
void LoadContents();
void UnloadContents();
@@ -96,6 +100,8 @@ class StartPageService : public KeyedService {
bool webui_finished_loading_;
std::vector<base::Closure> pending_webui_callbacks_;
+ scoped_refptr<AppListSpeechRecognizer> speech_recognizer_;
+
DISALLOW_COPY_AND_ASSIGN(StartPageService);
};

Powered by Google App Engine
This is Rietveld 408576698