From ee4c30d8c5fca53a990da472de17314de366341b Mon Sep 17 00:00:00 2001 From: "pauljensen@chromium.org" Date: Wed, 7 Nov 2012 15:08:43 +0000 Subject: Provide mutable members of UrlRequestContext via pure-virtual interface. Create a pure-virtual interface called HttpUserAgentSettings that provides access to the Accept-Language, Accept-Charset, and User-Agent HTTP headers. Each UrlRequestContext should have a HttpUserAgentSettings implementation attached via set_http_user_agent_settings(). BUG=146596 Review URL: https://chromiumcodereview.appspot.com/10918279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166425 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/speech/google_one_shot_remote_engine.cc | 5 ++++- content/browser/speech/google_streaming_remote_engine.cc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'content/browser') diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc index d713dfd..73e621e 100644 --- a/content/browser/speech/google_one_shot_remote_engine.cc +++ b/content/browser/speech/google_one_shot_remote_engine.cc @@ -171,7 +171,10 @@ void GoogleOneShotRemoteEngine::StartRecognition() { net::URLRequestContext* request_context = url_context_->GetURLRequestContext(); DCHECK(request_context); - std::string accepted_language_list = request_context->accept_language(); + // TODO(pauljensen): GoogleOneShotRemoteEngine 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(",;"); lang_param = accepted_language_list.substr(0, separator); } diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc index 2f050bd..974118f 100644 --- a/content/browser/speech/google_streaming_remote_engine.cc +++ b/content/browser/speech/google_streaming_remote_engine.cc @@ -560,7 +560,10 @@ std::string GoogleStreamingRemoteEngine::GetAcceptedLanguages() const { net::URLRequestContext* request_context = url_context_->GetURLRequestContext(); DCHECK(request_context); - std::string accepted_language_list = request_context->accept_language(); + // 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); -- cgit v1.1