Chromium Code Reviews| Index: chrome/browser/profiles/profile_io_data.cc |
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc |
| index 1da278c25b04d705366dd3cf51128aa41062ffbe..d75bb810055dd4425a3e1656a03a059e354942c0 100644 |
| --- a/chrome/browser/profiles/profile_io_data.cc |
| +++ b/chrome/browser/profiles/profile_io_data.cc |
| @@ -31,6 +31,7 @@ |
| #include "chrome/browser/io_thread.h" |
| #include "chrome/browser/net/chrome_cookie_notification_details.h" |
| #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
| +#include "chrome/browser/net/chrome_http_user_agent_settings.h" |
| #include "chrome/browser/net/chrome_net_log.h" |
| #include "chrome/browser/net/chrome_network_delegate.h" |
| #include "chrome/browser/net/http_server_properties_manager.h" |
| @@ -145,11 +146,14 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
| params->path = profile->GetPath(); |
| // Set up Accept-Language and Accept-Charset header values |
| - params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( |
| + std::string accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( |
|
willchan no longer on Chromium
2012/10/24 03:40:10
This |accept_language| useless now?
erikwright (departed)
2012/10/24 13:14:33
Not required anymore, right?
|
| pref_service->GetString(prefs::kAcceptLanguages)); |
| std::string default_charset = pref_service->GetString(prefs::kDefaultCharset); |
| - params->accept_charset = |
| + std::string accept_charset = |
|
willchan no longer on Chromium
2012/10/24 03:40:10
Ditto with these two stack vars too.
erikwright (departed)
2012/10/24 13:14:33
ditto
|
| net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); |
| + params->chrome_http_user_agent_settings.reset( |
| + new ChromeHttpUserAgentSettings(pref_service)); |
| + |
| // At this point, we don't know the charset of the referring page |
| // where a url request originates from. This is used to get a suggested |
| @@ -583,6 +587,9 @@ void ProfileIOData::LazyInitialize() const { |
| profile_params_->resource_prefetch_predictor_observer_.release()); |
| } |
| + chrome_http_user_agent_settings_.reset( |
| + profile_params_->chrome_http_user_agent_settings.release()); |
| + |
| LazyInitializeInternal(profile_params_.get()); |
| profile_params_.reset(); |
| @@ -592,8 +599,8 @@ void ProfileIOData::LazyInitialize() const { |
| void ProfileIOData::ApplyProfileParamsToContext( |
| ChromeURLRequestContext* context) const { |
| context->set_is_incognito(is_incognito()); |
| - context->set_accept_language(profile_params_->accept_language); |
| - context->set_accept_charset(profile_params_->accept_charset); |
| + context->set_http_user_agent_settings( |
| + chrome_http_user_agent_settings_.get()); |
| context->set_referrer_charset(profile_params_->referrer_charset); |
|
erikwright (departed)
2012/10/24 13:14:33
presumably this should go away? I guess you just n
|
| context->set_ssl_config_service(profile_params_->ssl_config_service); |
| } |
| @@ -678,6 +685,8 @@ void ProfileIOData::ShutdownOnUIThread() { |
| if (url_blacklist_manager_.get()) |
| url_blacklist_manager_->ShutdownOnUIThread(); |
| #endif |
| + if (chrome_http_user_agent_settings_.get()) |
| + chrome_http_user_agent_settings_->CleanupOnUIThread(); |
| bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
| if (!posted) |
| delete this; |