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

Unified Diff: chrome/browser/resources/app_list/speech_manager.js

Issue 69813002: Adds the speech recognition button to the app-list searchbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/resources/app_list/speech_manager.js
diff --git a/chrome/browser/resources/app_list/speech_manager.js b/chrome/browser/resources/app_list/speech_manager.js
index b316dd61329ce3e90d6e0ff2042f12d6ffc431e8..972a3adfe87cbc2480313c2bbcd4262f03c3c249 100644
--- a/chrome/browser/resources/app_list/speech_manager.js
+++ b/chrome/browser/resources/app_list/speech_manager.js
@@ -100,6 +100,7 @@ cr.define('speech', function() {
*/
SpeechManager.prototype.onSpeechRecognitionStarted = function() {
this.setState_(SpeechState.RECOGNIZING);
+ chrome.send('setSpeechRecognitionState', [true]);
};
/**
@@ -108,6 +109,7 @@ cr.define('speech', function() {
SpeechManager.prototype.onSpeechRecognitionEnded = function() {
// Restarts the hotword recognition.
this.audioManager_.start();
+ chrome.send('setSpeechRecognitionState', [false]);
};
/**
@@ -148,6 +150,18 @@ cr.define('speech', function() {
this.setState_(SpeechState.READY);
};
+ /**
+ * Toggles the current state of speech recognition.
+ */
+ SpeechManager.prototype.toggleSpeechRecognition = function() {
+ if (this.state == SpeechState.RECOGNIZING) {
+ this.speechRecognitionManager_.stop();
+ } else {
+ this.audioManager_.stop();
+ this.speechRecognitionManager_.start();
+ }
+ };
+
return {
SpeechManager: SpeechManager
};

Powered by Google App Engine
This is Rietveld 408576698