chrome: Set prefs for accept_language_list on Profile init (fixes #3579)

This commit is contained in:
Marshall Greenblatt
2023-10-05 16:35:02 -04:00
parent 946dde2e17
commit 5053a958e1
5 changed files with 29 additions and 17 deletions

View File

@@ -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();

View File

@@ -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;
}