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

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

Issue 55433002: Propagates the search result of start page to the app-list search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_view_delegate.h » ('j') | 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 this.setState_(SpeechState.HOTWORD_RECOGNIZING); 80 this.setState_(SpeechState.HOTWORD_RECOGNIZING);
81 }; 81 };
82 82
83 /** 83 /**
84 * Called when the speech recognition has happened. 84 * Called when the speech recognition has happened.
85 * 85 *
86 * @param {string} result The speech recognition result. 86 * @param {string} result The speech recognition result.
87 * @param {boolean} isFinal Whether the result is final or not. 87 * @param {boolean} isFinal Whether the result is final or not.
88 */ 88 */
89 SpeechManager.prototype.onSpeechRecognized = function(result, isFinal) { 89 SpeechManager.prototype.onSpeechRecognized = function(result, isFinal) {
90 // TODO(mukai): updates the UI, make requests, and/or sends the result
91 // to the web_ui handler.
92 console.log('speech result: ' + result + ' ' + 90 console.log('speech result: ' + result + ' ' +
93 (isFinal ? 'final' : 'interim')); 91 (isFinal ? 'final' : 'interim'));
92 if (isFinal) {
93 chrome.send('search', [result]);
94 this.speechRecognitionManager_.stop();
95 }
94 }; 96 };
95 97
96 /** 98 /**
97 * Called when the speech recognition has started. 99 * Called when the speech recognition has started.
98 */ 100 */
99 SpeechManager.prototype.onSpeechRecognitionStarted = function() { 101 SpeechManager.prototype.onSpeechRecognitionStarted = function() {
100 this.setState_(SpeechState.RECOGNIZING); 102 this.setState_(SpeechState.RECOGNIZING);
101 }; 103 };
102 104
103 /** 105 /**
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 145
144 this.audioManager_.stop(); 146 this.audioManager_.stop();
145 this.speechRecognitionManager_.stop(); 147 this.speechRecognitionManager_.stop();
146 this.setState_(SpeechState.READY); 148 this.setState_(SpeechState.READY);
147 }; 149 };
148 150
149 return { 151 return {
150 SpeechManager: SpeechManager 152 SpeechManager: SpeechManager
151 }; 153 };
152 }); 154 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698