chrome: Support configuration of accept language (see issue #2969)

This change adds support for CEF settings configuration of accept_language_list.
If specified, this value will take precedence over the "intl.accept_languages"
preference which is controlled by chrome://settings/languages.
This commit is contained in:
Marshall Greenblatt
2021-04-28 13:12:06 -04:00
parent c03a6f4386
commit 3ab91a45c9
7 changed files with 81 additions and 48 deletions

View File

@@ -202,6 +202,12 @@ void MainContextImpl::PopulateSettings(CefSettings* settings) {
if (browser_background_color_ != 0)
settings->background_color = browser_background_color_;
if (command_line_->HasSwitch("lang")) {
// Use the same locale for the Accept-Language HTTP request header.
CefString(&settings->accept_language_list) =
command_line_->GetSwitchValue("lang");
}
}
void MainContextImpl::PopulateBrowserSettings(CefBrowserSettings* settings) {