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

Side by Side Diff: chrome/browser/resources/app_list/speech_manager.js

Issue 215573002: Fixes hotword nacl handler to support the new behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/app_list/plugin_manager.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /** 5 /**
6 * @fileoverview The class to Manage both offline / online speech recognition. 6 * @fileoverview The class to Manage both offline / online speech recognition.
7 */ 7 */
8 8
9 <include src="plugin_manager.js"/> 9 <include src="plugin_manager.js"/>
10 <include src="audio_manager.js"/> 10 <include src="audio_manager.js"/>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 */ 75 */
76 SpeechManager.prototype.onHotwordRecognizerReady_ = function(pluginManager) { 76 SpeechManager.prototype.onHotwordRecognizerReady_ = function(pluginManager) {
77 this.pluginManager_ = pluginManager; 77 this.pluginManager_ = pluginManager;
78 this.audioManager_.addEventListener( 78 this.audioManager_.addEventListener(
79 'audio', pluginManager.sendAudioData.bind(pluginManager)); 79 'audio', pluginManager.sendAudioData.bind(pluginManager));
80 if (this.shown_) { 80 if (this.shown_) {
81 this.pluginManager_.startRecognizer(); 81 this.pluginManager_.startRecognizer();
82 this.audioManager_.start(); 82 this.audioManager_.start();
83 this.setState_(SpeechState.HOTWORD_RECOGNIZING); 83 this.setState_(SpeechState.HOTWORD_RECOGNIZING);
84 } else { 84 } else {
85 this.pluginManager_.stopRecognizer();
85 this.setState_(SpeechState.READY); 86 this.setState_(SpeechState.READY);
86 } 87 }
87 chrome.send('setHotwordRecognizerState', [true]); 88 chrome.send('setHotwordRecognizerState', [true]);
88 }; 89 };
89 90
90 /** 91 /**
91 * Called when the hotword is recognized. 92 * Called when the hotword is recognized.
92 * 93 *
93 * @private 94 * @private
94 */ 95 */
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 if (this.audioManager_.state == speech.AudioState.STOPPED) 259 if (this.audioManager_.state == speech.AudioState.STOPPED)
259 this.audioManager_.start(); 260 this.audioManager_.start();
260 this.speechRecognitionManager_.start(); 261 this.speechRecognitionManager_.start();
261 } 262 }
262 }; 263 };
263 264
264 return { 265 return {
265 SpeechManager: SpeechManager 266 SpeechManager: SpeechManager
266 }; 267 };
267 }); 268 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/app_list/plugin_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698