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

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

Issue 83433008: Cleanup: Remove legacy accessors from URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments from xians Created 6 years, 11 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 | « content/browser/speech/google_one_shot_remote_engine.cc ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/google_streaming_remote_engine.cc
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc
index a8d034a9bffce38336a32c47d11a2a5461938b3c..89bfdcd13b98fbc134ff90a8fba6f739036bb3e4 100644
--- a/content/browser/speech/google_streaming_remote_engine.cc
+++ b/content/browser/speech/google_streaming_remote_engine.cc
@@ -21,6 +21,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"
@@ -563,10 +564,13 @@ std::string GoogleStreamingRemoteEngine::GetAcceptedLanguages() const {
// TODO(pauljensen): GoogleStreamingRemoteEngine should be constructed with
// a reference to the HttpUserAgentSettings rather than accessing the
// accept language through the URLRequestContext.
- std::string accepted_language_list = request_context->GetAcceptLanguage();
- size_t separator = accepted_language_list.find_first_of(",;");
- if (separator != std::string::npos)
- langs = accepted_language_list.substr(0, separator);
+ if (request_context->http_user_agent_settings()) {
+ std::string accepted_language_list =
+ request_context->http_user_agent_settings()->GetAcceptLanguage();
+ size_t separator = accepted_language_list.find_first_of(",;");
+ if (separator != std::string::npos)
+ langs = accepted_language_list.substr(0, separator);
+ }
}
if (langs.empty())
langs = "en-US";
« no previous file with comments | « content/browser/speech/google_one_shot_remote_engine.cc ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698