summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/url_request/url_request_context.h5
-rw-r--r--net/url_request/url_request_http_job.cc4
2 files changed, 9 insertions, 0 deletions
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index 0f7fd51..2d2d646 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -97,8 +97,13 @@ class URLRequestContext
// Gets the value of 'Accept-Charset' header field.
const std::string& accept_charset() const { return accept_charset_; }
+#ifdef ANDROID
+ // Gets the value of 'Accept-Language' header field.
+ virtual const std::string& GetAcceptLanguage() const { return accept_language_; }
+#else
// Gets the value of 'Accept-Language' header field.
const std::string& accept_language() const { return accept_language_; }
+#endif
// Gets the UA string to use for the given URL. Pass an invalid URL (such as
// GURL()) to get the default UA string. Subclasses should override this
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 9a03213..6b938fa 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -704,7 +704,11 @@ void URLRequestHttpJob::AddExtraHeaders() {
net::HttpRequestHeaders::kAcceptLanguage)) {
request_info_.extra_headers.SetHeader(
net::HttpRequestHeaders::kAcceptLanguage,
+#ifdef ANDROID
+ context->GetAcceptLanguage());
+#else
context->accept_language());
+#endif
}
if (!request_info_.extra_headers.HasHeader(
net::HttpRequestHeaders::kAcceptCharset)) {