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 575dd5fda6dc0b01700776376f615b9e2ae89166..1cc92950a7bf476e81edb035e8fc25cc1266c82b 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" |
@@ -174,7 +175,11 @@ void GoogleOneShotRemoteEngine::StartRecognition() { |
// TODO(pauljensen): GoogleOneShotRemoteEngine should be constructed with |
no longer working on chromium
2013/12/30 12:35:15
remove this TODO if your CL has addressed it.
Lei Zhang
2014/01/08 22:44:25
nay
|
// a reference to the HttpUserAgentSettings rather than accessing the |
// accept language through the URLRequestContext. |
- 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); |
no longer working on chromium
2013/12/30 12:35:15
move these two lines into the if case, and also mo
no longer working on chromium
2013/12/30 12:35:15
how about checking if (separator != std::string::n
Lei Zhang
2014/01/08 22:44:25
Done.
Lei Zhang
2014/01/08 22:44:25
I see this deviates from google_streaming_remote_e
|
} |