summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech/speech_recognition_request.cc
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 08:32:02 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 08:32:02 +0000
commit562d634ceb3ec6ff5b9891456d6ea10e1a481213 (patch)
treedd64a86650f86be596239ed9792ca9f0f6f95312 /chrome/browser/speech/speech_recognition_request.cc
parentdd17f6bd436e1acd886dbf4f3856b00af64708de (diff)
downloadchromium_src-562d634ceb3ec6ff5b9891456d6ea10e1a481213.zip
chromium_src-562d634ceb3ec6ff5b9891456d6ea10e1a481213.tar.gz
chromium_src-562d634ceb3ec6ff5b9891456d6ea10e1a481213.tar.bz2
On windows, send audio hardware info with speech input requests if user consented.
This may help identify quality issues. BUG=61677 TEST=none Review URL: http://codereview.chromium.org/4724001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech/speech_recognition_request.cc')
-rw-r--r--chrome/browser/speech/speech_recognition_request.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/speech/speech_recognition_request.cc b/chrome/browser/speech/speech_recognition_request.cc
index b9ee40b..63a6c92 100644
--- a/chrome/browser/speech/speech_recognition_request.cc
+++ b/chrome/browser/speech/speech_recognition_request.cc
@@ -9,7 +9,6 @@
#include "app/l10n_util.h"
#include "base/json/json_reader.h"
#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "net/base/escape.h"
@@ -20,7 +19,7 @@
namespace {
const char* const kDefaultSpeechRecognitionUrl =
- "http://www.google.com/speech-api/v1/recognize?client=chromium&";
+ "https://www.google.com/speech-api/v1/recognize?client=chromium&";
const char* const kHypothesesString = "hypotheses";
const char* const kUtteranceString = "utterance";
const char* const kConfidenceString = "confidence";
@@ -123,6 +122,7 @@ SpeechRecognitionRequest::~SpeechRecognitionRequest() {}
bool SpeechRecognitionRequest::Send(const std::string& language,
const std::string& grammar,
+ const std::string& hardware_info,
const std::string& content_type,
const std::string& audio_data) {
DCHECK(!url_fetcher_.get());
@@ -145,7 +145,10 @@ bool SpeechRecognitionRequest::Send(const std::string& language,
parts.push_back("lang=" + EscapeQueryParamValue(lang_param, true));
if (!grammar.empty())
- parts.push_back("grammar=" + EscapeQueryParamValue(grammar, true));
+ parts.push_back("lm=" + EscapeQueryParamValue(grammar, true));
+ if (!hardware_info.empty())
+ parts.push_back("xhw=" + EscapeQueryParamValue(hardware_info, true));
+
GURL url(std::string(kDefaultSpeechRecognitionUrl) + JoinString(parts, '&'));
url_fetcher_.reset(URLFetcher::Create(url_fetcher_id_for_tests,