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

Side by Side Diff: content/browser/speech/speech_recognition_dispatcher_host.cc

Issue 10629003: Adding support for the SpeechRecognition.maxAlternatives JS API parameter (Speech CL2.5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small nits Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/speech/speech_recognition_dispatcher_host.h" 5 #include "content/browser/speech/speech_recognition_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/common/speech_recognition_messages.h" 10 #include "content/common/speech_recognition_messages.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 context.context_name = params.origin_url; 76 context.context_name = params.origin_url;
77 context.render_process_id = render_process_id_; 77 context.render_process_id = render_process_id_;
78 context.render_view_id = params.render_view_id; 78 context.render_view_id = params.render_view_id;
79 context.request_id = params.request_id; 79 context.request_id = params.request_id;
80 context.requested_by_page_element = false; 80 context.requested_by_page_element = false;
81 81
82 SpeechRecognitionSessionConfig config; 82 SpeechRecognitionSessionConfig config;
83 config.is_one_shot = params.is_one_shot; 83 config.is_one_shot = params.is_one_shot;
84 config.language = params.language; 84 config.language = params.language;
85 config.grammars = params.grammars; 85 config.grammars = params.grammars;
86 config.max_hypotheses = params.max_hypotheses;
86 config.origin_url = params.origin_url; 87 config.origin_url = params.origin_url;
87 config.initial_context = context; 88 config.initial_context = context;
88 config.url_request_context_getter = context_getter_.get(); 89 config.url_request_context_getter = context_getter_.get();
89 if (recognition_preferences_) { 90 if (recognition_preferences_) {
90 config.filter_profanities = recognition_preferences_->FilterProfanities(); 91 config.filter_profanities = recognition_preferences_->FilterProfanities();
91 } else { 92 } else {
92 config.filter_profanities = false; 93 config.filter_profanities = false;
93 } 94 }
94 config.event_listener = this; 95 config.event_listener = this;
95 96
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 error)); 185 error));
185 } 186 }
186 187
187 // The events below are currently not used by speech JS APIs implementation. 188 // The events below are currently not used by speech JS APIs implementation.
188 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange( 189 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(
189 int session_id, float volume, float noise_volume) {} 190 int session_id, float volume, float noise_volume) {}
190 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( 191 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete(
191 int session_id) {} 192 int session_id) {}
192 193
193 } // namespace speech 194 } // namespace speech
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698