Chromium Code Reviews| Index: net/url_request/url_request_context.cc |
| diff --git a/net/url_request/url_request_context.cc b/net/url_request/url_request_context.cc |
| index b9ee75f329d5c26bdccc9d181aab656d0b9f2b07..67515fb3a374d025bd3aac56b57517803eb1b045 100644 |
| --- a/net/url_request/url_request_context.cc |
| +++ b/net/url_request/url_request_context.cc |
| @@ -12,6 +12,7 @@ |
| #include "net/cookies/cookie_store.h" |
| #include "net/ftp/ftp_transaction_factory.h" |
| #include "net/http/http_transaction_factory.h" |
| +#include "net/url_request/http_user_agent_settings.h" |
| #include "net/url_request/url_request.h" |
| namespace net { |
| @@ -34,6 +35,7 @@ URLRequestContext::URLRequestContext() |
| ftp_transaction_factory_(NULL), |
| job_factory_(NULL), |
| throttler_manager_(NULL), |
| + http_user_agent_settings_(NULL), |
| url_requests_(new std::set<const URLRequest*>) { |
| } |
| @@ -56,8 +58,7 @@ void URLRequestContext::CopyFrom(const URLRequestContext* other) { |
| set_cookie_store(other->cookie_store_); |
| set_transport_security_state(other->transport_security_state_); |
| // FTPAuthCache is unique per context. |
| - set_accept_language(other->accept_language_); |
| - set_accept_charset(other->accept_charset_); |
| + set_http_user_agent_settings(other->http_user_agent_settings_); |
|
mmenke
2012/10/05 20:08:51
nit: Move below set_throttler_manager, so they're
|
| set_referrer_charset(other->referrer_charset_); |
| set_http_transaction_factory(other->http_transaction_factory_); |
| set_ftp_transaction_factory(other->ftp_transaction_factory_); |
| @@ -85,8 +86,19 @@ void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
| cookie_store_ = cookie_store; |
| } |
| -const std::string& URLRequestContext::GetUserAgent(const GURL& url) const { |
| - return EmptyString(); |
| +std::string URLRequestContext::GetAcceptCharset() const { |
| + return http_user_agent_settings_ ? |
| + http_user_agent_settings_->GetAcceptCharset() : EmptyString(); |
| +} |
| + |
| +std::string URLRequestContext::GetAcceptLanguage() const { |
| + return http_user_agent_settings_ ? |
| + http_user_agent_settings_->GetAcceptLanguage() : EmptyString(); |
| +} |
| + |
| +std::string URLRequestContext::GetUserAgent(const GURL& url) const { |
| + return http_user_agent_settings_ ? |
| + http_user_agent_settings_->GetUserAgent(url) : EmptyString(); |
| } |
| void URLRequestContext::AssertNoURLRequests() const { |