chrome: Support configuration of user agent and locale (see issue #2969)

This change adds support for CefSettings and command-line configuration of
user_agent, user_agent_product (formerly product_version) and locale.
This commit is contained in:
Marshall Greenblatt
2021-04-27 12:39:09 -04:00
parent 328de502ac
commit c03a6f4386
10 changed files with 53 additions and 18 deletions

View File

@@ -150,9 +150,10 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
if (settings_->user_agent.length > 0) {
command_line->AppendSwitchASCII(embedder_support::kUserAgent,
CefString(&settings_->user_agent));
} else if (settings_->product_version.length > 0) {
command_line->AppendSwitchASCII(switches::kProductVersion,
CefString(&settings_->product_version));
} else if (settings_->user_agent_product.length > 0) {
command_line->AppendSwitchASCII(
switches::kUserAgentProductAndVersion,
CefString(&settings_->user_agent_product));
}
if (settings_->locale.length > 0) {