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

Unified Diff: content/browser/speech/google_one_shot_remote_engine.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: Nits + rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/speech/google_streaming_remote_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/google_one_shot_remote_engine.cc
diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc
index ff8587b994976578f225842e5e2f0885f0cd8a6a..d8fad4625380d73cd85eee6ce4cffd09c40ad9f6 100644
--- a/content/browser/speech/google_one_shot_remote_engine.cc
+++ b/content/browser/speech/google_one_shot_remote_engine.cc
@@ -37,9 +37,6 @@ const int kWebServiceStatusNoSpeech = 4;
const int kWebServiceStatusNoMatch = 5;
const speech::AudioEncoder::Codec kDefaultAudioCodec =
speech::AudioEncoder::CODEC_FLAC;
-// TODO(satish): Remove this hardcoded value once the page is allowed to
-// set this via an attribute.
-const int kMaxResults = 6;
bool ParseServerResponse(const std::string& response_body,
SpeechRecognitionResult* result,
@@ -198,7 +195,7 @@ void GoogleOneShotRemoteEngine::StartRecognition() {
if (!config_.hardware_info.empty())
parts.push_back("xhw=" + net::EscapeQueryParamValue(config_.hardware_info,
true));
- parts.push_back("maxresults=" + base::IntToString(kMaxResults));
+ parts.push_back("maxresults=" + base::UintToString(config_.max_hypotheses));
parts.push_back(config_.filter_profanities ? "pfilter=2" : "pfilter=0");
GURL url(std::string(kDefaultSpeechRecognitionUrl) + JoinString(parts, '&'));
« no previous file with comments | « no previous file | content/browser/speech/google_streaming_remote_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698