Skip to content

Commit 4902869

Browse files
vfst-marcomagreenblatt
authored andcommitted
Add CefSettings.chrome_policy_id
1 parent 1c58cbd commit 4902869

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

java/org/cef/CefSettings.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,21 @@ public ColorType clone() {
219219
*/
220220
public int remote_debugging_port = 0;
221221

222+
/**
223+
* Specify an ID to enable Chrome policy management via Platform and OS-user
224+
* policies. On Windows, this is a registry key like
225+
* "SOFTWARE\\Policies\\Google\\Chrome". On MacOS, this is a bundle ID like
226+
* "com.google.Chrome". On Linux, this is an absolute directory path like
227+
* "/etc/opt/chrome/policies". Only supported with Chrome style. See
228+
* https://support.google.com/chrome/a/answer/9037717 for details.
229+
*
230+
* Chrome Browser Cloud Management integration, when enabled via the
231+
* "enable-chrome-browser-cloud-management" command-line flag, will also use
232+
* the specified ID. See https://support.google.com/chrome/a/answer/9116814
233+
* for details.
234+
*/
235+
public String chrome_policy_id;
236+
222237
/**
223238
* The number of stack trace frames to capture for uncaught exceptions.
224239
* Specify a positive value to enable the CefV8ContextHandler::
@@ -270,6 +285,7 @@ public CefSettings clone() {
270285
tmp.resources_dir_path = resources_dir_path;
271286
tmp.locales_dir_path = locales_dir_path;
272287
tmp.remote_debugging_port = remote_debugging_port;
288+
tmp.chrome_policy_id = chrome_policy_id;
273289
tmp.uncaught_exception_stack_size = uncaught_exception_stack_size;
274290
if (background_color != null) tmp.background_color = background_color.clone();
275291
tmp.cookieable_schemes_list = cookieable_schemes_list;

native/context.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ CefSettings GetJNISettings(JNIEnv* env, jobject obj) {
109109
}
110110
GetJNIFieldInt(env, cls, obj, "remote_debugging_port",
111111
&settings.remote_debugging_port);
112+
if (GetJNIFieldString(env, cls, obj, "chrome_policy_id", &tmp) &&
113+
!tmp.empty()) {
114+
CefString(&settings.chrome_policy_id) = tmp;
115+
tmp.clear();
116+
}
112117
GetJNIFieldInt(env, cls, obj, "uncaught_exception_stack_size",
113118
&settings.uncaught_exception_stack_size);
114119
jobject obj_col = nullptr;

0 commit comments

Comments
 (0)