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

Unified Diff: content/browser/speech/speech_recognizer_impl.cc

Issue 10233010: Introducing new data types and IPC messages for scripted JS speech recognition APIs (Speech CL2.0) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed according to Hans review. Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/speech/speech_recognizer_impl.cc
diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc
index d8b765f8f9a945bc17303584341f02b5ee881bf7..e68990d165d0aeedfcc050f24309cf7845786992 100644
--- a/content/browser/speech/speech_recognizer_impl.cc
+++ b/content/browser/speech/speech_recognizer_impl.cc
@@ -14,6 +14,7 @@
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/browser/speech_recognizer.h"
#include "content/public/common/speech_recognition_error.h"
+#include "content/public/common/speech_recognition_grammar.h"
#include "content/public/common/speech_recognition_result.h"
#include "net/url_request/url_request_context_getter.h"
@@ -21,6 +22,7 @@ using content::BrowserMainLoop;
using content::BrowserThread;
using content::SpeechRecognitionError;
using content::SpeechRecognitionEventListener;
+using content::SpeechRecognitionGrammar;
using content::SpeechRecognitionResult;
using content::SpeechRecognizer;
using media::AudioInputController;
@@ -76,9 +78,10 @@ SpeechRecognizer* SpeechRecognizer::Create(
bool filter_profanities,
const std::string& hardware_info,
const std::string& origin_url) {
- speech::GoogleOneShotRemoteEngineConfig remote_engine_config;
+ speech::SpeechRecognitionEngineConfig remote_engine_config;
remote_engine_config.language = language;
- remote_engine_config.grammar = grammar;
+ if (!grammar.empty())
+ remote_engine_config.grammars.push_back(SpeechRecognitionGrammar(grammar));
remote_engine_config.audio_sample_rate =
speech::SpeechRecognizerImpl::kAudioSampleRate;
remote_engine_config.audio_num_bits_per_sample =

Powered by Google App Engine
This is Rietveld 408576698