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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address mmenke's comments Created 8 years, 2 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
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 78153f5e1371dbc29328b18a54d92590db72a41a..ecd1eebbdbaf2ec7f4acef9bcd6d38d5b8290604 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"
@@ -144,13 +145,6 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
scoped_ptr<ProfileParams> params(new ProfileParams);
params->path = profile->GetPath();
- // Set up Accept-Language and Accept-Charset header values
- params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader(
- pref_service->GetString(prefs::kAcceptLanguages));
- std::string default_charset = pref_service->GetString(prefs::kDefaultCharset);
- params->accept_charset =
- net::HttpUtil::GenerateAcceptCharsetHeader(default_charset);
-
params->io_thread = g_browser_process->io_thread();
params->cookie_settings = CookieSettings::Factory::GetForProfile(profile);
@@ -202,6 +196,8 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
printing_enabled_.Init(prefs::kPrintingEnabled, pref_service, NULL);
printing_enabled_.MoveToThread(BrowserThread::IO);
#endif
+ chrome_http_user_agent_settings_.reset(
+ new ChromeHttpUserAgentSettings(pref_service));
// The URLBlacklistManager has to be created on the UI thread to register
// observers of |pref_service|, and it also has to clean up on
@@ -578,8 +574,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_ssl_config_service(profile_params_->ssl_config_service);
}
@@ -663,6 +659,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;

Powered by Google App Engine
This is Rietveld 408576698