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 c37d1a12d0b3aaa6d2dced4e4b440ebc786ebc7c..6c3673a3dd2406f8f2dd53fef4159b7db4456d0c 100644 |
--- a/chrome/browser/resources/app_list/speech_manager.js |
+++ b/chrome/browser/resources/app_list/speech_manager.js |
@@ -85,7 +85,6 @@ cr.define('speech', function() { |
this.pluginManager_.stopRecognizer(); |
this.setState_(SpeechState.READY); |
} |
- chrome.send('setHotwordRecognizerState', [true]); |
}; |
/** |
@@ -181,21 +180,23 @@ cr.define('speech', function() { |
return; |
document.body.removeChild(recognizer); |
this.pluginManager_ = null; |
- chrome.send('setHotwordRecognizerState', [false]); |
if (this.state == SpeechState.HOTWORD_RECOGNIZING) |
this.setState(SpeechState.READY); |
} |
}; |
/** |
- * Starts the hotword recognizer. |
+ * Called when the app-list bubble is shown. |
*/ |
- SpeechManager.prototype.startHotwordRecognition = function() { |
+ SpeechManager.prototype.onShown = function() { |
+ this.shown_ = true; |
if (!this.pluginManager_) |
return; |
- if (this.state == SpeechState.HOTWORD_RECOGNIZING) |
+ if (this.state == SpeechState.HOTWORD_RECOGNIZING) { |
+ console.warn('Already in recognition state...'); |
return; |
+ } |
this.pluginManager_.startRecognizer(); |
this.audioManager_.start(); |
@@ -203,30 +204,6 @@ cr.define('speech', function() { |
}; |
/** |
- * Stops the hotword recognizer. |
- */ |
- SpeechManager.prototype.stopHotwordRecognition = function() { |
- if (!this.pluginManager_) |
- return; |
- |
- if (this.state != SpeechState.HOTWORD_RECOGNIZING) |
- return; |
- |
- this.pluginManager_.stopRecognizer(); |
- this.audioManager_.stop(); |
- this.setState_(SpeechState.READY); |
- }; |
- |
- /** |
- * Called when the app-list bubble is shown. |
- */ |
- SpeechManager.prototype.onShown = function() { |
- this.shown_ = true; |
- if (this.state == SpeechState.READY) |
- this.startHotwordRecognition(); |
- }; |
- |
- /** |
* Called when the app-list bubble is hidden. |
*/ |
SpeechManager.prototype.onHidden = function() { |