| Index: chrome/browser/speech/speech_recognition_request.cc
|
| diff --git a/chrome/browser/speech/speech_recognition_request.cc b/chrome/browser/speech/speech_recognition_request.cc
|
| index fe9010422b128093f5f9b49df5fa30cae3b834c4..e17f69b1f09c2275cb31f54d1e97647c00602773 100644
|
| --- a/chrome/browser/speech/speech_recognition_request.cc
|
| +++ b/chrome/browser/speech/speech_recognition_request.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/speech/speech_recognition_request.h"
|
|
|
| +#include "app/l10n_util.h"
|
| #include "base/json/json_reader.h"
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -117,14 +118,20 @@ SpeechRecognitionRequest::SpeechRecognitionRequest(
|
|
|
| SpeechRecognitionRequest::~SpeechRecognitionRequest() {}
|
|
|
| -bool SpeechRecognitionRequest::Send(const std::string& grammar,
|
| +bool SpeechRecognitionRequest::Send(const std::string& language,
|
| + const std::string& grammar,
|
| const std::string& content_type,
|
| const std::string& audio_data) {
|
| DCHECK(!url_fetcher_.get());
|
|
|
| std::vector<std::string> parts;
|
| - // TODO(leandro): Replace with the language tag given by WebKit.
|
| - parts.push_back("lang=en-us");
|
| + if (!language.empty()) {
|
| + parts.push_back("lang=" + EscapeQueryParamValue(language, true));
|
| + } else {
|
| + std::string app_locale = l10n_util::GetApplicationLocale("");
|
| + parts.push_back("lang=" + EscapeQueryParamValue(app_locale, true));
|
| + }
|
| +
|
| if (!grammar.empty())
|
| parts.push_back("grammar=" + EscapeQueryParamValue(grammar, true));
|
| GURL url(std::string(kDefaultSpeechRecognitionUrl) + JoinString(parts, '&'));
|
|
|