| 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
|
| };
|
|
|