mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -695,9 +695,9 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
|
||||
switches::kLocalesDirPath,
|
||||
switches::kLogFile,
|
||||
switches::kLogSeverity,
|
||||
switches::kProductVersion,
|
||||
switches::kResourcesDirPath,
|
||||
embedder_support::kUserAgent,
|
||||
switches::kUserAgentProductAndVersion,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||
base::size(kSwitchNames));
|
||||
|
@@ -91,6 +91,16 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
|
||||
|
||||
const base::CommandLine* browser_cmd = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
{
|
||||
// Propagate the following switches to all command lines (along with any
|
||||
// associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
switches::kUserAgentProductAndVersion,
|
||||
};
|
||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||
base::size(kSwitchNames));
|
||||
}
|
||||
|
||||
const std::string& process_type =
|
||||
command_line->GetSwitchValueASCII(switches::kProcessType);
|
||||
if (process_type == switches::kRendererProcess) {
|
||||
|
Reference in New Issue
Block a user