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

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

Issue 6709059: Request for 5 speech recognition results instead of 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/speech_recognition_request.cc
diff --git a/content/browser/speech/speech_recognition_request.cc b/content/browser/speech/speech_recognition_request.cc
index d0869f3ad2c69afb505d9bca70ad06606198c68e..f80d0266b3e45d031d814b30f7bbae340a4fae5f 100644
--- a/content/browser/speech/speech_recognition_request.cc
+++ b/content/browser/speech/speech_recognition_request.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/json/json_reader.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/values.h"
#include "chrome/common/net/url_request_context_getter.h"
@@ -24,6 +25,10 @@ const char* const kHypothesesString = "hypotheses";
const char* const kUtteranceString = "utterance";
const char* const kConfidenceString = "confidence";
+// TODO(satish): Remove this hardcoded value once the page is allowed to
+// set this via an attribute.
+const int kMaxResults = 5;
+
bool ParseServerResponse(const std::string& response_body,
speech_input::SpeechInputResultArray* result) {
if (response_body.empty()) {
@@ -145,9 +150,7 @@ void SpeechRecognitionRequest::Start(const std::string& language,
parts.push_back("lm=" + EscapeQueryParamValue(grammar, true));
if (!hardware_info.empty())
parts.push_back("xhw=" + EscapeQueryParamValue(hardware_info, true));
- // TODO(satish): Remove this hardcoded value once the page is allowed to
- // set this via an attribute.
- parts.push_back("maxresults=3");
+ parts.push_back("maxresults=" + base::IntToString(kMaxResults));
GURL url(std::string(kDefaultSpeechRecognitionUrl) + JoinString(parts, '&'));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698