mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Support configuration of Chrome policy management (fixes #3581)
Disable Chrome policy management by default. Add CefSettings.chrome_policy_id which, when configured, enables Chrome policy management. See https://support.google.com/chrome/a/answer/9037717 for background. To test: - Start with a machine where Google Chrome is managed. - Run `cefclient --enable-chrome-runtime --url=chrome://policy/` There should be no configured policies. - Run `cefclient --enable-chrome-runtime --url=chrome://policy/ --enable-chrome-policy` Configured Platform properties should match Google Chrome. - Run `cefclient --enable-chrome-runtime --url=chrome://policy/ --enable-chrome-policy --enable-chrome-browser-cloud-management` Configured Platform and Cloud properties should match Google Chrome.
This commit is contained in:
@@ -214,6 +214,23 @@ void MainContextImpl::PopulateSettings(CefSettings* settings) {
|
||||
CefString(&settings->accept_language_list) =
|
||||
command_line_->GetSwitchValue("lang");
|
||||
}
|
||||
|
||||
if (command_line_->HasSwitch("enable-chrome-policy")) {
|
||||
// Enable Chrome policy management via Platform and OS-user policies.
|
||||
// Use the same configuration ID as Google Chrome for testing purposes.
|
||||
// If Google Chrome is managed on this machine we'll show the same
|
||||
// configured policies in chrome://policy/.
|
||||
CefString(&settings->chrome_policy_id) =
|
||||
#if defined(OS_WIN)
|
||||
"SOFTWARE\\Policies\\Google\\Chrome";
|
||||
#elif defined(OS_MAC)
|
||||
"com.google.Chrome";
|
||||
#elif defined(OS_LINUX)
|
||||
"/etc/opt/chrome/policies";
|
||||
#else
|
||||
"";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void MainContextImpl::PopulateBrowserSettings(CefBrowserSettings* settings) {
|
||||
|
Reference in New Issue
Block a user