mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Set prefs for accept_language_list on Profile init (fixes #3579)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "libcef/browser/chrome/chrome_browser_context.h"
|
||||
|
||||
#include "libcef/browser/prefs/browser_prefs.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
@@ -167,6 +168,8 @@ void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status,
|
||||
: SessionStartupPref::kPrefValueNewTab);
|
||||
}
|
||||
|
||||
browser_prefs::SetInitialProfilePrefs(profile_);
|
||||
|
||||
if (!init_callbacks_.empty()) {
|
||||
for (auto& callback : init_callbacks_) {
|
||||
std::move(callback).Run();
|
||||
|
||||
@@ -411,17 +411,6 @@ bool ChromeContentBrowserClientCef::ConfigureNetworkContextParams(
|
||||
cef_context ? cef_context->GetCookieableSchemes()
|
||||
: CefBrowserContext::GetGlobalCookieableSchemes();
|
||||
|
||||
// Prefer the CEF settings configuration, if specified, instead of the
|
||||
// kAcceptLanguages preference which is controlled by the
|
||||
// chrome://settings/languages configuration.
|
||||
const std::string& accept_language_list =
|
||||
browser_prefs::GetAcceptLanguageList(cef_context, /*browser=*/nullptr,
|
||||
/*expand=*/true);
|
||||
if (!accept_language_list.empty() &&
|
||||
accept_language_list != network_context_params->accept_language) {
|
||||
network_context_params->accept_language = accept_language_list;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user