From 80128453c31ccb1419df2d9b61c9062501595b08 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 18 Feb 2015 18:10:44 +0000 Subject: [PATCH] Support configuration of the "Accept-Language" HTTP header globally or on a per-browser basis using new CefSettings.accept_language_list and CefBrowserSettings.accept_language_list members (issue #318). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2034 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/url_request_context_getter_impl.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libcef/browser/url_request_context_getter_impl.cc b/libcef/browser/url_request_context_getter_impl.cc index 9c8603214..90984323c 100644 --- a/libcef/browser/url_request_context_getter_impl.cc +++ b/libcef/browser/url_request_context_getter_impl.cc @@ -145,14 +145,9 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() { new net::DefaultChannelIDStore(NULL), base::WorkerPool::GetTaskRunner(true)))); - std::string accept_language; - if (settings.accept_language_list.length > 0) { - accept_language = - net::HttpUtil::GenerateAcceptLanguageHeader( - CefString(&settings.accept_language_list)); - } else { - accept_language = "en-US,en"; - } + const std::string& accept_language = + settings.accept_language_list.length > 0 ? + CefString(&settings.accept_language_list): "en-US,en"; storage_->set_http_user_agent_settings( new CefHttpUserAgentSettings(accept_language));