Enable specifying custom command line switches

This commit is contained in:
Cheng Zhao 2016-05-29 10:34:53 +09:00
parent f693b042b5
commit dd804d7432

View file

@ -150,6 +150,16 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
command_line->AppendSwitch(switches::kScrollBounce); command_line->AppendSwitch(switches::kScrollBounce);
#endif #endif
// Custom command line switches.
const base::ListValue* args;
if (web_preferences.GetList("commandLineSwitches", &args)) {
for (size_t i = 0; i < args->GetSize(); ++i) {
std::string arg;
if (args->GetString(i, &arg) && !arg.empty())
command_line->AppendSwitch(arg);
}
}
// Enable blink features. // Enable blink features.
std::string blink_features; std::string blink_features;
if (web_preferences.GetString(options::kBlinkFeatures, &blink_features)) if (web_preferences.GetString(options::kBlinkFeatures, &blink_features))