Chromium Code Reviews| 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 a421e79c2283642a801f00bf4d0750baf21f3ac3..3bf84b60d634c5206b1f6d721b5b46cd94fbc823 100644 |
| --- a/content/browser/speech/google_one_shot_remote_engine.cc |
| +++ b/content/browser/speech/google_one_shot_remote_engine.cc |
| @@ -16,6 +16,7 @@ |
| #include "google_apis/google_api_keys.h" |
| #include "net/base/escape.h" |
| #include "net/base/load_flags.h" |
| +#include "net/url_request/http_user_agent_settings.h" |
| #include "net/url_request/url_fetcher.h" |
| #include "net/url_request/url_request_context.h" |
| #include "net/url_request/url_request_context_getter.h" |
| @@ -171,10 +172,11 @@ void GoogleOneShotRemoteEngine::StartRecognition() { |
| net::URLRequestContext* request_context = |
| url_context_->GetURLRequestContext(); |
| DCHECK(request_context); |
| - // TODO(pauljensen): GoogleOneShotRemoteEngine should be constructed with |
| - // a reference to the HttpUserAgentSettings rather than accessing the |
| - // accept language through the URLRequestContext. |
|
pauljensen
2013/12/02 15:24:42
This comment should not be removed as the TODO has
Lei Zhang
2013/12/11 03:32:24
Done.
|
| - std::string accepted_language_list = request_context->GetAcceptLanguage(); |
| + std::string accepted_language_list; |
| + if (request_context->http_user_agent_settings()) { |
| + accepted_language_list = |
| + request_context->http_user_agent_settings()->GetAcceptLanguage(); |
| + } |
| size_t separator = accepted_language_list.find_first_of(",;"); |
| lang_param = accepted_language_list.substr(0, separator); |
| } |