Fix configuration of the User-Agent string during startup (issue #1275).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1896 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2014-10-27 23:12:21 +00:00
parent b7ad182732
commit b1026cc191
2 changed files with 5 additions and 1 deletions

View File

@ -686,8 +686,9 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kLocalesDirPath,
switches::kLogFile,
switches::kLogSeverity,
switches::kResourcesDirPath,
switches::kProductVersion,
switches::kResourcesDirPath,
switches::kUserAgent,
};
command_line->CopySwitchesFrom(browser_cmd, kSwitchNames,
arraysize(kSwitchNames));

View File

@ -114,6 +114,9 @@ std::string CefContentClient::GetUserAgent() const {
std::string product_version;
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kUserAgent))
return command_line.GetSwitchValueASCII(switches::kUserAgent);
if (command_line.HasSwitch(switches::kProductVersion)) {
product_version =
command_line.GetSwitchValueASCII(switches::kProductVersion);