From dcb83d9cf6959ddc71ef826c5116dac6c9e5041a Mon Sep 17 00:00:00 2001
From: Harsha H
Date: Wed, 3 Feb 2021 13:51:37 +0530
Subject: [PATCH 01/50] adding pom and other assembly files
---
assemble-linux.xml | 22 +
assemble-mac-os.xml | 22 +
assemble-striped-linux.xml | 29 ++
assemble-windows.xml | 24 +
pom.xml | 911 +++++++++++++++++++++++++++++++++++++
strip_binaries.sh | 21 +
6 files changed, 1029 insertions(+)
create mode 100644 assemble-linux.xml
create mode 100644 assemble-mac-os.xml
create mode 100644 assemble-striped-linux.xml
create mode 100644 assemble-windows.xml
create mode 100644 pom.xml
create mode 100644 strip_binaries.sh
diff --git a/assemble-linux.xml b/assemble-linux.xml
new file mode 100644
index 00000000..b5793135
--- /dev/null
+++ b/assemble-linux.xml
@@ -0,0 +1,22 @@
+
+
+ java-cef
+
+ zip
+
+ false
+
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/lib/${distribution.folder}
+
+ *
+
+
+
+
diff --git a/assemble-mac-os.xml b/assemble-mac-os.xml
new file mode 100644
index 00000000..6175a63f
--- /dev/null
+++ b/assemble-mac-os.xml
@@ -0,0 +1,22 @@
+
+
+ java-cef
+
+ zip
+
+ false
+
+
+
+ ${basedir}/jcef_build/native/Release
+
+ **
+
+
+
+
diff --git a/assemble-striped-linux.xml b/assemble-striped-linux.xml
new file mode 100644
index 00000000..f170027a
--- /dev/null
+++ b/assemble-striped-linux.xml
@@ -0,0 +1,29 @@
+
+
+ java-cef
+
+ zip
+
+ false
+
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/lib/${distribution.folder}
+
+ *
+ strip/*
+
+
+ libcef.so
+ libEGL.so
+ libGLESv2.so
+ libjcef.so
+
+
+
+
diff --git a/assemble-windows.xml b/assemble-windows.xml
new file mode 100644
index 00000000..d54b5244
--- /dev/null
+++ b/assemble-windows.xml
@@ -0,0 +1,24 @@
+
+
+ java-cef
+
+ zip
+
+ false
+
+
+
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/lib/${distribution.folder}
+
+ *
+
+
+
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 00000000..c852842e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,911 @@
+
+
+ 4.0.0
+ com.enactor.chromium
+ java-cef
+ 1.0.0
+ Java Chromium Embedded Framework
+
+ 10
+ 10
+ https://dev.enactor.co.uk/artifactory/libs-release-local
+ www.enactor.co.uk
+ true
+
+
+
+ www.enactor.co.uk
+ www.enactor.co.uk-snapshots
+ https://dev.enactor.co.uk/artifactory/libs-snapshot-local
+
+
+ ${repository.id}
+ www.enactor.co.uk-releases
+ ${repository.url}
+
+
+
+
+
+ maven-antrun-plugin
+
+
+ generate-resources
+
+ run
+
+
+
+ ${java.home}
+
+
+
+
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+ 2.2.6
+
+
+ get-the-git-infos
+
+ revision
+
+ validate
+
+
+
+ ${project.basedir}/.git
+
+
+
+
+
+
+
+ generate-windows
+
+
+ windows
+
+
+
+ win64
+ windows-amd64
+
+
+
+
+ com.googlecode.cmake-maven-project
+ cmake-maven-plugin
+ 3.7.2-b1
+
+
+ cmake-generate-windows
+
+ generate
+
+
+ ${basedir}
+ ${basedir}/jcef_build
+ Visual Studio 15 2017 Win64
+ windows-x86_64
+
+ ${java.home}
+
+
+
+
+
+
+
+
+
+
+ cmake-compile-windows
+
+ compile
+
+
+ Release
+ ${basedir}/jcef_build
+ windows-x86_64
+
+ ${java.home}
+
+
+
+
+
+
+ maven-antrun-plugin
+
+
+ compile
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+ package
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ maven-install-plugin
+ 3.0.0-M1
+
+
+ install-jogl-all
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
+ com.enactor.chromium
+ jogl-all
+ ${project.version}
+ jar
+
+
+
+ install-jogl-all-natives
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
+ com.enactor.chromium
+ jogl-all-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ install-jcef
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ com.enactor.chromium
+ jcef
+ ${project.version}
+ jar
+
+
+
+ install-gluegen-rt
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
+ com.enactor.chromium
+ gluegen-rt
+ ${project.version}
+ jar
+
+
+
+ install-gluegen-rt-natives
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
+ com.enactor.chromium
+ gluegen-rt-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+
+
+ maven-assembly-plugin
+ 2.4
+
+
+ package
+
+ single
+
+
+
+
+ chromium-binaries-windows
+
+ assemble-windows.xml
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ ${skip.deploy}
+
+
+
+ deploy-jogl-all
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ jogl-all
+ ${project.version}
+ jar
+
+
+
+ deploy-jogl-all-natives
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ jogl-all-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ deploy-jcef
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ jcef
+ ${project.version}
+ jar
+
+
+
+ deploy-gluegen-rt
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ gluegen-rt
+ ${project.version}
+ jar
+
+
+
+ deploy-gluegen-rt-natives
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ gluegen-rt-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ deploy-native-binaries
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/target/chromium-binaries-windows.zip
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ windows-binaries
+ ${project.version}
+ zip
+
+
+
+
+
+
+
+
+ generate-linux
+
+
+ unix
+ Linux
+
+
+
+ false
+ linux64
+ linux-amd64
+
+
+
+
+ com.googlecode.cmake-maven-project
+ cmake-maven-plugin
+ 3.7.2-b1
+
+
+ cmake-generate-linux
+
+ generate
+
+
+ ${basedir}
+ ${basedir}/jcef_build
+ Ninja
+ linux-x86_64
+
+ ${java.home}
+
+
+
+
+
+
+
+
+
+
+ cmake-compile-linux
+
+ compile
+
+
+ Release
+ ${basedir}/jcef_build
+ linux-x86_64
+
+ ${java.home}
+
+
+
+
+
+
+ maven-antrun-plugin
+
+
+ compile
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+ package
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+ strip-binary
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+ maven-install-plugin
+ 3.0.0-M1
+
+
+ install-jogl-all
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
+ com.enactor.chromium
+ jogl-all
+ ${project.version}
+ jar
+
+
+
+ install-jogl-all-natives
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
+ com.enactor.chromium
+ jogl-all-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ install-jcef
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ com.enactor.chromium
+ jcef
+ ${project.version}
+ jar
+
+
+
+ install-gluegen-rt
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
+ com.enactor.chromium
+ gluegen-rt
+ ${project.version}
+ jar
+
+
+
+ install-gluegen-rt-natives
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
+ com.enactor.chromium
+ gluegen-rt-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+
+
+ maven-assembly-plugin
+ 2.4
+
+
+ assemble-linux-binaries
+ package
+
+ single
+
+
+ chromium-binaries-linux
+
+ assemble-linux.xml
+
+ false
+
+
+
+ assemble-linux-striped-binaries
+ package
+
+ single
+
+
+ chromium-binaries-linux-striped
+
+ assemble-striped-linux.xml
+
+ false
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ ${skip.deploy}
+
+
+
+ deploy-jogl-all
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ jogl-all
+ ${project.version}
+ jar
+
+
+
+ deploy-jogl-all-natives
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ jogl-all-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ deploy-jcef
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ jcef
+ ${project.version}
+ jar
+
+
+
+ deploy-gluegen-rt
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ gluegen-rt
+ ${project.version}
+ jar
+
+
+
+ deploy-gluegen-rt-natives
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ gluegen-rt-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ deploy-native-binaries
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/target/chromium-binaries-linux.zip
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ linux-binaries
+ ${project.version}
+ zip
+
+
+
+ deploy-striped-native-binaries
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/target/chromium-binaries-linux-striped.zip
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ linux-binaries
+ ${project.version}
+ zip
+
+
+
+
+
+
+
+
+
+ generate-mac
+
+
+ mac
+
+
+
+ false
+ macosx64
+ macos-amd64
+
+
+
+
+ com.googlecode.cmake-maven-project
+ cmake-maven-plugin
+ 3.7.2-b1
+
+
+ cmake-generate-mac
+
+ generate
+
+
+ ${basedir}
+ ${basedir}/jcef_build
+ Xcode
+ mac-x86_64
+
+
+
+
+
+
+
+
+
+
+
+ cmake-compile-mac
+
+ compile
+
+
+ Release
+ ${basedir}/jcef_build
+ mac-x86_64
+
+
+
+
+
+
+
+ maven-antrun-plugin
+
+
+ package
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+ maven-install-plugin
+ 3.0.0-M1
+
+
+ deploy-jcef
+ install
+
+ install-file
+
+
+ ${basedir}/jcef_build/native/Release/jcef.jar/
+ com.enactor.chromium
+ jcef
+ ${project.version}
+ jar
+
+
+
+ deploy-jcef-test
+ install
+
+ install-file
+
+
+ ${basedir}/jcef_build/native/Release/jcef-tests.jar/
+ com.enactor.chromium
+ jcef-tests
+ ${project.version}
+ jar
+
+
+
+
+
+
+ maven-assembly-plugin
+ 2.4
+
+
+ package
+
+ single
+
+
+
+
+ chromium-binaries-mac
+
+ assemble-mac-os.xml
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ true
+
+
+
+ deploy-native-binaries
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/target/chromium-binaries-mac.zip
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ mac-binaries
+ ${project.version}
+ zip
+
+
+
+
+
+
+
+
+
+
+ org.jogamp.gluegen
+ gluegen-rt-main
+ 2.3.2
+
+
+ org.jogamp.jogl
+ jogl-all-main
+ 2.3.2
+
+
+ org.apache.commons
+ commons-lang3
+ 3.8.1
+
+
+ org.apache.logging.log4j
+ log4j-api
+ 2.11.2
+
+
+ org.apache.logging.log4j
+ log4j-core
+ 2.11.2
+
+
+
diff --git a/strip_binaries.sh b/strip_binaries.sh
new file mode 100644
index 00000000..893e9a42
--- /dev/null
+++ b/strip_binaries.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
+# reserved. Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file.
+
+if [ -z "$1" ]; then
+ echo "ERROR: Please specify a binaries path"
+else
+
+mkdir $1/strip
+
+cp $1/libcef.so $1/strip/libcef.so
+cp $1/libEGL.so $1/strip/libEGL.so
+cp $1/libGLESv2.so $1/strip/libGLESv2.so
+cp $1/libjcef.so $1/strip/libjcef.so
+
+strip -s $1/strip/libcef.so
+strip -s $1/strip/libEGL.so
+strip -s $1/strip/libGLESv2.so
+strip -s $1/strip/libjcef.so
+fi
From bc6279fadf5ad92bf87b6a57c12b4c1a333470e8 Mon Sep 17 00:00:00 2001
From: Harsha H
Date: Wed, 3 Feb 2021 15:57:03 +0530
Subject: [PATCH 02/50] strip changes
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c852842e..22c8a24f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -713,7 +713,7 @@
${repository.id}${repository.url}com.enactor.chromium
- linux-binaries
+ linux-striped-binaries${project.version}zip
From 53f1fb459396c4b5d27967ca040411c173749fbc Mon Sep 17 00:00:00 2001
From: Harsha H
Date: Mon, 8 Feb 2021 10:24:00 +0530
Subject: [PATCH 03/50] package changed to com.enactor.core.chromium
---
pom.xml | 54 +++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/pom.xml b/pom.xml
index 22c8a24f..b8ab9b58 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
- com.enactor.chromium
+ com.enactor.core.chromiumjava-cef1.0.0Java Chromium Embedded Framework
@@ -182,7 +182,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all${project.version}jar
@@ -196,7 +196,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all-natives${project.version}${distribution.arch}
@@ -211,7 +211,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
- com.enactor.chromium
+ com.enactor.core.chromiumjcef${project.version}jar
@@ -225,7 +225,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt${project.version}jar
@@ -239,7 +239,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt-natives${project.version}${distribution.arch}
@@ -284,7 +284,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all${project.version}jar
@@ -300,7 +300,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all-natives${project.version}${distribution.arch}
@@ -317,7 +317,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumjcef${project.version}jar
@@ -333,7 +333,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt${project.version}jar
@@ -349,7 +349,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt-natives${project.version}${distribution.arch}
@@ -366,7 +366,7 @@
${basedir}/target/chromium-binaries-windows.zip${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumwindows-binaries${project.version}zip
@@ -496,7 +496,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all${project.version}jar
@@ -510,7 +510,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all-natives${project.version}${distribution.arch}
@@ -525,7 +525,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
- com.enactor.chromium
+ com.enactor.core.chromiumjcef${project.version}jar
@@ -539,7 +539,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt${project.version}jar
@@ -553,7 +553,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt-natives${project.version}${distribution.arch}
@@ -614,7 +614,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all${project.version}jar
@@ -630,7 +630,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumjogl-all-natives${project.version}${distribution.arch}
@@ -647,7 +647,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumjcef${project.version}jar
@@ -663,7 +663,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt${project.version}jar
@@ -679,7 +679,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumgluegen-rt-natives${project.version}${distribution.arch}
@@ -696,7 +696,7 @@
${basedir}/target/chromium-binaries-linux.zip${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumlinux-binaries${project.version}zip
@@ -712,7 +712,7 @@
${basedir}/target/chromium-binaries-linux-striped.zip${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiumlinux-striped-binaries${project.version}zip
@@ -810,7 +810,7 @@
${basedir}/jcef_build/native/Release/jcef.jar/
- com.enactor.chromium
+ com.enactor.core.chromiumjcef${project.version}jar
@@ -824,7 +824,7 @@
${basedir}/jcef_build/native/Release/jcef-tests.jar/
- com.enactor.chromium
+ com.enactor.core.chromiumjcef-tests${project.version}jar
@@ -869,7 +869,7 @@
${basedir}/target/chromium-binaries-mac.zip${repository.id}${repository.url}
- com.enactor.chromium
+ com.enactor.core.chromiummac-binaries${project.version}zip
From 2e465f09e34872336e5e0f08019036acc5b3cf27 Mon Sep 17 00:00:00 2001
From: Harsha H
Date: Mon, 8 Feb 2021 11:58:44 +0530
Subject: [PATCH 04/50] added dependencies to com.enactor.core
---
pom.xml | 54 +++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/pom.xml b/pom.xml
index b8ab9b58..17bee76f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
- com.enactor.core.chromium
+ com.enactor.corejava-cef1.0.0Java Chromium Embedded Framework
@@ -182,7 +182,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
- com.enactor.core.chromium
+ com.enactor.corejogl-all${project.version}jar
@@ -196,7 +196,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
- com.enactor.core.chromium
+ com.enactor.corejogl-all-natives${project.version}${distribution.arch}
@@ -211,7 +211,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
- com.enactor.core.chromium
+ com.enactor.corejcef${project.version}jar
@@ -225,7 +225,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt${project.version}jar
@@ -239,7 +239,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt-natives${project.version}${distribution.arch}
@@ -284,7 +284,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.corejogl-all${project.version}jar
@@ -300,7 +300,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.corejogl-all-natives${project.version}${distribution.arch}
@@ -317,7 +317,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.corejcef${project.version}jar
@@ -333,7 +333,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt${project.version}jar
@@ -349,7 +349,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt-natives${project.version}${distribution.arch}
@@ -366,7 +366,7 @@
${basedir}/target/chromium-binaries-windows.zip${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.chromiumwindows-binaries${project.version}zip
@@ -496,7 +496,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
- com.enactor.core.chromium
+ com.enactor.corejogl-all${project.version}jar
@@ -510,7 +510,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
- com.enactor.core.chromium
+ com.enactor.corejogl-all-natives${project.version}${distribution.arch}
@@ -525,7 +525,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
- com.enactor.core.chromium
+ com.enactor.corejcef${project.version}jar
@@ -539,7 +539,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt${project.version}jar
@@ -553,7 +553,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt-natives${project.version}${distribution.arch}
@@ -614,7 +614,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.corejogl-all${project.version}jar
@@ -630,7 +630,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.corejogl-all-natives${project.version}${distribution.arch}
@@ -647,7 +647,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.corejcef${project.version}jar
@@ -663,7 +663,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt${project.version}jar
@@ -679,7 +679,7 @@
${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.coregluegen-rt-natives${project.version}${distribution.arch}
@@ -696,7 +696,7 @@
${basedir}/target/chromium-binaries-linux.zip${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.chromiumlinux-binaries${project.version}zip
@@ -712,7 +712,7 @@
${basedir}/target/chromium-binaries-linux-striped.zip${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.chromiumlinux-striped-binaries${project.version}zip
@@ -810,7 +810,7 @@
${basedir}/jcef_build/native/Release/jcef.jar/
- com.enactor.core.chromium
+ com.enactor.corejcef${project.version}jar
@@ -824,7 +824,7 @@
${basedir}/jcef_build/native/Release/jcef-tests.jar/
- com.enactor.core.chromium
+ com.enactor.corejcef-tests${project.version}jar
@@ -869,7 +869,7 @@
${basedir}/target/chromium-binaries-mac.zip${repository.id}${repository.url}
- com.enactor.core.chromium
+ com.enactor.chromiummac-binaries${project.version}zip
From abb550ca682421d1ae6ddc287bcee36ee64834d9 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 16 Jun 2022 16:03:40 +0100
Subject: [PATCH 05/50] Fix POM issues, update cmake-maven-plugin version
---
.gitignore | 1 +
pom.xml | 51 +++++++++++++++++++++------------------------------
2 files changed, 22 insertions(+), 30 deletions(-)
diff --git a/.gitignore b/.gitignore
index e7bc7d07..dcaa1219 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,3 +55,4 @@ Thumbs.db
/tools/buildtools/linux64/clang-format
/tools/buildtools/mac/clang-format
/tools/buildtools/win/clang-format.exe
+/target/
diff --git a/pom.xml b/pom.xml
index 17bee76f..a5b75881 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,6 @@
pl.project13.mavengit-commit-id-plugin
- 2.2.6get-the-git-infos
@@ -62,18 +61,20 @@
-
+
+
+
+ com.googlecode.cmake-maven-project
+ cmake-maven-plugin
+ 3.22.1-b1
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+ 2.2.6
+
+
+
@@ -92,7 +93,6 @@
com.googlecode.cmake-maven-projectcmake-maven-plugin
- 3.7.2-b1cmake-generate-windows
@@ -172,7 +172,6 @@
maven-install-plugin
- 3.0.0-M1install-jogl-all
@@ -250,7 +249,6 @@
maven-assembly-plugin
- 2.4package
@@ -269,7 +267,7 @@
org.apache.maven.plugins
- maven-deploy-plugin
+ maven-deploy-plugin${skip.deploy}
@@ -395,7 +393,6 @@
com.googlecode.cmake-maven-projectcmake-maven-plugin
- 3.7.2-b1cmake-generate-linux
@@ -486,7 +483,6 @@
maven-install-plugin
- 3.0.0-M1install-jogl-all
@@ -564,7 +560,6 @@
maven-assembly-plugin
- 2.4assemble-linux-binaries
@@ -595,15 +590,14 @@
-
org.apache.maven.pluginsmaven-deploy-plugin
- ${skip.deploy}
+ ${skip.deploy}
-
+ deploy-jogl-alldeploy
@@ -741,7 +735,6 @@
com.googlecode.cmake-maven-projectcmake-maven-plugin
- 3.7.2-b1cmake-generate-mac
@@ -800,7 +793,6 @@
maven-install-plugin
- 3.0.0-M1deploy-jcef
@@ -835,7 +827,6 @@
maven-assembly-plugin
- 2.4package
@@ -853,12 +844,12 @@
- org.apache.maven.plugins
- maven-deploy-plugin
+ org.apache.maven.plugins
+ maven-deploy-plugin
- true
+ true
-
+ deploy-native-binariesdeploy
From dd15debcfdf7ac13f30261474e93198af33e1152 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 16 Jun 2022 16:13:57 +0100
Subject: [PATCH 06/50] Reverted to 3.7.2-b1 of CMake plugin as later versions
not JDK8-compatible.
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a5b75881..e39ba424 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
com.googlecode.cmake-maven-projectcmake-maven-plugin
- 3.22.1-b1
+ 3.7.2-b1pl.project13.maven
From 9e8b4fdec6373c7e877761ad5688c9c90d230c72 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 16 Jun 2022 16:45:59 +0100
Subject: [PATCH 07/50] Fix cmake.download property
---
pom.xml | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index e39ba424..c61b8d87 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,8 @@
windows
-
+
+ falsewin64windows-amd64
@@ -375,6 +376,7 @@
+
generate-linux
@@ -384,7 +386,7 @@
- false
+ falselinux64linux-amd64
@@ -713,7 +715,7 @@
-
+
@@ -726,7 +728,7 @@
- false
+ falsemacosx64macos-amd64
@@ -883,8 +885,7 @@
jogl-all-main2.3.2
-
- org.apache.commons
+ org.apache.commonscommons-lang33.8.1
From e254eacc7bff3287f49855d15c2565f20ee4b77f Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 16 Jun 2022 17:10:07 +0100
Subject: [PATCH 08/50] Try again to override plugin's cmake version
---
pom.xml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index c61b8d87..bcf3dd89 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,6 +13,7 @@
https://dev.enactor.co.uk/artifactory/libs-release-localwww.enactor.co.uktrue
+ false
@@ -67,6 +68,9 @@
com.googlecode.cmake-maven-projectcmake-maven-plugin3.7.2-b1
+
+ ${cmake.download}
+ pl.project13.maven
@@ -85,7 +89,6 @@
- falsewin64windows-amd64
@@ -386,7 +389,6 @@
- falselinux64linux-amd64
@@ -728,7 +730,6 @@
- falsemacosx64macos-amd64
From c26f5dbfdbfc4e723e4503dc71c50fdb432f6959 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 16 Jun 2022 17:12:23 +0100
Subject: [PATCH 09/50] Same again
---
pom.xml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index bcf3dd89..6d9cc237 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,6 @@
https://dev.enactor.co.uk/artifactory/libs-release-localwww.enactor.co.uktrue
- false
@@ -68,9 +67,6 @@
com.googlecode.cmake-maven-projectcmake-maven-plugin3.7.2-b1
-
- ${cmake.download}
- pl.project13.maven
From 2c8f49f38b26d07444a6816d5680b25a164ab666 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 16 Jun 2022 17:21:00 +0100
Subject: [PATCH 10/50] Think I have it now
---
pom.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pom.xml b/pom.xml
index 6d9cc237..c5db5d25 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,6 +13,8 @@
https://dev.enactor.co.uk/artifactory/libs-release-localwww.enactor.co.uktrue
+ false
+ ${cmake.download}
From 17646fff8b27576d46a4beedd3e4d69632f776d6 Mon Sep 17 00:00:00 2001
From: david
Date: Fri, 17 Jun 2022 12:13:34 +0100
Subject: [PATCH 11/50] Wrap OUT_PATH in quotes for rsync to try and fix build
in workspace with spaces
---
tools/compile.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/compile.sh b/tools/compile.sh
index 93bdeebe..9d8a0f45 100755
--- a/tools/compile.sh
+++ b/tools/compile.sh
@@ -18,7 +18,7 @@ else
javac -Xdiags:verbose -cp "$CLS_PATH" -d "$OUT_PATH" "${JAVA_PATH}"/tests/detailed/*.java "${JAVA_PATH}"/tests/junittests/*.java "${JAVA_PATH}"/tests/simple/*.java "${JAVA_PATH}"/org/cef/*.java "${JAVA_PATH}"/org/cef/browser/*.java "${JAVA_PATH}"/org/cef/callback/*.java "${JAVA_PATH}"/org/cef/handler/*.java "${JAVA_PATH}"/org/cef/misc/*.java "${JAVA_PATH}"/org/cef/network/*.java
# Copy MANIFEST.MF
- rsync -a "${JAVA_PATH}"/manifest/MANIFEST.MF $OUT_PATH/manifest/
+ rsync -a "${JAVA_PATH}"/manifest/MANIFEST.MF "$OUT_PATH/manifest/"
# Copy resource files.
cp -f "${JAVA_PATH}"/tests/detailed/handler/*.html "$OUT_PATH/tests/detailed/handler"
From 0abbdffcbb9acbf66e98caf7120e39507f104871 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 7 Jul 2022 16:26:32 +0100
Subject: [PATCH 12/50] Update to Visual Studio 2022
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c5db5d25..e17258dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,7 @@
${basedir}${basedir}/jcef_build
- Visual Studio 15 2017 Win64
+ Visual Studio 17 2022 Win64windows-x86_64${java.home}
From 5665c4d5392daa4ba4bf5fb87bb105f996e7dcc8 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 7 Jul 2022 16:34:14 +0100
Subject: [PATCH 13/50] Fix some build parameters
---
pom.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e17258dc..1f00f962 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,12 +104,13 @@
${basedir}${basedir}/jcef_build
- Visual Studio 17 2022 Win64
+ Visual Studio 17 2022windows-x86_64${java.home}
+
@@ -750,6 +751,7 @@
+
From e29af0b014b9cc45abebdd6bb94deea4fb0bbbc3 Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 7 Jul 2022 16:47:16 +0100
Subject: [PATCH 14/50] Remove arch
---
pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 1f00f962..45908d44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -751,7 +751,6 @@
-
From bb9bfeaa33b5286cfed5a15ca7355167bb239edd Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 7 Jul 2022 17:02:57 +0100
Subject: [PATCH 15/50] Configure ability to deploy snapshots via profile
---
pom.xml | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 45908d44..c07708b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,9 @@
1010
- https://dev.enactor.co.uk/artifactory/libs-release-local
+ https://dev.enactor.co.uk/artifactory/libs-release-local
+ https://dev.enactor.co.uk/artifactory/libs-snapshot-local
+ ${repository.url.release}www.enactor.co.uktruefalse
@@ -18,14 +20,14 @@
- www.enactor.co.uk
+ ${repository.id}www.enactor.co.uk-snapshots
- https://dev.enactor.co.uk/artifactory/libs-snapshot-local
+ ${repository.url.snapshot}${repository.id}www.enactor.co.uk-releases
- ${repository.url}
+ ${repository.url.release}
@@ -79,6 +81,12 @@
+
+ deploy-snapshot
+
+ ${repository.url.snapshot}
+
+ generate-windows
From 8a34a44afd4ebd5cc18097e2c21786bc5e374eed Mon Sep 17 00:00:00 2001
From: david
Date: Thu, 7 Jul 2022 17:26:07 +0100
Subject: [PATCH 16/50] Remove profile, it didn't work anyway
---
pom.xml | 6 ------
1 file changed, 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index c07708b6..5fa87471 100644
--- a/pom.xml
+++ b/pom.xml
@@ -81,12 +81,6 @@
-
- deploy-snapshot
-
- ${repository.url.snapshot}
-
- generate-windows
From 0110e7a5e0c3cbf8717e350d8760f662c800d535 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Mon, 10 Oct 2022 13:10:09 +0530
Subject: [PATCH 17/50] jcef chnages for macos build issue in latest xcode
versions
---
CMakeLists.txt | 15 ++++++
enactor/cef_mac.h | 130 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 145 insertions(+)
create mode 100644 enactor/cef_mac.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f7cc449..559cc976 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,6 +161,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(DownloadCEF)
DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_SOURCE_DIR}/third_party/cef")
+
# Add the CEF binary distribution's cmake/ directory to the module path.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
@@ -192,6 +193,20 @@ endif()
message(STATUS "Using Python: ${PYTHON_EXECUTABLE}")
+#
+# Enactor custom tweak.
+#
+
+# In order to fix the macos compilation issue with latest xcode
+# cef_mac.h line 63 has been commented. This modified file should be copied from the enactor folder
+
+if(OS_MACOSX)
+ message("MacOS copy cef_mac.h...")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_SOURCE_DIR}/enactor/cef_mac.h
+ ${CEF_ROOT}/include/internal/cef_mac.h)
+endif()
#
# Java configuration.
diff --git a/enactor/cef_mac.h b/enactor/cef_mac.h
new file mode 100644
index 00000000..9f936410
--- /dev/null
+++ b/enactor/cef_mac.h
@@ -0,0 +1,130 @@
+// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the name Chromium Embedded
+// Framework nor the names of its contributors may be used to endorse
+// or promote products derived from this software without specific prior
+// written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef CEF_INCLUDE_INTERNAL_CEF_MAC_H_
+#define CEF_INCLUDE_INTERNAL_CEF_MAC_H_
+#pragma once
+
+#include "include/internal/cef_types_mac.h"
+#include "include/internal/cef_types_wrappers.h"
+
+// Handle types.
+#define CefCursorHandle cef_cursor_handle_t
+#define CefEventHandle cef_event_handle_t
+#define CefWindowHandle cef_window_handle_t
+
+struct CefMainArgsTraits {
+ typedef cef_main_args_t struct_type;
+
+ static inline void init(struct_type* s) {}
+ static inline void clear(struct_type* s) {}
+
+ static inline void set(const struct_type* src,
+ struct_type* target,
+ bool copy) {
+ target->argc = src->argc;
+ target->argv = src->argv;
+ }
+};
+
+// Class representing CefExecuteProcess arguments.
+class CefMainArgs : public CefStructBase {
+ public:
+ typedef CefStructBase parent;
+
+ CefMainArgs() : parent() {}
+ explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {}
+// CefMainArgs& operator = (const CefMainArgs& r) { return *this; }
+ CefMainArgs(int argc, char** argv) : parent() {
+ this->argc = argc;
+ this->argv = argv;
+ }
+};
+
+struct CefWindowInfoTraits {
+ typedef cef_window_info_t struct_type;
+
+ static inline void init(struct_type* s) {}
+
+ static inline void clear(struct_type* s) {
+ cef_string_clear(&s->window_name);
+ }
+
+ static inline void set(const struct_type* src,
+ struct_type* target,
+ bool copy) {
+ cef_string_set(src->window_name.str, src->window_name.length,
+ &target->window_name, copy);
+ target->bounds = src->bounds;
+ target->hidden = src->hidden;
+ target->parent_view = src->parent_view;
+ target->windowless_rendering_enabled = src->windowless_rendering_enabled;
+ target->shared_texture_enabled = src->shared_texture_enabled;
+ target->external_begin_frame_enabled = src->external_begin_frame_enabled;
+ target->view = src->view;
+ }
+};
+
+// Class representing window information.
+class CefWindowInfo : public CefStructBase {
+ public:
+ typedef CefStructBase parent;
+
+ CefWindowInfo() : parent() {}
+ explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
+ explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
+
+ ///
+ // Create the browser as a child view.
+ ///
+ void SetAsChild(CefWindowHandle parent, const CefRect& bounds) {
+ parent_view = parent;
+ this->bounds = bounds;
+ hidden = false;
+ }
+
+ ///
+ // Create the browser using windowless (off-screen) rendering. No view
+ // will be created for the browser and all rendering will occur via the
+ // CefRenderHandler interface. The |parent| value will be used to identify
+ // monitor info and to act as the parent view for dialogs, context menus,
+ // etc. If |parent| is not provided then the main screen monitor will be used
+ // and some functionality that requires a parent view may not function
+ // correctly. In order to create windowless browsers the
+ // CefSettings.windowless_rendering_enabled value must be set to true.
+ // Transparent painting is enabled by default but can be disabled by setting
+ // CefBrowserSettings.background_color to an opaque value.
+ ///
+ void SetAsWindowless(CefWindowHandle parent) {
+ windowless_rendering_enabled = true;
+ parent_view = parent;
+ }
+};
+
+#endif // CEF_INCLUDE_INTERNAL_CEF_MAC_H_
From 79cfd80c3df81e3f3fd5427580a59ff0f0d0ae66 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Tue, 11 Oct 2022 16:37:25 +0530
Subject: [PATCH 18/50] Change the output directory to pick jcef.jar in macos
build
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 5fa87471..7f42432a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -643,7 +643,7 @@
deploy-file
- ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${basedir}/jcef_build/native/Release/jcef.jar${repository.id}${repository.url}com.enactor.core
From eed1c5cd3a8234f35da7368008f3be51946ceb5a Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 11:16:47 +0530
Subject: [PATCH 19/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7f42432a..deb1d508 100644
--- a/pom.xml
+++ b/pom.xml
@@ -317,7 +317,7 @@
deploy-file
- ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${basedir}/jcef_build/native/Release/jcef.jar${repository.id}${repository.url}com.enactor.core
@@ -525,7 +525,7 @@
install-file
- ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${basedir}/jcef_build/native/Release/jcef.jarcom.enactor.corejcef${project.version}
From 0df0007fc9072f13f7734b75b43ced417a1c27a1 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 12:29:46 +0530
Subject: [PATCH 20/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index deb1d508..e2f91695 100644
--- a/pom.xml
+++ b/pom.xml
@@ -214,7 +214,7 @@
install-file
- ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${basedir}/jcef_build/native/Release/jcef.jarcom.enactor.corejcef${project.version}
From f6c05a784705d995b85d154a67acc2c8c5c0d758 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 15:14:36 +0530
Subject: [PATCH 21/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 87 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index e2f91695..8dd315e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -214,7 +214,7 @@
install-file
- ${basedir}/jcef_build/native/Release/jcef.jar
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jarcom.enactor.corejcef${project.version}
@@ -317,7 +317,7 @@
deploy-file
- ${basedir}/jcef_build/native/Release/jcef.jar
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}${repository.url}com.enactor.core
@@ -525,7 +525,7 @@
install-file
- ${basedir}/jcef_build/native/Release/jcef.jar
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jarcom.enactor.corejcef${project.version}
@@ -643,7 +643,7 @@
deploy-file
- ${basedir}/jcef_build/native/Release/jcef.jar
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}${repository.url}com.enactor.core
@@ -851,9 +851,91 @@
org.apache.maven.pluginsmaven-deploy-plugin
- true
+ ${skip.deploy}
+
+ deploy-jogl-all
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.core
+ jogl-all
+ ${project.version}
+ jar
+
+
+
+ deploy-jogl-all-natives
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.core
+ jogl-all-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ deploy-jcef
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.core
+ jcef
+ ${project.version}
+ jar
+
+
+
+ deploy-gluegen-rt
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.core
+ gluegen-rt
+ ${project.version}
+ jar
+
+
+
+ deploy-gluegen-rt-natives
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.core
+ gluegen-rt-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+ deploy-native-binariesdeploy
From 2e5b743f47cee4c0a051ca83da9c45fd71e6a6fd Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 15:29:41 +0530
Subject: [PATCH 22/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/pom.xml b/pom.xml
index 8dd315e6..cd5ef3ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -826,6 +826,78 @@
jar
+
+ install-jogl-all
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
+ com.enactor.core
+ jogl-all
+ ${project.version}
+ jar
+
+
+
+ install-jogl-all-natives
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
+ com.enactor.core
+ jogl-all-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
+
+ install-jcef
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ com.enactor.core
+ jcef
+ ${project.version}
+ jar
+
+
+
+ install-gluegen-rt
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
+ com.enactor.core
+ gluegen-rt
+ ${project.version}
+ jar
+
+
+
+ install-gluegen-rt-natives
+ install
+
+ install-file
+
+
+ ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
+ com.enactor.core
+ gluegen-rt-natives
+ ${project.version}
+ ${distribution.arch}
+ jar
+
+
From 92ea5456b9f60a7d4d05c013a81812dd71d5dfc0 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 15:44:07 +0530
Subject: [PATCH 23/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 66 ---------------------------------------------------------
1 file changed, 66 deletions(-)
diff --git a/pom.xml b/pom.xml
index cd5ef3ae..eb90534b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -926,39 +926,6 @@
${skip.deploy}
-
- deploy-jogl-all
- deploy
-
- deploy-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
- ${repository.id}
- ${repository.url}
- com.enactor.core
- jogl-all
- ${project.version}
- jar
-
-
-
- deploy-jogl-all-natives
- deploy
-
- deploy-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
- ${repository.id}
- ${repository.url}
- com.enactor.core
- jogl-all-natives
- ${project.version}
- ${distribution.arch}
- jar
-
- deploy-jcefdeploy
@@ -975,39 +942,6 @@
jar
-
- deploy-gluegen-rt
- deploy
-
- deploy-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
- ${repository.id}
- ${repository.url}
- com.enactor.core
- gluegen-rt
- ${project.version}
- jar
-
-
-
- deploy-gluegen-rt-natives
- deploy
-
- deploy-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
- ${repository.id}
- ${repository.url}
- com.enactor.core
- gluegen-rt-natives
- ${project.version}
- ${distribution.arch}
- jar
-
- deploy-native-binariesdeploy
From be8127e9fbd69be1490b2714562f198dddc23762 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 15:45:31 +0530
Subject: [PATCH 24/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 73 ---------------------------------------------------------
1 file changed, 73 deletions(-)
diff --git a/pom.xml b/pom.xml
index eb90534b..20902c23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -826,81 +826,8 @@
jar
-
- install-jogl-all
- install
-
- install-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all.jar
- com.enactor.core
- jogl-all
- ${project.version}
- jar
-
-
-
- install-jogl-all-natives
- install
-
- install-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/jogl-all-natives-${distribution.arch}.jar
- com.enactor.core
- jogl-all-natives
- ${project.version}
- ${distribution.arch}
- jar
-
-
-
- install-jcef
- install
-
- install-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
- com.enactor.core
- jcef
- ${project.version}
- jar
-
-
-
- install-gluegen-rt
- install
-
- install-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt.jar
- com.enactor.core
- gluegen-rt
- ${project.version}
- jar
-
-
-
- install-gluegen-rt-natives
- install
-
- install-file
-
-
- ${basedir}/binary_distrib/${distribution.folder}/bin/gluegen-rt-natives-${distribution.arch}.jar
- com.enactor.core
- gluegen-rt-natives
- ${project.version}
- ${distribution.arch}
- jar
-
-
-
maven-assembly-plugin
From e351764b7b66926628837c5437a46867f192b652 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Wed, 12 Oct 2022 16:52:22 +0530
Subject: [PATCH 25/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 20902c23..bb9498e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -860,7 +860,7 @@
deploy-file
- ${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar
+ ${basedir}/jcef_build/native/Release/jcef.jar${repository.id}${repository.url}com.enactor.core
From 1c7662f50e418562a5c8b31a3d7149d39dd893b1 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Thu, 13 Oct 2022 12:05:09 +0530
Subject: [PATCH 26/50] Changing jcef.jar path to pick the macos build jar
---
pom.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index bb9498e8..9020a4ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -316,6 +316,7 @@
deploy-file
+ true${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}
@@ -638,10 +639,11 @@
deploy-jcef
- deploy
+ nonedeploy-file
+ true${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}
From 125369a8fc4e1d0a4bddc396f1d9bc85365547a3 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Thu, 13 Oct 2022 12:08:56 +0530
Subject: [PATCH 27/50] Removing skip from execution configs
---
pom.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9020a4ba..d1c052ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -316,7 +316,6 @@
deploy-file
- true${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}
@@ -643,7 +642,6 @@
deploy-file
- true${basedir}/binary_distrib/${distribution.folder}/bin/jcef.jar${repository.id}
From 37d21f3c47e0500a9b340536c021799fb042adc4 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Thu, 13 Oct 2022 12:23:43 +0530
Subject: [PATCH 28/50] Removing skip from execution configs
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index d1c052ba..85c702c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -312,7 +312,7 @@
deploy-jcef
- deploy
+ nonedeploy-file
From fee8e21bffed139d5d05693f36dd14921817369c Mon Sep 17 00:00:00 2001
From: kisal
Date: Tue, 6 Feb 2024 16:33:00 +0530
Subject: [PATCH 29/50] Initial commit for chromium upgrade 1.0.2
---
CMakeLists.txt | 19 +-
README.md | 7 +-
java/org/cef/CefBrowserSettings.java | 31 ++
java/org/cef/CefClient.java | 48 ++-
java/org/cef/SystemBootstrap.java | 4 +-
java/org/cef/browser/CefBrowser.java | 38 +-
java/org/cef/browser/CefBrowserFactory.java | 8 +-
java/org/cef/browser/CefBrowserOsr.java | 63 ++-
java/org/cef/browser/CefBrowserWr.java | 26 +-
java/org/cef/browser/CefBrowser_N.java | 85 +++-
java/org/cef/browser/CefDevToolsClient.java | 165 ++++++++
.../browser/CefDevToolsMessageObserver.java | 34 ++
java/org/cef/browser/CefFrame.java | 7 +-
java/org/cef/browser/CefFrame_N.java | 9 +
java/org/cef/browser/CefPaintEvent.java | 51 +++
java/org/cef/browser/CefRegistration.java | 24 ++
java/org/cef/browser/CefRegistration_N.java | 33 ++
.../cef/callback/CefFileDialogCallback.java | 4 +-
.../cef/callback/CefFileDialogCallback_N.java | 7 +-
.../org/cef/callback/CefPdfPrintCallback.java | 2 -
.../callback/CefRunFileDialogCallback.java | 7 +-
java/org/cef/callback/CefSchemeRegistrar.java | 2 +-
.../org/cef/handler/CefAppHandlerAdapter.java | 7 +-
java/org/cef/handler/CefDialogHandler.java | 5 +-
java/org/cef/handler/CefDisplayHandler.java | 7 +
.../cef/handler/CefDisplayHandlerAdapter.java | 5 +
java/org/cef/handler/CefLoadHandler.java | 5 -
java/org/cef/handler/CefRenderHandler.java | 20 +
java/org/cef/handler/CefRequestHandler.java | 14 -
.../cef/handler/CefRequestHandlerAdapter.java | 6 -
java/org/cef/handler/CefWindowHandler.java | 84 ++--
.../cef/handler/CefWindowHandlerAdapter.java | 50 +--
java/org/cef/misc/CefPdfPrintSettings.java | 115 +++---
java/tests/detailed/BrowserFrame.java | 9 +-
java/tests/detailed/MainFrame.java | 96 ++++-
.../detailed/dialog/CookieManagerDialog.java | 296 +++++++-------
.../tests/detailed/dialog/DevToolsDialog.java | 4 +-
.../tests/detailed/dialog/DownloadDialog.java | 324 ++++++++--------
.../tests/detailed/dialog/PasswordDialog.java | 130 +++----
java/tests/detailed/dialog/SearchDialog.java | 214 +++++-----
.../tests/detailed/dialog/ShowTextDialog.java | 106 ++---
.../detailed/dialog/UrlRequestDialog.java | 10 +-
.../detailed/handler/ClientSchemeHandler.java | 268 ++++++-------
.../detailed/handler/ContextMenuHandler.java | 10 +-
.../detailed/handler/KeyboardHandler.java | 26 ++
.../detailed/handler/RequestHandler.java | 6 -
.../detailed/handler/ResourceHandler.java | 4 +-
java/tests/detailed/ui/ControlPanel.java | 364 +++++++++---------
java/tests/detailed/ui/MenuBar.java | 75 +++-
java/tests/junittests/TestFrame.java | 6 -
java/tests/simple/MainFrame.java | 42 +-
native/CMakeLists.txt | 18 +-
native/CefBrowser_N.cpp | 214 +++++++---
native/CefBrowser_N.h | 60 ++-
native/CefCookieManager_N.cpp | 2 +-
native/CefFileDialogCallback_N.cpp | 12 +-
native/CefFileDialogCallback_N.h | 3 +-
native/CefFrame_N.cpp | 11 +
native/CefFrame_N.h | 9 +
native/CefMessageRouter_N.cpp | 5 +-
native/CefRegistration_N.cpp | 14 +
native/CefRegistration_N.h | 21 +
native/browser_process_handler.cpp | 2 +-
native/browser_process_handler.h | 2 +-
native/devtools_message_observer.cpp | 44 +++
native/devtools_message_observer.h | 37 ++
native/dialog_handler.cpp | 6 +-
native/dialog_handler.h | 1 -
native/display_handler.cpp | 12 +
native/display_handler.h | 2 +
native/int_callback.cpp | 20 +
native/int_callback.h | 28 ++
native/jni_scoped_helpers.cpp | 8 +-
native/jni_scoped_helpers.h | 2 +-
native/jni_util.cpp | 20 +-
native/jni_util.h | 4 +-
native/message_router_handler.cpp | 4 +-
native/message_router_handler.h | 4 +-
native/request_handler.cpp | 32 +-
native/request_handler.h | 4 -
native/resource_handler.cpp | 4 +-
native/resource_handler.h | 2 +-
native/resource_request_handler.cpp | 2 +-
native/resource_request_handler.h | 2 +-
native/run_file_dialog_callback.cpp | 4 +-
native/run_file_dialog_callback.h | 1 -
native/temp_window_mac.mm | 2 +-
native/url_request_client.cpp | 8 +-
native/url_request_client.h | 8 +-
native/util_linux.cpp | 2 +
native/util_mac.mm | 52 +--
native/write_handler.cpp | 4 +-
native/write_handler.h | 4 +-
tools/buildtools/README.jcef | 5 +-
.../download_from_google_storage.py | 86 +++--
tools/buildtools/gsutil.py | 72 ++--
tools/buildtools/linux64/clang-format.sha1 | 2 +-
tools/buildtools/mac/clang-format.arm64.sha1 | 1 +
tools/buildtools/mac/clang-format.sha1 | 1 -
tools/buildtools/mac/clang-format.x64.sha1 | 1 +
tools/buildtools/subprocess2.py | 37 +-
tools/buildtools/win/clang-format.exe.sha1 | 2 +-
tools/compile.sh | 2 +-
tools/distrib/linux32/run.sh | 10 +
tools/distrib/linux64/run.sh | 10 +
tools/fix_style.sh | 2 +-
tools/make_all_jni_headers.bat | 1 +
tools/make_distrib.bat | 4 +-
tools/make_distrib.sh | 4 +-
tools/make_docs.sh | 2 +-
tools/run.sh | 10 +
111 files changed, 2545 insertions(+), 1385 deletions(-)
create mode 100644 java/org/cef/CefBrowserSettings.java
create mode 100644 java/org/cef/browser/CefDevToolsClient.java
create mode 100644 java/org/cef/browser/CefDevToolsMessageObserver.java
create mode 100644 java/org/cef/browser/CefPaintEvent.java
create mode 100644 java/org/cef/browser/CefRegistration.java
create mode 100644 java/org/cef/browser/CefRegistration_N.java
create mode 100644 native/CefRegistration_N.cpp
create mode 100644 native/CefRegistration_N.h
create mode 100644 native/devtools_message_observer.cpp
create mode 100644 native/devtools_message_observer.h
create mode 100644 native/int_callback.cpp
create mode 100644 native/int_callback.h
create mode 100644 tools/buildtools/mac/clang-format.arm64.sha1
delete mode 100644 tools/buildtools/mac/clang-format.sha1
create mode 100644 tools/buildtools/mac/clang-format.x64.sha1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 559cc976..4135c190 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,14 +130,20 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)
# Specify the CEF distribution version.
if(NOT DEFINED CEF_VERSION)
- set(CEF_VERSION "100.0.14+g4e5ba66+chromium-100.0.4896.75")
+ set(CEF_VERSION "119.4.7+g55e15c8+chromium-119.0.6045.199")
endif()
# Determine the platform.
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
if("${PROJECT_ARCH}" STREQUAL "arm64")
set(CEF_PLATFORM "macosarm64")
+ elseif("${PROJECT_ARCH}" STREQUAL "x86_64")
+ set(CEF_PLATFORM "macosx64")
+ elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
+ set(PROJECT_ARCH "arm64")
+ set(CEF_PLATFORM "macosarm64")
else()
+ set(PROJECT_ARCH "x86_64")
set(CEF_PLATFORM "macosx64")
endif()
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
@@ -161,7 +167,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(DownloadCEF)
DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_SOURCE_DIR}/third_party/cef")
-
# Add the CEF binary distribution's cmake/ directory to the module path.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
@@ -273,12 +278,19 @@ file(COPY "${CEF_ROOT}/README.txt" DESTINATION "${CMAKE_BINARY_DIR}")
if(OS_WINDOWS)
set(GS_PLATFORM "win32")
set(GS_HASHPATH "win/clang-format.exe.sha1")
+ set(GS_OUTPATH "win/clang-format.exe")
elseif(OS_MACOSX)
set(GS_PLATFORM "darwin")
- set(GS_HASHPATH "mac/clang-format.sha1")
+ if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
+ set(GS_HASHPATH "mac/clang-format.arm64.sha1")
+ else()
+ set(GS_HASHPATH "mac/clang-format.x64.sha1")
+ endif()
+ set(GS_OUTPATH "mac/clang-format")
elseif(OS_LINUX)
set(GS_PLATFORM "linux*")
set(GS_HASHPATH "linux64/clang-format.sha1")
+ set(GS_OUTPATH "linux64/clang-format")
endif()
message(STATUS "Downloading clang-format from Google Storage...")
@@ -290,6 +302,7 @@ execute_process(
"--no_auth"
"--bucket" "chromium-clang-format"
"-s" "tools/buildtools/${GS_HASHPATH}"
+ "-o" "tools/buildtools/${GS_OUTPATH}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE EXECUTE_RV
)
diff --git a/README.md b/README.md
index b0f854d4..ea351ea3 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@ The Java Chromium Embedded Framework (JCEF) is a simple framework for embedding
* Building JCEF - https://bitbucket.org/chromiumembedded/java-cef/wiki/BranchesAndBuilding
* Support Forum - http://magpcss.org/ceforum/viewforum.php?f=17
+* Issue Tracker - https://github.com/chromiumembedded/java-cef/issues
* Downloads - https://github.com/jcefmaven/jcefbuild
* Maven/Gradle Artifacts - https://github.com/jcefmaven/jcefmaven
* Donations - http://www.magpcss.org/ceforum/donate.php
@@ -29,7 +30,7 @@ The JCEF project is an extension of the Chromium Embedded Framework (CEF) projec
JCEF is still very much a work in progress. Some ways that you can help out:
-\- Vote for issues in the [JCEF issue tracker](https://bitbucket.org/chromiumembedded/java-cef/issues?status=new&status=open) that are important to you. This helps with development prioritization.
+\- Vote for issues in the [JCEF issue tracker](https://github.com/chromiumembedded/java-cef/issues) that are important to you. This helps with development prioritization.
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [JCEF Forum](http://magpcss.org/ceforum/viewforum.php?f=17) and not the issue tracker for usage questions. Each JCEF issue should:
@@ -40,7 +41,7 @@ JCEF is still very much a work in progress. Some ways that you can help out:
\- Write unit tests for new or existing functionality.
-\- Pull requests and patches are welcome. View open issues in the [JCEF issue tracker](https://bitbucket.org/chromiumembedded/java-cef/issues?status=new&status=open) or search for TODO(cef) in the source code for ideas.
+\- Pull requests and patches are welcome. View open issues in the [JCEF issue tracker](https://github.com/chromiumembedded/java-cef/issues) or search for TODO(cef) in the source code for ideas.
If you would like to contribute source code changes to JCEF please follow the below guidelines:
@@ -51,4 +52,4 @@ If you would like to contribute source code changes to JCEF please follow the be
* Be submitted against the current [JCEF master branch](https://bitbucket.org/chromiumembedded/java-cef/src/?at=master) unless explicitly fixing a bug in a CEF release branch.
* Follow the style of existing JCEF source files. In general JCEF uses the [Chromium coding style](http://www.chromium.org/developers/coding-style).
* Include new or modified unit tests as appropriate to the functionality.
-* Not include unnecessary or unrelated changes.
\ No newline at end of file
+* Not include unnecessary or unrelated changes.
diff --git a/java/org/cef/CefBrowserSettings.java b/java/org/cef/CefBrowserSettings.java
new file mode 100644
index 00000000..8733a418
--- /dev/null
+++ b/java/org/cef/CefBrowserSettings.java
@@ -0,0 +1,31 @@
+// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef;
+
+/**
+ * Browser initialization settings. Specify NULL or 0 to get the recommended
+ * default values. The consequences of using custom values may not be well
+ * tested. Many of these and other settings can also configured using command-
+ * line switches.
+ */
+public class CefBrowserSettings {
+ /**
+ * The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint
+ * will be called for a windowless browser. The actual fps may be lower if
+ * the browser cannot generate frames at the requested rate. The minimum
+ * value is 1 and the maximum value is 60 (default 30). This value can also
+ * be changed dynamically via {@code CefBrowser#setWindowlessFrameRate}
+ */
+ public int windowless_frame_rate = 0;
+
+ public CefBrowserSettings() {}
+
+ @Override
+ public CefBrowserSettings clone() {
+ CefBrowserSettings tmp = new CefBrowserSettings();
+ tmp.windowless_frame_rate = windowless_frame_rate;
+ return tmp;
+ }
+}
diff --git a/java/org/cef/CefClient.java b/java/org/cef/CefClient.java
index f72b4d19..7fa5fdaf 100644
--- a/java/org/cef/CefClient.java
+++ b/java/org/cef/CefClient.java
@@ -4,11 +4,7 @@
package org.cef;
-import org.cef.browser.CefBrowser;
-import org.cef.browser.CefBrowserFactory;
-import org.cef.browser.CefFrame;
-import org.cef.browser.CefMessageRouter;
-import org.cef.browser.CefRequestContext;
+import org.cef.browser.*;
import org.cef.callback.CefAuthCallback;
import org.cef.callback.CefBeforeDownloadCallback;
import org.cef.callback.CefCallback;
@@ -60,6 +56,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Vector;
+import java.util.function.Consumer;
import javax.swing.SwingUtilities;
@@ -141,7 +138,16 @@ public CefBrowser createBrowser(String url, boolean isOffscreenRendered, boolean
CefRequestContext context) {
if (isDisposed_)
throw new IllegalStateException("Can't create browser. CefClient is disposed");
- return CefBrowserFactory.create(this, url, isOffscreenRendered, isTransparent, context);
+ return CefBrowserFactory.create(
+ this, url, isOffscreenRendered, isTransparent, context, null);
+ }
+
+ public CefBrowser createBrowser(String url, boolean isOffscreenRendered, boolean isTransparent,
+ CefRequestContext context, CefBrowserSettings settings) {
+ if (isDisposed_)
+ throw new IllegalStateException("Can't create browser. CefClient is disposed");
+ return CefBrowserFactory.create(
+ this, url, isOffscreenRendered, isTransparent, context, settings);
}
@Override
@@ -274,11 +280,10 @@ public void removeDialogHandler() {
@Override
public boolean onFileDialog(CefBrowser browser, FileDialogMode mode, String title,
- String defaultFilePath, Vector acceptFilters, int selectedAcceptFilter,
- CefFileDialogCallback callback) {
+ String defaultFilePath, Vector acceptFilters, CefFileDialogCallback callback) {
if (dialogHandler_ != null && browser != null) {
- return dialogHandler_.onFileDialog(browser, mode, title, defaultFilePath, acceptFilters,
- selectedAcceptFilter, callback);
+ return dialogHandler_.onFileDialog(
+ browser, mode, title, defaultFilePath, acceptFilters, callback);
}
return false;
}
@@ -306,6 +311,12 @@ public void onTitleChange(CefBrowser browser, String title) {
displayHandler_.onTitleChange(browser, title);
}
+ @Override
+ public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ if (displayHandler_ != null && browser != null)
+ displayHandler_.OnFullscreenModeChange(browser, fullscreen);
+ }
+
@Override
public boolean onTooltip(CefBrowser browser, String text) {
if (displayHandler_ != null && browser != null) {
@@ -754,6 +765,15 @@ public void onPaint(CefBrowser browser, boolean popup, Rectangle[] dirtyRects,
realHandler.onPaint(browser, popup, dirtyRects, buffer, width, height);
}
+ @Override
+ public void addOnPaintListener(Consumer listener) {}
+
+ @Override
+ public void setOnPaintListener(Consumer listener) {}
+
+ @Override
+ public void removeOnPaintListener(Consumer listener) {}
+
@Override
public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y) {
if (browser == null) return false;
@@ -820,14 +840,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
return false;
}
- @Override
- public boolean onQuotaRequest(
- CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
- if (requestHandler_ != null && browser != null)
- return requestHandler_.onQuotaRequest(browser, origin_url, new_size, callback);
- return false;
- }
-
@Override
public boolean onCertificateError(
CefBrowser browser, ErrorCode cert_error, String request_url, CefCallback callback) {
diff --git a/java/org/cef/SystemBootstrap.java b/java/org/cef/SystemBootstrap.java
index 0a217ac4..342aaa82 100644
--- a/java/org/cef/SystemBootstrap.java
+++ b/java/org/cef/SystemBootstrap.java
@@ -13,7 +13,9 @@ public class SystemBootstrap {
/**
* Simple interface for how a library by name should be loaded.
*/
- static public interface Loader { public void loadLibrary(String libname); }
+ static public interface Loader {
+ public void loadLibrary(String libname);
+ }
/**
* Default implementation is to call System.loadLibrary
diff --git a/java/org/cef/browser/CefBrowser.java b/java/org/cef/browser/CefBrowser.java
index 14eeab26..f6c72ee5 100644
--- a/java/org/cef/browser/CefBrowser.java
+++ b/java/org/cef/browser/CefBrowser.java
@@ -337,19 +337,29 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
public void stopFinding(boolean clearSelection);
/**
- * Get an instance of the dev tools to be displayed in its own window or to be
+ * Get an instance of the DevTools to be displayed in its own window or to be
* embedded within your UI. Only one instance per browser is available.
*/
public CefBrowser getDevTools();
/**
- * Get an instance of the dev tools to be displayed in its own window or to be
+ * Get an instance of the DevTools to be displayed in its own window or to be
* embedded within your UI. Only one instance per browser is available.
*
* @param inspectAt a position in the UI which should be inspected.
*/
public CefBrowser getDevTools(Point inspectAt);
+ /**
+ * Get an instance of a client that can be used to leverage the DevTools
+ * protocol. Only one instance per browser is available.
+ *
+ * @see {@link CefDevToolsClient}
+ * @return DevTools client, or null if this browser is not yet created
+ * or if it is closed or closing
+ */
+ public CefDevToolsClient getDevToolsClient();
+
/**
* If a misspelled word is currently selected in an editable node calling
* this method will replace it with the specified |word|.
@@ -363,7 +373,7 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
*
* If executed on the AWT Event Thread, this returns an immediately resolved {@link
* java.util.concurrent.CompletableFuture}. If executed from another thread, the {@link
- * java.util.concurrent.CompletableFuture} returned is resolved as soon as the screenshot
+ * java.util.concurrent.CompletableFuture} returned is resolved as soon as the screenshot
* has been taken (which must happen on the event thread).
*
* The generated screenshot can either be returned as-is, containing all natively-rendered
@@ -380,4 +390,26 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
* @throws UnsupportedOperationException if not supported
*/
public CompletableFuture createScreenshot(boolean nativeResolution);
+
+ /**
+ * Set the maximum rate in frames per second (fps) that {@code CefRenderHandler::onPaint}
+ * will be called for a windowless browser. The actual fps may be
+ * lower if the browser cannot generate frames at the requested rate. The
+ * minimum value is 1, and the maximum value is 60 (default 30).
+ *
+ * @param frameRate the maximum frame rate
+ * @throws UnsupportedOperationException if not supported
+ */
+ public void setWindowlessFrameRate(int frameRate);
+
+ /**
+ * Returns the maximum rate in frames per second (fps) that {@code CefRenderHandler::onPaint}
+ * will be called for a windowless browser. The actual fps may be lower if the browser cannot
+ * generate frames at the requested rate. The minimum value is 1, and the maximum value is 60
+ * (default 30).
+ *
+ * @return the framerate, 0 if an error occurs
+ * @throws UnsupportedOperationException if not supported
+ */
+ public CompletableFuture getWindowlessFrameRate();
}
diff --git a/java/org/cef/browser/CefBrowserFactory.java b/java/org/cef/browser/CefBrowserFactory.java
index 708d0f24..299dfcfb 100644
--- a/java/org/cef/browser/CefBrowserFactory.java
+++ b/java/org/cef/browser/CefBrowserFactory.java
@@ -4,6 +4,7 @@
package org.cef.browser;
+import org.cef.CefBrowserSettings;
import org.cef.CefClient;
/**
@@ -11,8 +12,9 @@
*/
public class CefBrowserFactory {
public static CefBrowser create(CefClient client, String url, boolean isOffscreenRendered,
- boolean isTransparent, CefRequestContext context) {
- if (isOffscreenRendered) return new CefBrowserOsr(client, url, isTransparent, context);
- return new CefBrowserWr(client, url, context);
+ boolean isTransparent, CefRequestContext context, CefBrowserSettings settings) {
+ if (isOffscreenRendered)
+ return new CefBrowserOsr(client, url, isTransparent, context, settings);
+ return new CefBrowserWr(client, url, context, settings);
}
}
diff --git a/java/org/cef/browser/CefBrowserOsr.java b/java/org/cef/browser/CefBrowserOsr.java
index f0672f9b..b999b6ba 100644
--- a/java/org/cef/browser/CefBrowserOsr.java
+++ b/java/org/cef/browser/CefBrowserOsr.java
@@ -15,6 +15,7 @@
import com.jogamp.opengl.awt.GLCanvas;
import com.jogamp.opengl.util.GLBuffers;
+import org.cef.CefBrowserSettings;
import org.cef.CefClient;
import org.cef.OS;
import org.cef.callback.CefDragData;
@@ -60,9 +61,11 @@
import java.util.Arrays;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
+import java.util.function.Consumer;
import javax.swing.MenuSelectionManager;
import javax.swing.SwingUtilities;
@@ -84,13 +87,18 @@ class CefBrowserOsr extends CefBrowser_N implements CefRenderHandler {
private int depth_per_component = 8;
private boolean isTransparent_;
- CefBrowserOsr(CefClient client, String url, boolean transparent, CefRequestContext context) {
- this(client, url, transparent, context, null, null);
+ private CopyOnWriteArrayList> onPaintListeners =
+ new CopyOnWriteArrayList<>();
+
+ CefBrowserOsr(CefClient client, String url, boolean transparent, CefRequestContext context,
+ CefBrowserSettings settings) {
+ this(client, url, transparent, context, null, null, settings);
}
private CefBrowserOsr(CefClient client, String url, boolean transparent,
- CefRequestContext context, CefBrowserOsr parent, Point inspectAt) {
- super(client, url, context, parent, inspectAt);
+ CefRequestContext context, CefBrowserOsr parent, Point inspectAt,
+ CefBrowserSettings settings) {
+ super(client, url, context, parent, inspectAt, settings);
isTransparent_ = transparent;
renderer_ = new CefRenderer(transparent);
createGLCanvas();
@@ -117,7 +125,7 @@ public CefRenderHandler getRenderHandler() {
protected CefBrowser_N createDevToolsBrowser(CefClient client, String url,
CefRequestContext context, CefBrowser_N parent, Point inspectAt) {
return new CefBrowserOsr(
- client, url, isTransparent_, context, (CefBrowserOsr) this, inspectAt);
+ client, url, isTransparent_, context, (CefBrowserOsr) this, inspectAt, null);
}
private synchronized long getWindowHandle() {
@@ -354,6 +362,22 @@ public void onPopupSize(CefBrowser browser, Rectangle size) {
renderer_.onPopupSize(size);
}
+ @Override
+ public void addOnPaintListener(Consumer listener) {
+ onPaintListeners.add(listener);
+ }
+
+ @Override
+ public void setOnPaintListener(Consumer listener) {
+ onPaintListeners.clear();
+ onPaintListeners.add(listener);
+ }
+
+ @Override
+ public void removeOnPaintListener(Consumer listener) {
+ onPaintListeners.remove(listener);
+ }
+
@Override
public void onPaint(CefBrowser browser, boolean popup, Rectangle[] dirtyRects,
ByteBuffer buffer, int width, int height) {
@@ -376,6 +400,13 @@ public void run() {
canvas_.display();
}
});
+ if (!onPaintListeners.isEmpty()) {
+ CefPaintEvent paintEvent =
+ new CefPaintEvent(browser, popup, dirtyRects, buffer, width, height);
+ for (Consumer l : onPaintListeners) {
+ l.accept(paintEvent);
+ }
+ }
}
@Override
@@ -401,11 +432,25 @@ protected void registerListeners() {}
protected void unregisterListeners() {}
};
+ private static int getDndAction(int mask) {
+ // Default to copy if multiple operations are specified.
+ int action = DnDConstants.ACTION_NONE;
+ if ((mask & CefDragData.DragOperations.DRAG_OPERATION_COPY)
+ == CefDragData.DragOperations.DRAG_OPERATION_COPY) {
+ action = DnDConstants.ACTION_COPY;
+ } else if ((mask & CefDragData.DragOperations.DRAG_OPERATION_MOVE)
+ == CefDragData.DragOperations.DRAG_OPERATION_MOVE) {
+ action = DnDConstants.ACTION_MOVE;
+ } else if ((mask & CefDragData.DragOperations.DRAG_OPERATION_LINK)
+ == CefDragData.DragOperations.DRAG_OPERATION_LINK) {
+ action = DnDConstants.ACTION_LINK;
+ }
+ return action;
+ }
+
@Override
public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask, int x, int y) {
- int action = (mask & CefDragData.DragOperations.DRAG_OPERATION_MOVE) == 0
- ? DnDConstants.ACTION_COPY
- : DnDConstants.ACTION_MOVE;
+ int action = getDndAction(mask);
MouseEvent triggerEvent =
new MouseEvent(canvas_, MouseEvent.MOUSE_DRAGGED, 0, 0, x, y, 0, false);
DragGestureEvent ev = new DragGestureEvent(
@@ -416,7 +461,7 @@ public boolean startDragging(CefBrowser browser, CefDragData dragData, int mask,
new StringSelection(dragData.getFragmentText()), new DragSourceAdapter() {
@Override
public void dragDropEnd(DragSourceDropEvent dsde) {
- dragSourceEndedAt(dsde.getLocation(), mask);
+ dragSourceEndedAt(dsde.getLocation(), action);
dragSourceSystemDragEnded();
}
});
diff --git a/java/org/cef/browser/CefBrowserWr.java b/java/org/cef/browser/CefBrowserWr.java
index b142bc5c..677ddce7 100644
--- a/java/org/cef/browser/CefBrowserWr.java
+++ b/java/org/cef/browser/CefBrowserWr.java
@@ -4,6 +4,7 @@
package org.cef.browser;
+import org.cef.CefBrowserSettings;
import org.cef.CefClient;
import org.cef.OS;
import org.cef.handler.CefWindowHandler;
@@ -166,14 +167,15 @@ public int getClickCount(int event, int button) {
}
};
- CefBrowserWr(CefClient client, String url, CefRequestContext context) {
- this(client, url, context, null, null);
+ CefBrowserWr(
+ CefClient client, String url, CefRequestContext context, CefBrowserSettings settings) {
+ this(client, url, context, null, null, settings);
}
@SuppressWarnings("serial")
private CefBrowserWr(CefClient client, String url, CefRequestContext context,
- CefBrowserWr parent, Point inspectAt) {
- super(client, url, context, parent, inspectAt);
+ CefBrowserWr parent, Point inspectAt, CefBrowserSettings settings) {
+ super(client, url, context, parent, inspectAt, settings);
delayedUpdate_.setRepeats(false);
// Disabling lightweight of popup menu is required because
@@ -318,7 +320,7 @@ public CefWindowHandler getWindowHandler() {
@Override
protected CefBrowser_N createDevToolsBrowser(CefClient client, String url,
CefRequestContext context, CefBrowser_N parent, Point inspectAt) {
- return new CefBrowserWr(client, url, context, (CefBrowserWr) this, inspectAt);
+ return new CefBrowserWr(client, url, context, (CefBrowserWr) this, inspectAt, null);
}
private synchronized long getWindowHandle() {
@@ -378,7 +380,7 @@ private void doUpdate() {
}
} else {
synchronized (content_rect_) {
- Rectangle bounds = component_.getBounds();
+ Rectangle bounds = null != canvas_ ? canvas_.getBounds() : component_.getBounds();
content_rect_ = new Rectangle((int) (bounds.getX() * scaleFactor_),
(int) (bounds.getY() * scaleFactor_),
(int) (bounds.getWidth() * scaleFactor_),
@@ -421,4 +423,16 @@ private boolean createBrowserIfRequired(boolean hasParent) {
public CompletableFuture createScreenshot(boolean nativeResolution) {
throw new UnsupportedOperationException("Unsupported for windowed rendering");
}
+
+ @Override
+ public void setWindowlessFrameRate(int frameRate) {
+ throw new UnsupportedOperationException(
+ "You can only set windowless framerate on OSR browser");
+ }
+
+ @Override
+ public CompletableFuture getWindowlessFrameRate() {
+ throw new UnsupportedOperationException(
+ "You can only get windowless framerate on OSR browser");
+ }
}
diff --git a/java/org/cef/browser/CefBrowser_N.java b/java/org/cef/browser/CefBrowser_N.java
index 406d0256..d7c62e0f 100644
--- a/java/org/cef/browser/CefBrowser_N.java
+++ b/java/org/cef/browser/CefBrowser_N.java
@@ -4,8 +4,9 @@
package org.cef.browser;
+import org.cef.CefBrowserSettings;
import org.cef.CefClient;
-import org.cef.browser.CefRequestContext;
+import org.cef.browser.CefDevToolsClient.DevToolsException;
import org.cef.callback.CefDragData;
import org.cef.callback.CefNativeAdapter;
import org.cef.callback.CefPdfPrintCallback;
@@ -18,7 +19,6 @@
import org.cef.misc.CefPdfPrintSettings;
import org.cef.network.CefRequest;
-import java.awt.Canvas;
import java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
@@ -28,6 +28,7 @@
import java.awt.event.MouseWheelEvent;
import java.awt.event.WindowEvent;
import java.util.Vector;
+import java.util.concurrent.CompletableFuture;
import javax.swing.SwingUtilities;
@@ -45,17 +46,23 @@ abstract class CefBrowser_N extends CefNativeAdapter implements CefBrowser {
private volatile CefBrowser_N parent_ = null;
private volatile Point inspectAt_ = null;
private volatile CefBrowser_N devTools_ = null;
+ private volatile CefDevToolsClient devToolsClient_ = null;
private boolean closeAllowed_ = false;
private volatile boolean isClosed_ = false;
private volatile boolean isClosing_ = false;
+ private final CefBrowserSettings settings_;
protected CefBrowser_N(CefClient client, String url, CefRequestContext context,
- CefBrowser_N parent, Point inspectAt) {
+ CefBrowser_N parent, Point inspectAt, CefBrowserSettings settings) {
client_ = client;
url_ = url;
request_context_ = context;
parent_ = parent;
inspectAt_ = inspectAt;
+ if (settings != null)
+ settings_ = settings.clone();
+ else
+ settings_ = new CefBrowserSettings();
}
protected String getUrl() {
@@ -130,6 +137,9 @@ public synchronized void onBeforeClose() {
parent_.devTools_ = null;
parent_ = null;
}
+ if (devToolsClient_ != null) {
+ devToolsClient_.close();
+ }
}
@Override
@@ -145,6 +155,37 @@ public synchronized CefBrowser getDevTools(Point inspectAt) {
return devTools_;
}
+ @Override
+ public synchronized CefDevToolsClient getDevToolsClient() {
+ if (!isPending_ || isClosing_ || isClosed_) {
+ return null;
+ }
+ if (devToolsClient_ == null || devToolsClient_.isClosed()) {
+ devToolsClient_ = new CefDevToolsClient(this);
+ }
+ return devToolsClient_;
+ }
+
+ CompletableFuture executeDevToolsMethod(String method, String parametersAsJson) {
+ CompletableFuture future = new CompletableFuture<>();
+ N_ExecuteDevToolsMethod(method, parametersAsJson, new IntCallback() {
+ @Override
+ public void onComplete(int generatedMessageId) {
+ if (generatedMessageId <= 0) {
+ future.completeExceptionally(new DevToolsException(
+ String.format("Failed to execute DevTools method %s", method)));
+ } else {
+ future.complete(generatedMessageId);
+ }
+ }
+ });
+ return future;
+ }
+
+ CefRegistration addDevToolsMessageObserver(CefDevToolsMessageObserver observer) {
+ return N_AddDevToolsMessageObserver(observer);
+ }
+
protected abstract CefBrowser_N createDevToolsBrowser(CefClient client, String url,
CefRequestContext context, CefBrowser_N parent, Point inspectAt);
@@ -155,8 +196,8 @@ protected void createBrowser(CefClientHandler clientHandler, long windowHandle,
boolean osr, boolean transparent, Component canvas, CefRequestContext context) {
if (getNativeRef("CefBrowser") == 0 && !isPending_) {
try {
- N_CreateBrowser(
- clientHandler, windowHandle, url, osr, transparent, canvas, context);
+ N_CreateBrowser(clientHandler, windowHandle, url, osr, transparent, canvas, context,
+ settings_);
} catch (UnsatisfiedLinkError err) {
err.printStackTrace();
}
@@ -379,6 +420,7 @@ public boolean hasDocument() {
return false;
}
+ @Override
public void viewSource() {
try {
N_ViewSource();
@@ -387,6 +429,7 @@ public void viewSource() {
}
}
+ @Override
public void getSource(CefStringVisitor visitor) {
try {
N_GetSource(visitor);
@@ -395,6 +438,7 @@ public void getSource(CefStringVisitor visitor) {
}
}
+ @Override
public void getText(CefStringVisitor visitor) {
try {
N_GetText(visitor);
@@ -751,11 +795,38 @@ protected final void notifyMoveOrResizeStarted() {
}
}
+ public void setWindowlessFrameRate(int frameRate) {
+ try {
+ N_SetWindowlessFrameRate(frameRate);
+ } catch (UnsatisfiedLinkError ule) {
+ ule.printStackTrace();
+ }
+ }
+
+ public CompletableFuture getWindowlessFrameRate() {
+ final CompletableFuture future = new CompletableFuture<>();
+ try {
+ N_GetWindowlessFrameRate(future::complete);
+ } catch (UnsatisfiedLinkError ule) {
+ ule.printStackTrace();
+ future.complete(0);
+ }
+ return future;
+ }
+
+ private interface IntCallback {
+ void onComplete(int value);
+ }
+
private final native boolean N_CreateBrowser(CefClientHandler clientHandler, long windowHandle,
String url, boolean osr, boolean transparent, Component canvas,
- CefRequestContext context);
+ CefRequestContext context, CefBrowserSettings settings);
private final native boolean N_CreateDevTools(CefBrowser parent, CefClientHandler clientHandler,
long windowHandle, boolean osr, boolean transparent, Component canvas, Point inspectAt);
+ private final native void N_ExecuteDevToolsMethod(
+ String method, String parametersAsJson, IntCallback callback);
+ private final native CefRegistration N_AddDevToolsMessageObserver(
+ CefDevToolsMessageObserver observer);
private final native long N_GetWindowHandle(long surfaceHandle);
private final native boolean N_CanGoBack();
private final native void N_GoBack();
@@ -814,4 +885,6 @@ private final native void N_DragTargetDragEnter(
private final native void N_UpdateUI(Rectangle contentRect, Rectangle browserRect);
private final native void N_SetParent(long windowHandle, Component canvas);
private final native void N_NotifyMoveOrResizeStarted();
+ private final native void N_SetWindowlessFrameRate(int frameRate);
+ private final native void N_GetWindowlessFrameRate(IntCallback frameRateCallback);
}
diff --git a/java/org/cef/browser/CefDevToolsClient.java b/java/org/cef/browser/CefDevToolsClient.java
new file mode 100644
index 00000000..ee119469
--- /dev/null
+++ b/java/org/cef/browser/CefDevToolsClient.java
@@ -0,0 +1,165 @@
+// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.browser;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+
+public class CefDevToolsClient implements AutoCloseable {
+ private final Map> queuedCommands_ =
+ Collections.synchronizedMap(new HashMap<>());
+ private final Set eventListeners_ =
+ Collections.synchronizedSet(new LinkedHashSet<>());
+ private CefRegistration registration_;
+ private final CefBrowser_N browser_;
+
+ /**
+ * Use {@link CefBrowser#getDevToolsClient()} to get an instance of this class.
+ */
+ CefDevToolsClient(CefBrowser_N browser) {
+ this.browser_ = browser;
+
+ registration_ = browser.addDevToolsMessageObserver(new CefDevToolsMessageObserver() {
+ @Override
+ public void onDevToolsMethodResult(
+ CefBrowser browser, int messageId, boolean success, String result) {
+ CompletableFuture future = getQueuedCommand(messageId);
+ if (success) {
+ future.complete(result);
+ } else {
+ future.completeExceptionally(
+ new DevToolsException("DevTools method failed", result));
+ }
+ }
+
+ @Override
+ public void onDevToolsEvent(CefBrowser browser, String method, String parameters) {
+ for (EventListener eventListener : eventListeners_) {
+ eventListener.onEvent(method, parameters);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void close() {
+ queuedCommands_.clear();
+ eventListeners_.clear();
+ registration_ = null;
+ }
+
+ public boolean isClosed() {
+ return registration_ == null;
+ }
+
+ private CompletableFuture getQueuedCommand(Integer messageId) {
+ return queuedCommands_.computeIfAbsent(messageId, key -> new CompletableFuture<>());
+ }
+
+ /**
+ * Execute a method call over the DevTools protocol. See the DevTools protocol documentation
+ * for details of supported methods and the expected syntax for parameters.
+ *
+ *
If an error occurs the returned future is completed exceptionally, otherwise its value is
+ * asynchronously set to the method result.
+ *
+ *
Call {@link #addEventListener(String, EventListener)} to subscribe to events.
+ *
+ * @param method the method name
+ * @return return a future with the method result if the method was executed successfully
+ */
+ public CompletableFuture executeDevToolsMethod(String method) {
+ return executeDevToolsMethod(method, null);
+ }
+
+ /**
+ * Execute a method call over the DevTools protocol. See the DevTools protocol documentation
+ * for details of supported methods and the expected syntax for parameters.
+ *
+ *
If an error occurs the returned future is completed exceptionally, otherwise its value is
+ * asynchronously set to the method result.
+ *
+ *
Call {@link #addEventListener(String, EventListener)} to subscribe to events.
+ *
+ * @param method the method name
+ * @param parametersAsJson JSON object with parameters, or null if no parameters are needed
+ * @return return a future with the method result if the method was executed successfully
+ */
+ public CompletableFuture executeDevToolsMethod(String method, String parametersAsJson) {
+ if (isClosed()) {
+ CompletableFuture future = new CompletableFuture<>();
+ future.completeExceptionally(new DevToolsException("Client is closed"));
+ return future;
+ }
+
+ return browser_.executeDevToolsMethod(method, parametersAsJson)
+ .thenCompose(this::getQueuedCommand);
+ }
+
+ /**
+ * Add an event listener for DevTools protocol events. Events by default are disabled
+ * and need to be enabled on a per domain basis, e.g. by sending Network.enable to enable
+ * network related events.
+ *
+ * @param eventListener the listener to add
+ */
+ public void addEventListener(EventListener eventListener) {
+ eventListeners_.add(eventListener);
+ }
+
+ /**
+ * Remove an event listener for DevTools protocol events.
+ *
+ * @param eventListener the listener to remove
+ */
+ public void removeEventListener(EventListener eventListener) {
+ eventListeners_.remove(eventListener);
+ }
+
+ public interface EventListener {
+ /**
+ * Method that will be called on receipt of an event.
+ * @param eventName the event name
+ * @param messageAsJson JSON object with the event message
+ */
+ void onEvent(String eventName, String messageAsJson);
+ }
+
+ public static final class DevToolsException extends Exception {
+ private static final long serialVersionUID = 3952948449841375372L;
+
+ private final String json_;
+
+ public DevToolsException(String message) {
+ this(message, null);
+ }
+
+ public DevToolsException(String message, String json) {
+ super(message);
+ this.json_ = json;
+ }
+
+ @Override
+ public String getMessage() {
+ String message = super.getMessage();
+ if (json_ != null) message += ": " + json_;
+ return message;
+ }
+
+ /**
+ * JSON object with the error details that were passed back by the DevTools
+ * host, or null if no further details are available.
+ */
+ public String getJson() {
+ return json_;
+ }
+ }
+}
diff --git a/java/org/cef/browser/CefDevToolsMessageObserver.java b/java/org/cef/browser/CefDevToolsMessageObserver.java
new file mode 100644
index 00000000..3a851356
--- /dev/null
+++ b/java/org/cef/browser/CefDevToolsMessageObserver.java
@@ -0,0 +1,34 @@
+// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.browser;
+
+/**
+ * Used internally by {@link CefDevToolsClient}.
+ *
+ * Callback interface for {@link CefBrowser#addDevToolsMessageObserver(CefDevToolsMessageObserver)}.
+ * The methods of this class will be called on the CEF UI thread.
+ */
+interface CefDevToolsMessageObserver {
+ /**
+ * Method that will be called after attempted execution of a DevTools protocol method.
+ *
+ * @param browser the originating browser instance
+ * @param messageId the ID that identifies the originating method call
+ * @param success if the method succeeded, |success| will be true and |result| will be a JSON
+ * object containing the method call result. If the method call failed, |success| will
+ * be false and |result| will be a JSON object describing the error.
+ * @param result method call result or an error
+ */
+ void onDevToolsMethodResult(CefBrowser browser, int messageId, boolean success, String result);
+
+ /**
+ * Method that will be called on receipt of a DevTools protocol event.
+ *
+ * @param browser the originating browser instance
+ * @param method the method name
+ * @param parameters the event data
+ */
+ void onDevToolsEvent(CefBrowser browser, String method, String parameters);
+}
diff --git a/java/org/cef/browser/CefFrame.java b/java/org/cef/browser/CefFrame.java
index 3a2393fb..280f1e35 100644
--- a/java/org/cef/browser/CefFrame.java
+++ b/java/org/cef/browser/CefFrame.java
@@ -98,4 +98,9 @@ public interface CefFrame {
* Execute paste in this frame.
*/
public void paste();
-}
\ No newline at end of file
+
+ /**
+ * Execute selectAll in this frame.
+ */
+ public void selectAll();
+}
diff --git a/java/org/cef/browser/CefFrame_N.java b/java/org/cef/browser/CefFrame_N.java
index 8e129f1a..c68e1fbf 100644
--- a/java/org/cef/browser/CefFrame_N.java
+++ b/java/org/cef/browser/CefFrame_N.java
@@ -148,6 +148,14 @@ public void paste() {
}
}
+ public void selectAll() {
+ try {
+ N_SelectAll(getNativeRef(null));
+ } catch (UnsatisfiedLinkError ule) {
+ ule.printStackTrace();
+ }
+ }
+
private final native void N_Dispose(long self);
private final native long N_GetIdentifier(long self);
private final native String N_GetURL(long self);
@@ -162,4 +170,5 @@ public void paste() {
private final native void N_Cut(long self);
private final native void N_Copy(long self);
private final native void N_Paste(long self);
+ private final native void N_SelectAll(long self);
}
diff --git a/java/org/cef/browser/CefPaintEvent.java b/java/org/cef/browser/CefPaintEvent.java
new file mode 100644
index 00000000..aed9af31
--- /dev/null
+++ b/java/org/cef/browser/CefPaintEvent.java
@@ -0,0 +1,51 @@
+// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.browser;
+
+import java.awt.*;
+import java.nio.ByteBuffer;
+
+public class CefPaintEvent {
+ private final CefBrowser browser;
+ private final boolean popup;
+ private final Rectangle[] dirtyRects;
+ private final ByteBuffer renderedFrame;
+ private final int width;
+ private final int height;
+
+ public CefPaintEvent(CefBrowser browser, boolean popup, Rectangle[] dirtyRects,
+ ByteBuffer renderedFrame, int width, int height) {
+ this.browser = browser;
+ this.popup = popup;
+ this.dirtyRects = dirtyRects;
+ this.renderedFrame = renderedFrame;
+ this.width = width;
+ this.height = height;
+ }
+
+ public CefBrowser getBrowser() {
+ return browser;
+ }
+
+ public boolean getPopup() {
+ return popup;
+ }
+
+ public Rectangle[] getDirtyRects() {
+ return dirtyRects;
+ }
+
+ public ByteBuffer getRenderedFrame() {
+ return renderedFrame;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+}
\ No newline at end of file
diff --git a/java/org/cef/browser/CefRegistration.java b/java/org/cef/browser/CefRegistration.java
new file mode 100644
index 00000000..11051404
--- /dev/null
+++ b/java/org/cef/browser/CefRegistration.java
@@ -0,0 +1,24 @@
+// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.browser;
+
+/**
+ * Used internally by {@link CefDevToolsClient}.
+ *
+ * Handle to observer registration, As long as this object is alive, the observer will stay
+ * registered.
+ */
+abstract class CefRegistration {
+ /**
+ * Removes the native reference from an unused object.
+ */
+ public abstract void dispose();
+
+ @Override
+ public void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+}
diff --git a/java/org/cef/browser/CefRegistration_N.java b/java/org/cef/browser/CefRegistration_N.java
new file mode 100644
index 00000000..a7defd13
--- /dev/null
+++ b/java/org/cef/browser/CefRegistration_N.java
@@ -0,0 +1,33 @@
+// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.browser;
+
+import org.cef.callback.CefNative;
+
+class CefRegistration_N extends CefRegistration implements CefNative {
+ // Used internally to store a pointer to the CEF object.
+ private long N_CefHandle = 0;
+
+ @Override
+ public void setNativeRef(String identifier, long nativeRef) {
+ N_CefHandle = nativeRef;
+ }
+
+ @Override
+ public long getNativeRef(String identifier) {
+ return N_CefHandle;
+ }
+
+ @Override
+ public void dispose() {
+ try {
+ N_Dispose(N_CefHandle);
+ } catch (UnsatisfiedLinkError ule) {
+ ule.printStackTrace();
+ }
+ }
+
+ private final native void N_Dispose(long self);
+}
diff --git a/java/org/cef/callback/CefFileDialogCallback.java b/java/org/cef/callback/CefFileDialogCallback.java
index 1bbb0b3c..edc06c30 100644
--- a/java/org/cef/callback/CefFileDialogCallback.java
+++ b/java/org/cef/callback/CefFileDialogCallback.java
@@ -15,11 +15,9 @@ public interface CefFileDialogCallback {
* a single value or a list of values depending on the dialog mode. An empty
* value is treated the same as calling Cancel().
*
- * @param selectedAcceptFilter 0-based index of the value selected from the
- * accept filters array passed to CefDialogHandler::OnFileDialog.
* @param filePaths list of selected file paths or an empty list.
*/
- public void Continue(int selectedAcceptFilter, Vector filePaths);
+ public void Continue(Vector filePaths);
/**
* Cancel the file selection.
diff --git a/java/org/cef/callback/CefFileDialogCallback_N.java b/java/org/cef/callback/CefFileDialogCallback_N.java
index de3d5410..770ed97b 100644
--- a/java/org/cef/callback/CefFileDialogCallback_N.java
+++ b/java/org/cef/callback/CefFileDialogCallback_N.java
@@ -16,9 +16,9 @@ protected void finalize() throws Throwable {
}
@Override
- public void Continue(int selectedAcceptFilter, Vector filePaths) {
+ public void Continue(Vector filePaths) {
try {
- N_Continue(getNativeRef(null), selectedAcceptFilter, filePaths);
+ N_Continue(getNativeRef(null), filePaths);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
@@ -33,7 +33,6 @@ public void Cancel() {
}
}
- private final native void N_Continue(
- long self, int selectedAcceptFilter, Vector filePaths);
+ private final native void N_Continue(long self, Vector filePaths);
private final native void N_Cancel(long self);
}
diff --git a/java/org/cef/callback/CefPdfPrintCallback.java b/java/org/cef/callback/CefPdfPrintCallback.java
index 7bedd5c9..cd484042 100644
--- a/java/org/cef/callback/CefPdfPrintCallback.java
+++ b/java/org/cef/callback/CefPdfPrintCallback.java
@@ -9,7 +9,6 @@
* will be called on the browser process UI thread.
*/
public interface CefPdfPrintCallback {
-
/**
* Method that will be executed when the PDF printing has completed. |path|
* is the output path. |ok| will be true if the printing completed
@@ -18,5 +17,4 @@ public interface CefPdfPrintCallback {
* @param ok True if printing completed or false otherwise.
*/
public abstract void onPdfPrintFinished(String path, boolean ok);
-
}
diff --git a/java/org/cef/callback/CefRunFileDialogCallback.java b/java/org/cef/callback/CefRunFileDialogCallback.java
index 21c96dac..9d7381a0 100644
--- a/java/org/cef/callback/CefRunFileDialogCallback.java
+++ b/java/org/cef/callback/CefRunFileDialogCallback.java
@@ -4,9 +4,10 @@
package org.cef.callback;
-import java.util.Vector;
import org.cef.browser.CefBrowser;
+import java.util.Vector;
+
/**
* Callback interface for CefBrowserHost::RunFileDialog. The methods of this
* class will be called on the browser process UI thread.
@@ -18,9 +19,7 @@ public interface CefRunFileDialogCallback {
* depending on the dialog mode. If the selection was cancelled filePaths
* will be empty.
*
- * @param selectedAcceptFilter 0-based index of the value selected from
- * the accept filters array passed to CefBrowserHost::RunFileDialog.
* @param filePaths list of file paths or empty list.
*/
- void onFileDialogDismissed(int selectedAcceptFilter, Vector filePaths);
+ void onFileDialogDismissed(Vector filePaths);
}
diff --git a/java/org/cef/callback/CefSchemeRegistrar.java b/java/org/cef/callback/CefSchemeRegistrar.java
index d4fcb4f2..f59263c3 100644
--- a/java/org/cef/callback/CefSchemeRegistrar.java
+++ b/java/org/cef/callback/CefSchemeRegistrar.java
@@ -62,7 +62,7 @@ public interface CefSchemeRegistrar {
* If |isCspBypassing| is true the scheme can bypass Content-Security-Policy
* (CSP) checks. This value should be false in most cases where |isStandard|
* is true.
- *
+ *
* If |is_fetch_enabled| is true the scheme can perform Fetch API requests.
*
* This function may be called on any thread. It should only be called once
diff --git a/java/org/cef/handler/CefAppHandlerAdapter.java b/java/org/cef/handler/CefAppHandlerAdapter.java
index d74eee48..47f7ae53 100644
--- a/java/org/cef/handler/CefAppHandlerAdapter.java
+++ b/java/org/cef/handler/CefAppHandlerAdapter.java
@@ -32,9 +32,10 @@ public void onBeforeCommandLineProcessing(String process_type, CefCommandLine co
continue;
}
// Arguments with '--', '-' and, on Windows, '/' prefixes are considered switches.
- int switchCnt = arg.startsWith("--")
- ? 2
- : arg.startsWith("/") ? 1 : arg.startsWith("-") ? 1 : 0;
+ int switchCnt = arg.startsWith("--") ? 2
+ : arg.startsWith("/") ? 1
+ : arg.startsWith("-") ? 1
+ : 0;
switch (switchCnt) {
case 2:
// An argument of "--" will terminate switch parsing with all subsequent
diff --git a/java/org/cef/handler/CefDialogHandler.java b/java/org/cef/handler/CefDialogHandler.java
index 4e9a9d65..311de4cb 100644
--- a/java/org/cef/handler/CefDialogHandler.java
+++ b/java/org/cef/handler/CefDialogHandler.java
@@ -38,14 +38,11 @@ enum FileDialogMode {
* "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
* combined description and file extension delimited using "|" and ";" (e.g.
* "Image Types|.png;.gif;.jpg").
- * @param selectedAcceptFilter is the 0-based index of the filter that should
- * be selected by default.
* @param callback is a callback handler for handling own file dialogs.
*
* @return To display a custom dialog return true and execute callback.
* To display the default dialog return false.
*/
public boolean onFileDialog(CefBrowser browser, FileDialogMode mode, String title,
- String defaultFilePath, Vector acceptFilters, int selectedAcceptFilter,
- CefFileDialogCallback callback);
+ String defaultFilePath, Vector acceptFilters, CefFileDialogCallback callback);
}
diff --git a/java/org/cef/handler/CefDisplayHandler.java b/java/org/cef/handler/CefDisplayHandler.java
index 0affefc5..5913794e 100644
--- a/java/org/cef/handler/CefDisplayHandler.java
+++ b/java/org/cef/handler/CefDisplayHandler.java
@@ -28,6 +28,13 @@ public interface CefDisplayHandler {
*/
public void onTitleChange(CefBrowser browser, String title);
+ /**
+ * Browser fullscreen mode changed.
+ * @param browser The browser generating the event.
+ * @param fullscreen True if fullscreen mode is on.
+ */
+ public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen);
+
/**
* About to display a tooltip.
* @param browser The browser generating the event.
diff --git a/java/org/cef/handler/CefDisplayHandlerAdapter.java b/java/org/cef/handler/CefDisplayHandlerAdapter.java
index 80ab96b6..302ae6b0 100644
--- a/java/org/cef/handler/CefDisplayHandlerAdapter.java
+++ b/java/org/cef/handler/CefDisplayHandlerAdapter.java
@@ -24,6 +24,11 @@ public void onTitleChange(CefBrowser browser, String title) {
return;
}
+ @Override
+ public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ return;
+ }
+
@Override
public boolean onTooltip(CefBrowser browser, String text) {
return false;
diff --git a/java/org/cef/handler/CefLoadHandler.java b/java/org/cef/handler/CefLoadHandler.java
index ba7e5038..af50686e 100644
--- a/java/org/cef/handler/CefLoadHandler.java
+++ b/java/org/cef/handler/CefLoadHandler.java
@@ -40,7 +40,6 @@ enum ErrorCode {
ERR_NETWORK_CHANGED(-21),
ERR_BLOCKED_BY_ADMINISTRATOR(-22),
ERR_SOCKET_IS_CONNECTED(-23),
- ERR_BLOCKED_ENROLLMENT_CHECK_PENDING(-24),
ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED(-25),
ERR_CONTEXT_SHUT_DOWN(-26),
ERR_BLOCKED_BY_RESPONSE(-27),
@@ -188,12 +187,8 @@ enum ErrorCode {
ERR_INVALID_HTTP_RESPONSE(-370),
ERR_CONTENT_DECODING_INIT_FAILED(-371),
ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED(-372),
- ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE(-373),
- ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER(-374),
ERR_TOO_MANY_RETRIES(-375),
ERR_HTTP2_STREAM_CLOSED(-376),
- ERR_HTTP2_CLIENT_REFUSED_STREAM(-377),
- ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH(-378),
ERR_HTTP_RESPONSE_CODE_FAILURE(-379),
ERR_QUIC_CERT_ROOT_NOT_KNOWN(-380),
ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED(-381),
diff --git a/java/org/cef/handler/CefRenderHandler.java b/java/org/cef/handler/CefRenderHandler.java
index 0a94bb2f..258df884 100644
--- a/java/org/cef/handler/CefRenderHandler.java
+++ b/java/org/cef/handler/CefRenderHandler.java
@@ -5,11 +5,13 @@
package org.cef.handler;
import org.cef.browser.CefBrowser;
+import org.cef.browser.CefPaintEvent;
import org.cef.callback.CefDragData;
import java.awt.Point;
import java.awt.Rectangle;
import java.nio.ByteBuffer;
+import java.util.function.Consumer;
/**
* Implement this interface to handle events when window rendering is disabled.
@@ -65,6 +67,24 @@ public interface CefRenderHandler {
public void onPaint(CefBrowser browser, boolean popup, Rectangle[] dirtyRects,
ByteBuffer buffer, int width, int height);
+ /**
+ * Add provided listener.
+ * @param listener Code that gets executed after a frame was rendered.
+ */
+ public void addOnPaintListener(Consumer listener);
+
+ /**
+ * Remove existing listeners and replace with provided listener.
+ * @param listener Code that gets executed after a frame was rendered.
+ */
+ public void setOnPaintListener(Consumer listener);
+
+ /**
+ * Remove provided listener.
+ * @param listener Code that gets executed after a frame was rendered.
+ */
+ public void removeOnPaintListener(Consumer listener);
+
/**
* Handle cursor changes.
* @param browser The browser generating the event.
diff --git a/java/org/cef/handler/CefRequestHandler.java b/java/org/cef/handler/CefRequestHandler.java
index 8f5f26f9..7a508323 100644
--- a/java/org/cef/handler/CefRequestHandler.java
+++ b/java/org/cef/handler/CefRequestHandler.java
@@ -103,20 +103,6 @@ CefResourceRequestHandler getResourceRequestHandler(CefBrowser browser, CefFrame
boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean isProxy, String host,
int port, String realm, String scheme, CefAuthCallback callback);
- /**
- * Called on the IO thread when JavaScript requests a specific storage quota size via the
- * webkitStorageInfo.requestQuota function.
- *
- * @param browser The corresponding browser.
- * @param origin_url Origin of the page making the request.
- * @param new_size Requested quota size in bytes.
- * @param callback Call CefCallback.Continue() either in this method or at a later time
- * to grant or deny the request.
- * @return True to handle the request (callback must be executed) or false to cancel.
- */
- boolean onQuotaRequest(
- CefBrowser browser, String origin_url, long new_size, CefCallback callback);
-
/**
* Called on the UI thread to handle requests for URLs with an invalid SSL certificate. If
* "ignore-certificate-errors" command-line switch is set all invalid certificates will be
diff --git a/java/org/cef/handler/CefRequestHandlerAdapter.java b/java/org/cef/handler/CefRequestHandlerAdapter.java
index 02736748..dd785529 100644
--- a/java/org/cef/handler/CefRequestHandlerAdapter.java
+++ b/java/org/cef/handler/CefRequestHandlerAdapter.java
@@ -44,12 +44,6 @@ public boolean getAuthCredentials(CefBrowser browser, String origin_url, boolean
return false;
}
- @Override
- public boolean onQuotaRequest(
- CefBrowser browser, String origin_url, long new_size, CefCallback callback) {
- return false;
- }
-
@Override
public boolean onCertificateError(
CefBrowser browser, ErrorCode cert_error, String request_url, CefCallback callback) {
diff --git a/java/org/cef/handler/CefWindowHandler.java b/java/org/cef/handler/CefWindowHandler.java
index eeda8dac..c0bc0f13 100644
--- a/java/org/cef/handler/CefWindowHandler.java
+++ b/java/org/cef/handler/CefWindowHandler.java
@@ -1,42 +1,42 @@
-// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-package org.cef.handler;
-
-import java.awt.Rectangle;
-
-import org.cef.browser.CefBrowser;
-
-/**
- * Implement this interface to handle events if window rendering is enabled.
- *
- */
-public interface CefWindowHandler {
- /**
- * Retrieve the view rectangle.
- * @param browser The browser generating the event.
- * @return The view rectangle.
- */
- public Rectangle getRect(CefBrowser browser);
-
- /**
- * Implement this method to handle mouse events on Windows.
- *
- * The method is called in case of the following events:
- * MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED and MOUSE_WHEEL for a
- * horizontal wheel movement.
- *
- * @param browser The browser generating the event.
- * @param event A mouse event like MouseEvent.MOUSE_MOVED.
- * @param screenX The absolute X position on the screen.
- * @param screenY The absolute Y position on the screen.
- * @param modifier The modifier keys down during event (e.g. Shift, Ctrl).
- * @param button An integer indicating which mouse button state changed.
- * If parameter event is set to MouseEvent.MOUSE_WHEEL, the value of this
- * parameter specifies the rotation indicator (negative value for left scroll
- * and positive value for right scroll).
- */
- public void onMouseEvent(
- CefBrowser browser, int event, int screenX, int screenY, int modifier, int button);
-}
+// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.handler;
+
+import org.cef.browser.CefBrowser;
+
+import java.awt.Rectangle;
+
+/**
+ * Implement this interface to handle events if window rendering is enabled.
+ *
+ */
+public interface CefWindowHandler {
+ /**
+ * Retrieve the view rectangle.
+ * @param browser The browser generating the event.
+ * @return The view rectangle.
+ */
+ public Rectangle getRect(CefBrowser browser);
+
+ /**
+ * Implement this method to handle mouse events on Windows.
+ *
+ * The method is called in case of the following events:
+ * MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED and MOUSE_WHEEL for a
+ * horizontal wheel movement.
+ *
+ * @param browser The browser generating the event.
+ * @param event A mouse event like MouseEvent.MOUSE_MOVED.
+ * @param screenX The absolute X position on the screen.
+ * @param screenY The absolute Y position on the screen.
+ * @param modifier The modifier keys down during event (e.g. Shift, Ctrl).
+ * @param button An integer indicating which mouse button state changed.
+ * If parameter event is set to MouseEvent.MOUSE_WHEEL, the value of this
+ * parameter specifies the rotation indicator (negative value for left scroll
+ * and positive value for right scroll).
+ */
+ public void onMouseEvent(
+ CefBrowser browser, int event, int screenX, int screenY, int modifier, int button);
+}
diff --git a/java/org/cef/handler/CefWindowHandlerAdapter.java b/java/org/cef/handler/CefWindowHandlerAdapter.java
index 1e6ad6bd..839c0c7d 100644
--- a/java/org/cef/handler/CefWindowHandlerAdapter.java
+++ b/java/org/cef/handler/CefWindowHandlerAdapter.java
@@ -1,25 +1,25 @@
-// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-package org.cef.handler;
-
-import java.awt.Rectangle;
-
-import org.cef.browser.CefBrowser;
-
-/**
- * An abstract adapter class for receiving windowed render events.
- * The methods in this class are empty.
- * This class exists as convenience for creating handler objects.
- */
-public abstract class CefWindowHandlerAdapter implements CefWindowHandler {
- @Override
- public Rectangle getRect(CefBrowser browser) {
- return new Rectangle(0, 0, 0, 0);
- }
-
- @Override
- public void onMouseEvent(
- CefBrowser browser, int event, int screenX, int screenY, int modifier, int button) {}
-}
+// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+package org.cef.handler;
+
+import org.cef.browser.CefBrowser;
+
+import java.awt.Rectangle;
+
+/**
+ * An abstract adapter class for receiving windowed render events.
+ * The methods in this class are empty.
+ * This class exists as convenience for creating handler objects.
+ */
+public abstract class CefWindowHandlerAdapter implements CefWindowHandler {
+ @Override
+ public Rectangle getRect(CefBrowser browser) {
+ return new Rectangle(0, 0, 0, 0);
+ }
+
+ @Override
+ public void onMouseEvent(
+ CefBrowser browser, int event, int screenX, int screenY, int modifier, int button) {}
+}
diff --git a/java/org/cef/misc/CefPdfPrintSettings.java b/java/org/cef/misc/CefPdfPrintSettings.java
index 554c2925..49afdc28 100644
--- a/java/org/cef/misc/CefPdfPrintSettings.java
+++ b/java/org/cef/misc/CefPdfPrintSettings.java
@@ -15,97 +15,116 @@ public enum MarginType {
// No margins
NONE,
- // Minimum margins.
- MINIMUM,
-
// Custom margins using the values from CefPdfPrintSettings
CUSTOM
}
/**
- * Set to true to print headers and footers or false to not print
- * headers and footers.
+ * Set to true for landscape mode or false for portrait mode.
*/
- public boolean header_footer_enabled;
+ public boolean landscape;
/**
- * Page title to display in the header. Only used if header_footer_enabled
- * is set to true.
+ * Set to true to print background graphics or false to not print
+ * background graphics.
*/
- public String header_footer_title;
+ public boolean print_background;
/**
- * URL to display in the footer. Only used if header_footer_enabled is set
- * to true.
+ * The percentage to scale the PDF by before printing (e.g. .5 is 50%).
+ * If this value is less than or equal to zero the default value of 1.0
+ * will be used.
*/
- public String header_footer_url;
+ public double scale;
/**
- * Set to true for landscape mode or false for portrait mode.
+ * Output paper size in inches. If either of these values is less than or
+ * equal to zero then the default paper size (letter, 8.5 x 11 inches) will
+ * be used.
*/
- public boolean landscape;
+ public double paper_width;
+ public double paper_height;
/**
- * Set to true to print background graphics or false to not print
- * background graphics.
+ * Set to true to prefer page size as defined by css. Defaults to false
+ * in which case the content will be scaled to fit the paper size.
+ */
+ public boolean prefer_css_page_size;
+
+ /**
+ * Margin type.
*/
- public boolean backgrounds_enabled;
+ public MarginType margin_type;
/**
- * Output page size in microns (1 millimeter = 1000 microns). If either of these
- * values is less than or equal to zero then the default paper size will be
- * used as returned by the print_handler. A4 is 210 x 297 mm which would
- * be 210000 x 297000 microns. US Letter is 215.9 x 279.4 mm which would
- * be 215900 x 279400 microns.
+ * Margins in inches. Only used if margin_type is set to CUSTOM.
*/
- public int page_width;
- public int page_height;
+ public double margin_top;
+ public double margin_right;
+ public double margin_bottom;
+ public double margin_left;
/**
- * Set to true to print the selection only or false to print all.
+ * Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed
+ * in the document order, not in the order specified, and no more than once.
+ * Defaults to empty string, which implies the entire document is printed.
+ * The page numbers are quietly capped to actual page count of the document,
+ * and ranges beyond the end of the document are ignored. If this results in
+ * no pages to print, an error is reported. It is an error to specify a range
+ * with start greater than end.
*/
- public boolean selection_only;
+ public String page_ranges;
/**
- * The percentage to scale the PDF by before printing (e.g. 50 is 50%).
- * If this value is less than or equal to zero the default value of 100
- * will be used.
+ * Set to true to print headers and footers or false to not print
+ * headers and footers. Modify header_template and/or footer_template to
+ * customize the display.
*/
- public int scale_factor;
+ public boolean display_header_footer;
/**
- * Margins in points. Only used if |margin_type| is set to
- * PDF_PRINT_MARGIN_CUSTOM.
+ * HTML template for the print header. Only displayed if
+ * |display_header_footer| is true (1). Should be valid HTML markup with
+ * the following classes used to inject printing values into them:
+ *
+ * - date: formatted print date
+ * - title: document title
+ * - url: document location
+ * - pageNumber: current page number
+ * - totalPages: total pages in the document
+ *
+ * For example, "" would generate a span containing
+ * the title.
*/
- public int margin_top;
- public int margin_right;
- public int margin_bottom;
- public int margin_left;
+ public String header_template;
/**
- * Margin type.
+ * HTML template for the print footer. Only displayed if
+ * |display_header_footer| is true (1). Uses the same format as
+ * |header_template|.
*/
- public MarginType margin_type;
+ public String footer_template;
public CefPdfPrintSettings() {}
@Override
public CefPdfPrintSettings clone() {
CefPdfPrintSettings tmp = new CefPdfPrintSettings();
- tmp.header_footer_enabled = this.header_footer_enabled;
- tmp.header_footer_title = this.header_footer_title;
- tmp.header_footer_url = this.header_footer_url;
tmp.landscape = this.landscape;
- tmp.backgrounds_enabled = this.backgrounds_enabled;
- tmp.page_width = this.page_width;
- tmp.page_height = this.page_height;
- tmp.selection_only = this.selection_only;
- tmp.scale_factor = this.scale_factor;
+ tmp.print_background = this.print_background;
+ tmp.scale = this.scale;
+ tmp.paper_width = this.paper_width;
+ tmp.paper_height = this.paper_height;
+ tmp.prefer_css_page_size = this.prefer_css_page_size;
+ tmp.margin_type = this.margin_type;
tmp.margin_top = this.margin_top;
- tmp.margin_right = this.margin_right;
tmp.margin_bottom = this.margin_bottom;
+ tmp.margin_right = this.margin_right;
tmp.margin_left = this.margin_left;
- tmp.margin_type = this.margin_type;
+ tmp.page_ranges = this.page_ranges;
+ tmp.display_header_footer = this.display_header_footer;
+ tmp.header_template = this.header_template;
+ tmp.footer_template = this.footer_template;
return tmp;
}
}
diff --git a/java/tests/detailed/BrowserFrame.java b/java/tests/detailed/BrowserFrame.java
index aa955f7f..dedcd1f8 100644
--- a/java/tests/detailed/BrowserFrame.java
+++ b/java/tests/detailed/BrowserFrame.java
@@ -4,15 +4,16 @@
package tests.detailed;
+import org.cef.CefApp;
+import org.cef.browser.CefBrowser;
+import org.cef.handler.CefLifeSpanHandlerAdapter;
+
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-import org.cef.CefApp;
-import org.cef.browser.CefBrowser;
-import org.cef.handler.CefLifeSpanHandlerAdapter;
-
public class BrowserFrame extends JFrame {
private volatile boolean isClosed_ = false;
private CefBrowser browser_ = null;
diff --git a/java/tests/detailed/MainFrame.java b/java/tests/detailed/MainFrame.java
index f13b321d..afa9d823 100644
--- a/java/tests/detailed/MainFrame.java
+++ b/java/tests/detailed/MainFrame.java
@@ -6,6 +6,7 @@
import org.cef.CefApp;
import org.cef.CefApp.CefVersion;
+import org.cef.CefBrowserSettings;
import org.cef.CefClient;
import org.cef.CefSettings;
import org.cef.CefSettings.ColorType;
@@ -21,6 +22,8 @@
import org.cef.network.CefCookieManager;
import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.GraphicsConfiguration;
import java.awt.KeyboardFocusManager;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
@@ -29,6 +32,7 @@
import javax.swing.JFrame;
import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
import tests.detailed.dialog.DownloadDialog;
import tests.detailed.handler.AppHandler;
@@ -58,6 +62,7 @@ public static void main(String[] args) {
boolean osrEnabledArg = false;
boolean transparentPaintingEnabledArg = false;
boolean createImmediately = false;
+ int windowless_frame_rate = 0;
for (String arg : args) {
arg = arg.toLowerCase();
if (arg.equals("--off-screen-rendering-enabled")) {
@@ -66,6 +71,8 @@ public static void main(String[] args) {
transparentPaintingEnabledArg = true;
} else if (arg.equals("--create-immediately")) {
createImmediately = true;
+ } else if (arg.equals("--windowless-frame-rate-60")) {
+ windowless_frame_rate = 60;
}
}
@@ -73,10 +80,21 @@ public static void main(String[] args) {
// MainFrame keeps all the knowledge to display the embedded browser
// frame.
- final MainFrame frame = new MainFrame(
- osrEnabledArg, transparentPaintingEnabledArg, createImmediately, args);
+ final MainFrame frame = new MainFrame(osrEnabledArg, transparentPaintingEnabledArg,
+ createImmediately, windowless_frame_rate, args);
frame.setSize(800, 600);
frame.setVisible(true);
+
+ if (osrEnabledArg && windowless_frame_rate != 0) {
+ frame.getBrowser().getWindowlessFrameRate().thenAccept(
+ framerate -> System.out.println("Framerate is:" + framerate));
+
+ frame.getBrowser().setWindowlessFrameRate(2);
+ frame.getBrowser().getWindowlessFrameRate().thenAccept(
+ framerate -> System.out.println("Framerate is:" + framerate));
+
+ frame.getBrowser().setWindowlessFrameRate(windowless_frame_rate);
+ }
}
private final CefClient client_;
@@ -86,9 +104,11 @@ public static void main(String[] args) {
private boolean browserFocus_ = true;
private boolean osr_enabled_;
private boolean transparent_painting_enabled_;
+ private JPanel contentPanel_;
+ private JFrame fullscreenFrame_;
public MainFrame(boolean osrEnabled, boolean transparentPaintingEnabled,
- boolean createImmediately, String[] args) {
+ boolean createImmediately, int windowless_frame_rate, String[] args) {
this.osr_enabled_ = osrEnabled;
this.transparent_painting_enabled_ = transparentPaintingEnabled;
@@ -163,6 +183,10 @@ public void onTitleChange(CefBrowser browser, String title) {
public void onStatusMessage(CefBrowser browser, String value) {
status_panel_.setStatusText(value);
}
+ @Override
+ public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ setBrowserFullscreen(fullscreen);
+ }
});
// 2.2) To disable/enable navigation buttons and to display a prgress bar
@@ -175,19 +199,25 @@ public void onStatusMessage(CefBrowser browser, String value) {
@Override
public void onLoadingStateChange(CefBrowser browser, boolean isLoading,
boolean canGoBack, boolean canGoForward) {
- control_pane_.update(browser, isLoading, canGoBack, canGoForward);
- status_panel_.setIsInProgress(isLoading);
-
- if (!isLoading && !errorMsg_.isEmpty()) {
- browser.loadURL(DataUri.create("text/html", errorMsg_));
- errorMsg_ = "";
- }
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ control_pane_.update(browser, isLoading, canGoBack, canGoForward);
+ status_panel_.setIsInProgress(isLoading);
+
+ if (!isLoading && !errorMsg_.isEmpty()) {
+ browser.loadURL(DataUri.create("text/html", errorMsg_));
+ errorMsg_ = "";
+ }
+ }
+ });
}
@Override
public void onLoadError(CefBrowser browser, CefFrame frame, ErrorCode errorCode,
String errorText, String failedUrl) {
- if (errorCode != ErrorCode.ERR_NONE && errorCode != ErrorCode.ERR_ABORTED) {
+ if (errorCode != ErrorCode.ERR_NONE && errorCode != ErrorCode.ERR_ABORTED
+ && frame == browser.getMainFrame()) {
errorMsg_ = "";
errorMsg_ += "Error while loading";
errorMsg_ += "";
@@ -200,14 +230,17 @@ public void onLoadError(CefBrowser browser, CefFrame frame, ErrorCode errorCode,
}
});
+ CefBrowserSettings browserSettings = new CefBrowserSettings();
+ browserSettings.windowless_frame_rate = windowless_frame_rate;
+
// Create the browser.
- CefBrowser browser = client_.createBrowser(
- "http://www.google.com", osrEnabled, transparentPaintingEnabled, null);
+ CefBrowser browser = client_.createBrowser("http://www.google.com", osrEnabled,
+ transparentPaintingEnabled, null, browserSettings);
setBrowser(browser);
// Set up the UI for this example implementation.
- JPanel contentPanel = createContentPanel();
- getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel_ = createContentPanel();
+ getContentPane().add(contentPanel_, BorderLayout.CENTER);
// Clear focus from the browser when the address field gains focus.
control_pane_.getAddressField().addFocusListener(new FocusAdapter() {
@@ -239,7 +272,7 @@ public void onTakeFocus(CefBrowser browser, boolean next) {
if (createImmediately) browser.createImmediately();
// Add the browser to the UI.
- contentPanel.add(getBrowser().getUIComponent(), BorderLayout.CENTER);
+ contentPanel_.add(getBrowser().getUIComponent(), BorderLayout.CENTER);
MenuBar menuBar = new MenuBar(
this, browser, control_pane_, downloadDialog, CefCookieManager.getGlobalManager());
@@ -259,6 +292,8 @@ public void onTakeFocus(CefBrowser browser, boolean next) {
menuBar.addBookmark("Spellcheck Test", "client://tests/spellcheck.html");
menuBar.addBookmark("LocalStorage Test", "client://tests/localstorage.html");
menuBar.addBookmark("Transparency Test", "client://tests/transparency.html");
+ menuBar.addBookmark("Fullscreen Test",
+ "https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_fullscreen2");
menuBar.addBookmarkSeparator();
menuBar.addBookmark(
"javachromiumembedded", "https://bitbucket.org/chromiumembedded/java-cef");
@@ -282,4 +317,33 @@ public boolean isOsrEnabled() {
public boolean isTransparentPaintingEnabled() {
return transparent_painting_enabled_;
}
+
+ public void setBrowserFullscreen(boolean fullscreen) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ Component browserUI = getBrowser().getUIComponent();
+ if (fullscreen) {
+ if (fullscreenFrame_ == null) {
+ fullscreenFrame_ = new JFrame();
+ fullscreenFrame_.setUndecorated(true);
+ fullscreenFrame_.setResizable(true);
+ }
+ GraphicsConfiguration gc = MainFrame.this.getGraphicsConfiguration();
+ fullscreenFrame_.setBounds(gc.getBounds());
+ gc.getDevice().setFullScreenWindow(fullscreenFrame_);
+
+ contentPanel_.remove(browserUI);
+ fullscreenFrame_.add(browserUI);
+ fullscreenFrame_.setVisible(true);
+ fullscreenFrame_.validate();
+ } else {
+ fullscreenFrame_.remove(browserUI);
+ fullscreenFrame_.setVisible(false);
+ contentPanel_.add(browserUI, BorderLayout.CENTER);
+ contentPanel_.validate();
+ }
+ }
+ });
+ }
}
diff --git a/java/tests/detailed/dialog/CookieManagerDialog.java b/java/tests/detailed/dialog/CookieManagerDialog.java
index 40d120e9..279ebbf2 100644
--- a/java/tests/detailed/dialog/CookieManagerDialog.java
+++ b/java/tests/detailed/dialog/CookieManagerDialog.java
@@ -1,148 +1,148 @@
-// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-package tests.detailed.dialog;
-
-import java.awt.BorderLayout;
-import java.awt.Frame;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Date;
-import java.util.Vector;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.table.AbstractTableModel;
-
-import org.cef.callback.CefCookieVisitor;
-import org.cef.misc.BoolRef;
-import org.cef.network.CefCookie;
-import org.cef.network.CefCookieManager;
-
-@SuppressWarnings("serial")
-public class CookieManagerDialog extends JDialog {
- private static int testCookieId = 1;
- private final CefCookieManager manager;
- private final CookieTableModel tblModel = new CookieTableModel();
-
- public CookieManagerDialog(Frame owner, String title, CefCookieManager cookieManager) {
- super(owner, title, false);
- setLayout(new BorderLayout());
- setSize(800, 600);
- manager = cookieManager;
-
- JTable cookieTable = new JTable(tblModel);
- cookieTable.setFillsViewportHeight(true);
-
- JPanel controlPanel = new JPanel();
- controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.X_AXIS));
- JButton delButton = new JButton("Delete cookies");
- delButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- tblModel.removeCookies();
- }
- });
- controlPanel.add(delButton);
-
- JButton testCreateCookie = new JButton("Add test cookie");
- testCreateCookie.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- Date now = new Date();
- Date expires = new Date(now.getTime() + 86400000);
- String name = "testNo" + testCookieId++;
- CefCookie cookie = new CefCookie(name, "testCookie", ".test.cookie", "/", false,
- true, now, now, true, expires);
- if (manager.setCookie("http://my.test.cookie", cookie)) {
- tblModel.visit(cookie, 1, 1, new BoolRef());
- }
- }
- });
- controlPanel.add(testCreateCookie);
-
- JButton doneButton = new JButton("Done");
- doneButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- setVisible(false);
- }
- });
- controlPanel.add(doneButton);
-
- add(new JScrollPane(cookieTable));
- add(controlPanel, BorderLayout.SOUTH);
-
- if (manager == null) throw new NullPointerException("Cookie manager is null");
- manager.visitAllCookies(tblModel);
- }
-
- private class CookieTableModel extends AbstractTableModel implements CefCookieVisitor {
- private final String[] columnNames;
- private Vector
deploy-jcef
- none
+ deploydeploy-file
From 5dc26e5acfb8fbe21fb91cef91ec565f04e1cd25 Mon Sep 17 00:00:00 2001
From: kisal
Date: Wed, 12 Jun 2024 14:17:43 +0530
Subject: [PATCH 31/50] commit for chromium upgrade 1.0.3(v122)
---
CMakeLists.txt | 2 +-
java/org/cef/CefApp.java | 12 +++++-
java/org/cef/CefClient.java | 4 +-
java/org/cef/CefSettings.java | 32 +++++++++++++-
java/org/cef/browser/CefBrowser.java | 6 +--
java/org/cef/browser/CefBrowser_N.java | 16 +++----
java/org/cef/browser/CefFrame.java | 4 +-
java/org/cef/browser/CefFrame_N.java | 6 +--
java/org/cef/handler/CefAppHandler.java | 19 +++++++++
.../org/cef/handler/CefAppHandlerAdapter.java | 17 ++++++--
java/org/cef/handler/CefDisplayHandler.java | 2 +-
.../cef/handler/CefDisplayHandlerAdapter.java | 2 +-
java/org/cef/misc/CefPdfPrintSettings.java | 12 ++++++
java/tests/detailed/MainFrame.java | 2 +-
java/tests/simple/MainFrame.java | 2 +-
native/CefBrowser_N.cpp | 42 ++++++++-----------
native/CefBrowser_N.h | 12 +++---
native/CefFrame_N.cpp | 6 +--
native/CefFrame_N.h | 4 +-
native/browser_process_handler.cpp | 25 +++++++++++
native/browser_process_handler.h | 2 +
native/context.cpp | 5 +++
native/display_handler.cpp | 2 +-
23 files changed, 171 insertions(+), 65 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4135c190..0605a7ac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,7 +130,7 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)
# Specify the CEF distribution version.
if(NOT DEFINED CEF_VERSION)
- set(CEF_VERSION "119.4.7+g55e15c8+chromium-119.0.6045.199")
+ set(CEF_VERSION "122.1.10+gc902316+chromium-122.0.6261.112")
endif()
# Determine the platform.
diff --git a/java/org/cef/CefApp.java b/java/org/cef/CefApp.java
index afd10f04..e623b834 100644
--- a/java/org/cef/CefApp.java
+++ b/java/org/cef/CefApp.java
@@ -102,6 +102,12 @@ public enum CefAppState {
*/
INITIALIZED,
+ /**
+ * CEF initialization has failed (for example due to a second process using
+ * the same root_cache_path).
+ */
+ INITIALIZATION_FAILED,
+
/**
* CefApp is in its shutdown process. All CefClients and CefBrowser
* instances will be disposed. No new CefClient or CefBrowser is allowed to
@@ -424,7 +430,11 @@ public void run() {
}
}
- if (N_Initialize(appHandler_, settings)) setState(CefAppState.INITIALIZED);
+ if (N_Initialize(appHandler_, settings)) {
+ setState(CefAppState.INITIALIZED);
+ } else {
+ setState(CefAppState.INITIALIZATION_FAILED);
+ }
}
};
if (SwingUtilities.isEventDispatchThread())
diff --git a/java/org/cef/CefClient.java b/java/org/cef/CefClient.java
index 7fa5fdaf..786f1789 100644
--- a/java/org/cef/CefClient.java
+++ b/java/org/cef/CefClient.java
@@ -312,9 +312,9 @@ public void onTitleChange(CefBrowser browser, String title) {
}
@Override
- public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ public void onFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
if (displayHandler_ != null && browser != null)
- displayHandler_.OnFullscreenModeChange(browser, fullscreen);
+ displayHandler_.onFullscreenModeChange(browser, fullscreen);
}
@Override
diff --git a/java/org/cef/CefSettings.java b/java/org/cef/CefSettings.java
index 5d756d99..577a96ea 100644
--- a/java/org/cef/CefSettings.java
+++ b/java/org/cef/CefSettings.java
@@ -102,10 +102,39 @@ public ColorType clone() {
* The location where cache data will be stored on disk. If empty an in-memory
* cache will be used for some features and a temporary disk cache for others.
* HTML5 databases such as localStorage will only persist across sessions if a
- * cache path is specified.
+ * cache path is specified. If this is set and root_cache_path is also set, the cache_path
+ * directory must reside within root_cache_path.
*/
public String cache_path = null;
+ /**
+ * The root directory for installation-specific data and the parent directory
+ * for profile-specific data. All CefSettings.cache_path and
+ * CefRequestContextSettings.cache_path values must have this parent
+ * directory in common. If this value is empty and CefSettings.cache_path is
+ * non-empty then it will default to the CefSettings.cache_path value. Any
+ * non-empty value must be an absolute path. If both values are empty then
+ * the default platform-specific directory will be used
+ * ("~/.config/cef_user_data" directory on Linux, "~/Library/Application
+ * Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data"
+ * directory under the user profile directory on Windows). Use of the default
+ * directory is not recommended in production applications (see below).
+ *
+ * Multiple application instances writing to the same root_cache_path
+ * directory could result in data corruption. A process singleton lock based
+ * on the root_cache_path value is therefore used to protect against this.
+ * This singleton behavior applies to all CEF-based applications using
+ * version 120 or newer. You should customize root_cache_path for your
+ * application and implement CefAppHandler::
+ * onAlreadyRunningAppRelaunch, which will then be called on any app relaunch
+ * with the same root_cache_path value.
+ *
+ * Failure to set the root_cache_path value correctly may result in startup
+ * crashes or other unexpected behaviors (for example, the sandbox blocking
+ * read/write access to certain files).
+ */
+ public String root_cache_path = null;
+
/**
* To persist session cookies (cookies without an expiry date or validity
* interval) by default when using the global cookie manager set this value to
@@ -239,6 +268,7 @@ public CefSettings clone() {
tmp.windowless_rendering_enabled = windowless_rendering_enabled;
tmp.command_line_args_disabled = command_line_args_disabled;
tmp.cache_path = cache_path;
+ tmp.root_cache_path = root_cache_path;
tmp.persist_session_cookies = persist_session_cookies;
tmp.user_agent = user_agent;
tmp.user_agent_product = user_agent_product;
diff --git a/java/org/cef/browser/CefBrowser.java b/java/org/cef/browser/CefBrowser.java
index f6c72ee5..437a0192 100644
--- a/java/org/cef/browser/CefBrowser.java
+++ b/java/org/cef/browser/CefBrowser.java
@@ -125,20 +125,20 @@ public interface CefBrowser {
* @param identifier The unique frame identifier
* @return The frame or NULL if not found
*/
- public CefFrame getFrame(long identifier);
+ public CefFrame getFrameByIdentifier(String identifier);
/**
* Returns the frame with the specified name, or NULL if not found.
* @param name The specified name
* @return The frame or NULL if not found
*/
- public CefFrame getFrame(String name);
+ public CefFrame getFrameByName(String name);
/**
* Returns the identifiers of all existing frames.
* @return All identifiers of existing frames.
*/
- public Vector getFrameIdentifiers();
+ public Vector getFrameIdentifiers();
/**
* Returns the names of all existing frames.
diff --git a/java/org/cef/browser/CefBrowser_N.java b/java/org/cef/browser/CefBrowser_N.java
index d7c62e0f..94530dab 100644
--- a/java/org/cef/browser/CefBrowser_N.java
+++ b/java/org/cef/browser/CefBrowser_N.java
@@ -351,9 +351,9 @@ public CefFrame getFocusedFrame() {
}
@Override
- public CefFrame getFrame(long identifier) {
+ public CefFrame getFrameByIdentifier(String identifier) {
try {
- return N_GetFrame(identifier);
+ return N_GetFrameByIdentifier(identifier);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
@@ -361,9 +361,9 @@ public CefFrame getFrame(long identifier) {
}
@Override
- public CefFrame getFrame(String name) {
+ public CefFrame getFrameByName(String name) {
try {
- return N_GetFrame2(name);
+ return N_GetFrameByName(name);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
@@ -371,7 +371,7 @@ public CefFrame getFrame(String name) {
}
@Override
- public Vector getFrameIdentifiers() {
+ public Vector getFrameIdentifiers() {
try {
return N_GetFrameIdentifiers();
} catch (UnsatisfiedLinkError ule) {
@@ -839,9 +839,9 @@ private final native CefRegistration N_AddDevToolsMessageObserver(
private final native int N_GetIdentifier();
private final native CefFrame N_GetMainFrame();
private final native CefFrame N_GetFocusedFrame();
- private final native CefFrame N_GetFrame(long identifier);
- private final native CefFrame N_GetFrame2(String name);
- private final native Vector N_GetFrameIdentifiers();
+ private final native CefFrame N_GetFrameByIdentifier(String identifier);
+ private final native CefFrame N_GetFrameByName(String name);
+ private final native Vector N_GetFrameIdentifiers();
private final native Vector N_GetFrameNames();
private final native int N_GetFrameCount();
private final native boolean N_IsPopup();
diff --git a/java/org/cef/browser/CefFrame.java b/java/org/cef/browser/CefFrame.java
index 280f1e35..a64b4ed9 100644
--- a/java/org/cef/browser/CefFrame.java
+++ b/java/org/cef/browser/CefFrame.java
@@ -14,11 +14,11 @@ public interface CefFrame {
void dispose();
/**
- * Returns the globally unique identifier for this frame or < 0 if the
+ * Returns the globally unique identifier for this frame or an empty string if the
* underlying frame does not yet exist.
* @return The frame identifier
*/
- long getIdentifier();
+ String getIdentifier();
/**
* Emits the URL currently loaded in this frame.
diff --git a/java/org/cef/browser/CefFrame_N.java b/java/org/cef/browser/CefFrame_N.java
index c68e1fbf..0bd1c6af 100644
--- a/java/org/cef/browser/CefFrame_N.java
+++ b/java/org/cef/browser/CefFrame_N.java
@@ -30,12 +30,12 @@ public void dispose() {
}
@Override
- public long getIdentifier() {
+ public String getIdentifier() {
try {
return N_GetIdentifier(getNativeRef(null));
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
- return -1;
+ return null;
}
}
@@ -157,7 +157,7 @@ public void selectAll() {
}
private final native void N_Dispose(long self);
- private final native long N_GetIdentifier(long self);
+ private final native String N_GetIdentifier(long self);
private final native String N_GetURL(long self);
private final native String N_GetName(long self);
private final native boolean N_IsMain(long self);
diff --git a/java/org/cef/handler/CefAppHandler.java b/java/org/cef/handler/CefAppHandler.java
index 095e4747..b6ede710 100644
--- a/java/org/cef/handler/CefAppHandler.java
+++ b/java/org/cef/handler/CefAppHandler.java
@@ -72,4 +72,23 @@ public interface CefAppHandler {
* currently pending scheduled call should be cancelled.
*/
public void onScheduleMessagePumpWork(long delay_ms);
+
+ /**
+ * Implement this method to provide app-specific behavior when an already
+ * running app is relaunched with the same CefSettings.root_cache_path value.
+ * For example, activate an existing app window or create a new app window.
+ * |command_line| will be read-only. Do not keep a reference to
+ * |command_line| outside of this method. Return true if the relaunch is
+ * handled or false for default relaunch behavior. Default behavior will
+ * create a new default styled Chrome window.
+ *
+ * To avoid cache corruption only a single app instance is allowed to run for
+ * a given CefSettings.root_cache_path value. On relaunch the app checks a
+ * process singleton lock and then forwards the new launch arguments to the
+ * already running app process before exiting early. Client apps should
+ * therefore check the CefInitialize() return value for early exit before
+ * proceeding.
+ */
+ public boolean onAlreadyRunningAppRelaunch(
+ CefCommandLine command_line, String current_directory);
}
diff --git a/java/org/cef/handler/CefAppHandlerAdapter.java b/java/org/cef/handler/CefAppHandlerAdapter.java
index 47f7ae53..9947b74c 100644
--- a/java/org/cef/handler/CefAppHandlerAdapter.java
+++ b/java/org/cef/handler/CefAppHandlerAdapter.java
@@ -48,11 +48,13 @@ public void onBeforeCommandLineProcessing(String process_type, CefCommandLine co
case 1: {
// Switches can optionally have a value specified using the '=' delimiter
// (e.g. "-switch=value").
- String[] switchVals = arg.substring(switchCnt).split("=");
- if (switchVals.length == 2) {
- command_line.appendSwitchWithValue(switchVals[0], switchVals[1]);
+ String switchStr = arg.substring(switchCnt);
+ int index = switchStr.indexOf('=');
+ if (index > 0) {
+ command_line.appendSwitchWithValue(
+ switchStr.substring(0, index), switchStr.substring(index + 1));
} else {
- command_line.appendSwitch(switchVals[0]);
+ command_line.appendSwitch(switchStr);
}
break;
}
@@ -89,4 +91,11 @@ public void onContextInitialized() {
public void onScheduleMessagePumpWork(long delay_ms) {
CefApp.getInstance().doMessageLoopWork(delay_ms);
}
+
+ @Override
+ public boolean onAlreadyRunningAppRelaunch(
+ CefCommandLine command_line, String current_directory) {
+ // The default implementation does nothing
+ return false;
+ }
}
diff --git a/java/org/cef/handler/CefDisplayHandler.java b/java/org/cef/handler/CefDisplayHandler.java
index 5913794e..f2a828eb 100644
--- a/java/org/cef/handler/CefDisplayHandler.java
+++ b/java/org/cef/handler/CefDisplayHandler.java
@@ -33,7 +33,7 @@ public interface CefDisplayHandler {
* @param browser The browser generating the event.
* @param fullscreen True if fullscreen mode is on.
*/
- public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen);
+ public void onFullscreenModeChange(CefBrowser browser, boolean fullscreen);
/**
* About to display a tooltip.
diff --git a/java/org/cef/handler/CefDisplayHandlerAdapter.java b/java/org/cef/handler/CefDisplayHandlerAdapter.java
index 302ae6b0..90d22d50 100644
--- a/java/org/cef/handler/CefDisplayHandlerAdapter.java
+++ b/java/org/cef/handler/CefDisplayHandlerAdapter.java
@@ -25,7 +25,7 @@ public void onTitleChange(CefBrowser browser, String title) {
}
@Override
- public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ public void onFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
return;
}
diff --git a/java/org/cef/misc/CefPdfPrintSettings.java b/java/org/cef/misc/CefPdfPrintSettings.java
index 49afdc28..a014d81c 100644
--- a/java/org/cef/misc/CefPdfPrintSettings.java
+++ b/java/org/cef/misc/CefPdfPrintSettings.java
@@ -105,6 +105,16 @@ public enum MarginType {
*/
public String footer_template;
+ /**
+ * Whether or not to generate tagged (accessible) PDF.
+ */
+ public boolean generate_tagged_pdf;
+
+ /**
+ * Whether or not to embed the document outline into the PDF.
+ */
+ public boolean generate_document_outline;
+
public CefPdfPrintSettings() {}
@Override
@@ -125,6 +135,8 @@ public CefPdfPrintSettings clone() {
tmp.display_header_footer = this.display_header_footer;
tmp.header_template = this.header_template;
tmp.footer_template = this.footer_template;
+ tmp.generate_tagged_pdf = this.generate_tagged_pdf;
+ tmp.generate_document_outline = this.generate_document_outline;
return tmp;
}
}
diff --git a/java/tests/detailed/MainFrame.java b/java/tests/detailed/MainFrame.java
index afa9d823..7377a2d1 100644
--- a/java/tests/detailed/MainFrame.java
+++ b/java/tests/detailed/MainFrame.java
@@ -184,7 +184,7 @@ public void onStatusMessage(CefBrowser browser, String value) {
status_panel_.setStatusText(value);
}
@Override
- public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ public void onFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
setBrowserFullscreen(fullscreen);
}
});
diff --git a/java/tests/simple/MainFrame.java b/java/tests/simple/MainFrame.java
index 109ccb2a..44035d0d 100644
--- a/java/tests/simple/MainFrame.java
+++ b/java/tests/simple/MainFrame.java
@@ -133,7 +133,7 @@ public void onAddressChange(CefBrowser browser, CefFrame frame, String url) {
address_.setText(url);
}
@Override
- public void OnFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
+ public void onFullscreenModeChange(CefBrowser browser, boolean fullscreen) {
setBrowserFullscreen(fullscreen);
}
});
diff --git a/native/CefBrowser_N.cpp b/native/CefBrowser_N.cpp
index 92c43636..98b7fb45 100644
--- a/native/CefBrowser_N.cpp
+++ b/native/CefBrowser_N.cpp
@@ -1086,21 +1086,6 @@ void OnAfterParentChanged(CefRefPtr browser) {
}
}
-jobject NewJNILongVector(JNIEnv* env, const std::vector& vals) {
- ScopedJNIObjectLocal jvector(env, "java/util/Vector");
- if (!jvector)
- return nullptr;
-
- std::vector::const_iterator iter;
- for (iter = vals.begin(); iter != vals.end(); ++iter) {
- ScopedJNIObjectLocal argument(
- env, NewJNIObject(env, "java/lang/Long", "(J)V", (jlong)*iter));
- JNI_CALL_VOID_METHOD(env, jvector, "addElement", "(Ljava/lang/Object;)V",
- argument.get());
- }
- return jvector.Release();
-}
-
CefPdfPrintSettings GetJNIPdfPrintSettings(JNIEnv* env, jobject obj) {
CefString tmp;
CefPdfPrintSettings settings;
@@ -1168,6 +1153,12 @@ CefPdfPrintSettings GetJNIPdfPrintSettings(JNIEnv* env, jobject obj) {
tmp.clear();
}
+ GetJNIFieldBoolean(env, cls, obj, "generate_tagged_pdf",
+ &settings.generate_tagged_pdf);
+
+ GetJNIFieldBoolean(env, cls, obj, "generate_document_outline",
+ &settings.generate_document_outline);
+
return settings;
}
@@ -1369,11 +1360,12 @@ Java_org_cef_browser_CefBrowser_1N_N_1GetFocusedFrame(JNIEnv* env,
}
JNIEXPORT jobject JNICALL
-Java_org_cef_browser_CefBrowser_1N_N_1GetFrame(JNIEnv* env,
- jobject obj,
- jlong identifier) {
+Java_org_cef_browser_CefBrowser_1N_N_1GetFrameByIdentifier(JNIEnv* env,
+ jobject obj,
+ jstring identifier) {
CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj, nullptr);
- CefRefPtr frame = browser->GetFrame(identifier);
+ CefRefPtr frame =
+ browser->GetFrameByIdentifier(GetJNIString(env, identifier));
if (!frame)
return nullptr;
ScopedJNIFrame jframe(env, frame);
@@ -1381,11 +1373,11 @@ Java_org_cef_browser_CefBrowser_1N_N_1GetFrame(JNIEnv* env,
}
JNIEXPORT jobject JNICALL
-Java_org_cef_browser_CefBrowser_1N_N_1GetFrame2(JNIEnv* env,
- jobject obj,
- jstring name) {
+Java_org_cef_browser_CefBrowser_1N_N_1GetFrameByName(JNIEnv* env,
+ jobject obj,
+ jstring name) {
CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj, nullptr);
- CefRefPtr frame = browser->GetFrame(GetJNIString(env, name));
+ CefRefPtr frame = browser->GetFrameByName(GetJNIString(env, name));
if (!frame)
return nullptr;
ScopedJNIFrame jframe(env, frame);
@@ -1402,9 +1394,9 @@ JNIEXPORT jobject JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetFrameIdentifiers(JNIEnv* env,
jobject obj) {
CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj, nullptr);
- std::vector identifiers;
+ std::vector identifiers;
browser->GetFrameIdentifiers(identifiers);
- return NewJNILongVector(env, identifiers);
+ return NewJNIStringVector(env, identifiers);
}
JNIEXPORT jobject JNICALL
diff --git a/native/CefBrowser_N.h b/native/CefBrowser_N.h
index f01e1f5a..b0348d5d 100644
--- a/native/CefBrowser_N.h
+++ b/native/CefBrowser_N.h
@@ -164,19 +164,21 @@ Java_org_cef_browser_CefBrowser_1N_N_1GetFocusedFrame(JNIEnv*, jobject);
/*
* Class: org_cef_browser_CefBrowser_N
- * Method: N_GetFrame
- * Signature: (J)Lorg/cef/browser/CefFrame;
+ * Method: N_GetFrameByIdentifier
+ * Signature: (Ljava/lang/String;)Lorg/cef/browser/CefFrame;
*/
JNIEXPORT jobject JNICALL
-Java_org_cef_browser_CefBrowser_1N_N_1GetFrame(JNIEnv*, jobject, jlong);
+Java_org_cef_browser_CefBrowser_1N_N_1GetFrameByIdentifier(JNIEnv*,
+ jobject,
+ jstring);
/*
* Class: org_cef_browser_CefBrowser_N
- * Method: N_GetFrame2
+ * Method: N_GetFrameByName
* Signature: (Ljava/lang/String;)Lorg/cef/browser/CefFrame;
*/
JNIEXPORT jobject JNICALL
-Java_org_cef_browser_CefBrowser_1N_N_1GetFrame2(JNIEnv*, jobject, jstring);
+Java_org_cef_browser_CefBrowser_1N_N_1GetFrameByName(JNIEnv*, jobject, jstring);
/*
* Class: org_cef_browser_CefBrowser_N
diff --git a/native/CefFrame_N.cpp b/native/CefFrame_N.cpp
index 46f039fb..cab338ed 100644
--- a/native/CefFrame_N.cpp
+++ b/native/CefFrame_N.cpp
@@ -27,14 +27,14 @@ JNIEXPORT void JNICALL Java_org_cef_browser_CefFrame_1N_N_1Dispose(JNIEnv* env,
ClearSelf(env, obj);
}
-JNIEXPORT jlong JNICALL
+JNIEXPORT jstring JNICALL
Java_org_cef_browser_CefFrame_1N_N_1GetIdentifier(JNIEnv* env,
jobject obj,
jlong self) {
CefRefPtr frame = GetSelf(self);
if (!frame)
- return (jlong)-1;
- return (jlong)frame->GetIdentifier();
+ return nullptr;
+ return NewJNIString(env, frame->GetIdentifier());
}
JNIEXPORT jstring JNICALL
diff --git a/native/CefFrame_N.h b/native/CefFrame_N.h
index c184d384..a1568181 100644
--- a/native/CefFrame_N.h
+++ b/native/CefFrame_N.h
@@ -19,9 +19,9 @@ JNIEXPORT void JNICALL Java_org_cef_browser_CefFrame_1N_N_1Dispose(JNIEnv*,
/*
* Class: org_cef_browser_CefFrame_N
* Method: N_GetIdentifier
- * Signature: (J)J
+ * Signature: (J)Ljava/lang/String;
*/
-JNIEXPORT jlong JNICALL
+JNIEXPORT jstring JNICALL
Java_org_cef_browser_CefFrame_1N_N_1GetIdentifier(JNIEnv*, jobject, jlong);
/*
diff --git a/native/browser_process_handler.cpp b/native/browser_process_handler.cpp
index 38c8fdca..ad583e87 100644
--- a/native/browser_process_handler.cpp
+++ b/native/browser_process_handler.cpp
@@ -50,6 +50,31 @@ void BrowserProcessHandler::OnScheduleMessagePumpWork(int64_t delay_ms) {
delay_ms);
}
+bool BrowserProcessHandler::OnAlreadyRunningAppRelaunch(
+ CefRefPtr command_line,
+ const CefString& current_directory) {
+ if (!handle_)
+ return false;
+
+ ScopedJNIEnv env;
+ if (!env)
+ return false;
+
+ ScopedJNIObject jcommandLine(
+ env, command_line, "org/cef/callback/CefCommandLine_N", "CefCommandLine");
+ jcommandLine.SetTemporary();
+ ScopedJNIString jcurrentDirectory(env, current_directory);
+
+ jboolean jresult = 0;
+
+ JNI_CALL_BOOLEAN_METHOD(
+ jresult, env, handle_, "onAlreadyRunningAppRelaunch",
+ "(Lorg/cef/callback/CefCommandLine;Ljava/lang/String;)Z",
+ jcommandLine.get(), jcurrentDirectory.get());
+
+ return jresult;
+}
+
// static
CefRefPtr BrowserProcessHandler::GetMessageRouterConfigs() {
int idx = 0;
diff --git a/native/browser_process_handler.h b/native/browser_process_handler.h
index 260ebd66..8bbf29e3 100644
--- a/native/browser_process_handler.h
+++ b/native/browser_process_handler.h
@@ -34,6 +34,8 @@ class BrowserProcessHandler : public CefBrowserProcessHandler {
void OnContextInitialized() override;
void OnScheduleMessagePumpWork(int64_t delay_ms) override;
+ bool OnAlreadyRunningAppRelaunch(CefRefPtr command_line,
+ const CefString& current_directory) override;
static CefRefPtr GetMessageRouterConfigs();
static void AddMessageRouterConfig(const CefMessageRouterConfig& cfg);
diff --git a/native/context.cpp b/native/context.cpp
index 7f894ad9..a9fd67ae 100644
--- a/native/context.cpp
+++ b/native/context.cpp
@@ -44,6 +44,11 @@ CefSettings GetJNISettings(JNIEnv* env, jobject obj) {
CefString(&settings.cache_path) = tmp;
tmp.clear();
}
+ if (GetJNIFieldString(env, cls, obj, "root_cache_path", &tmp) &&
+ !tmp.empty()) {
+ CefString(&settings.root_cache_path) = tmp;
+ tmp.clear();
+ }
GetJNIFieldBoolean(env, cls, obj, "persist_session_cookies",
&settings.persist_session_cookies);
if (GetJNIFieldString(env, cls, obj, "user_agent", &tmp) && !tmp.empty()) {
diff --git a/native/display_handler.cpp b/native/display_handler.cpp
index 33f9e17e..d2fcca8e 100644
--- a/native/display_handler.cpp
+++ b/native/display_handler.cpp
@@ -119,7 +119,7 @@ void DisplayHandler::OnFullscreenModeChange(CefRefPtr browser,
return;
ScopedJNIBrowser jbrowser(env, browser);
- JNI_CALL_VOID_METHOD(env, handle_, "OnFullscreenModeChange",
+ JNI_CALL_VOID_METHOD(env, handle_, "onFullscreenModeChange",
"(Lorg/cef/browser/CefBrowser;Z)V", jbrowser.get(),
(jboolean)fullscreen);
}
From 94b5fb160969c86cbd3e13ab39f1b9a756dc286c Mon Sep 17 00:00:00 2001
From: EnactorDev
Date: Thu, 1 Aug 2024 08:31:57 +0100
Subject: [PATCH 32/50] Mac OS ARM and x86 platform support and code sign is
added
---
native/CMakeLists.txt | 37 ++++++++-
pom.xml | 186 ++++++++++++++++++++++++++++++++++++++++--
2 files changed, 217 insertions(+), 6 deletions(-)
diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt
index 257bd60a..ad2b9c17 100644
--- a/native/CMakeLists.txt
+++ b/native/CMakeLists.txt
@@ -283,6 +283,28 @@ if(OS_MAC)
# Avoid CMP0042 policy errors.
set(CMAKE_MACOSX_RPATH 1)
+
+ if(NOT DEFINED PROJECT_ARCH)
+ message(STATUS "PROJECT_ARCH not defined. Detecting machine architecture.")
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
+ set(PROJECT_ARCH arm64)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
+ set(PROJECT_ARCH x86_64)
+ else()
+ message(FATAL_ERROR "Unsupported machine architecture: ${CMAKE_SYSTEM_PROCESSOR}. Please specify the target architecture using -DPROJECT_ARCH=")
+ endif()
+ endif()
+
+ message(STATUS "Building for architecture: ${PROJECT_ARCH}")
+
+ if(PROJECT_ARCH STREQUAL "x86_64")
+ set(CMAKE_OSX_ARCHITECTURES x86_64)
+ elseif(PROJECT_ARCH STREQUAL "arm64")
+ set(CMAKE_OSX_ARCHITECTURES arm64)
+ else()
+ message(FATAL_ERROR "Unsupported architecture: ${PROJECT_ARCH}")
+ endif()
+
# Avoid CMP0068 policy errors.
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
@@ -370,7 +392,20 @@ if(OS_MAC)
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
OUTPUT_NAME ${_helper_output_name}
)
-
+ set_target_properties(${JCEF_TARGET} PROPERTIES
+ # XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${ENACTOR_CODE_SIGN_IDENTITY}
+ XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${ENACTOR_DEVELOPMENT_TEAM}
+ # XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES"
+ # XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep"
+ )
+ set_target_properties(${JCEF_HELPER_TARGET} PROPERTIES
+ # XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${ENACTOR_CODE_SIGN_IDENTITY}
+ XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${ENACTOR_DEVELOPMENT_TEAM}
+ # XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES"
+ # XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep"
+ )
if(USE_SANDBOX)
target_link_libraries(${_helper_target} cef_sandbox_lib)
endif()
diff --git a/pom.xml b/pom.xml
index d1c052ba..7ee6a8b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -722,12 +722,12 @@
-
- generate-mac
+ generate-mac-amd64mac
+ x86_64
@@ -753,11 +753,14 @@
+
-
+
+
+
@@ -839,7 +842,7 @@
- chromium-binaries-mac
+ chromium-binaries-${distribution.arch}assemble-mac-os.xml
@@ -876,7 +879,7 @@
deploy-file
- ${basedir}/target/chromium-binaries-mac.zip
+ ${basedir}/target/chromium-binaries-${distribution.arch}.zip${repository.id}${repository.url}com.enactor.chromium
@@ -890,6 +893,179 @@
+
+ generate-mac-arm64
+
+
+ mac
+ arm64
+
+
+
+ macosx64
+ macos-arm64
+
+
+
+
+ com.googlecode.cmake-maven-project
+ cmake-maven-plugin
+
+
+ cmake-generate-mac
+
+ generate
+
+
+ ${basedir}
+ ${basedir}/jcef_build
+ Xcode
+ mac-x86_64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cmake-compile-mac
+
+ compile
+
+
+ Release
+ ${basedir}/jcef_build
+ mac-x86_64
+
+
+
+
+
+
+
+ maven-antrun-plugin
+
+
+ package
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+ maven-install-plugin
+
+
+ deploy-jcef
+ install
+
+ install-file
+
+
+ ${basedir}/jcef_build/native/Release/jcef.jar/
+ com.enactor.core
+ jcef
+ ${project.version}
+ jar
+
+
+
+ deploy-jcef-test
+ install
+
+ install-file
+
+
+ ${basedir}/jcef_build/native/Release/jcef-tests.jar/
+ com.enactor.core
+ jcef-tests
+ ${project.version}
+ jar
+
+
+
+
+
+ maven-assembly-plugin
+
+
+ package
+
+ single
+
+
+
+
+ chromium-binaries-${distribution.arch}
+
+ assemble-mac-os.xml
+
+ false
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ ${skip.deploy}
+
+
+
+ deploy-jcef
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/jcef_build/native/Release/jcef.jar
+ ${repository.id}
+ ${repository.url}
+ com.enactor.core
+ jcef
+ ${project.version}
+ jar
+
+
+
+ deploy-native-binaries
+ deploy
+
+ deploy-file
+
+
+ ${basedir}/target/chromium-binaries-${distribution.arch}.zip
+ ${repository.id}
+ ${repository.url}
+ com.enactor.chromium
+ mac-binaries
+ ${project.version}
+ zip
+
+
+
+
+
+
+
+
+
From 7073516b59708ea7670a5bc5b9e6e539802f3aab Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Thu, 22 Aug 2024 09:40:32 +0530
Subject: [PATCH 33/50] Adding distribution architecture to artifact id to
separate two architectures without overriding teh same pom.xml
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7ee6a8b1..a3b11bd9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -883,7 +883,7 @@
${repository.id}${repository.url}com.enactor.chromium
- mac-binaries
+ mac-binaries-${distribution.arch}${project.version}zip
@@ -1054,7 +1054,7 @@
${repository.id}${repository.url}com.enactor.chromium
- mac-binaries
+ mac-binaries-${distribution.arch}${project.version}zip
From 8ca270f8996b4a55daea8861737c5719c4c675b2 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Thu, 22 Aug 2024 16:21:22 +0530
Subject: [PATCH 34/50] Adding classifier tag instead of the artifact id
classifier
---
pom.xml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index a3b11bd9..d5802605 100644
--- a/pom.xml
+++ b/pom.xml
@@ -883,8 +883,9 @@
${repository.id}${repository.url}com.enactor.chromium
- mac-binaries-${distribution.arch}
+ mac-binaries${project.version}
+ ${distribution.arch}zip
@@ -1054,8 +1055,9 @@
${repository.id}${repository.url}com.enactor.chromium
- mac-binaries-${distribution.arch}
+ mac-binaries${project.version}
+ ${distribution.arch}zip
From 3e3fed1877cb8f72b8bd6a7e11a8b3e1e6468407 Mon Sep 17 00:00:00 2001
From: kisalrandy
Date: Wed, 27 Nov 2024 12:52:59 +0530
Subject: [PATCH 35/50] upgrade to v130_java_native_changes
---
CMakeLists.txt | 2 +-
java/org/cef/CefClient.java | 19 +++++---
java/org/cef/CefSettings.java | 10 ----
java/org/cef/browser/CefBrowser.java | 15 +++---
java/org/cef/browser/CefBrowser_N.java | 16 +++----
java/org/cef/handler/CefDialogHandler.java | 8 +++-
java/org/cef/handler/CefDownloadHandler.java | 10 ++--
.../handler/CefDownloadHandlerAdapter.java | 6 ++-
java/org/cef/handler/CefLoadHandler.java | 7 ---
java/org/cef/handler/CefRequestHandler.java | 9 +++-
.../cef/handler/CefRequestHandlerAdapter.java | 3 +-
.../tests/detailed/dialog/DevToolsDialog.java | 8 ++--
.../tests/detailed/dialog/DownloadDialog.java | 4 +-
.../detailed/handler/RequestHandler.java | 6 ++-
java/tests/junittests/TestFrame.java | 3 +-
native/CMakeLists.txt | 41 +----------------
native/CefBrowser_N.cpp | 46 +++++++++++--------
native/context.cpp | 21 ++-------
native/dialog_handler.cpp | 25 ++++++----
native/dialog_handler.h | 2 +
native/download_handler.cpp | 14 ++++--
native/download_handler.h | 2 +-
native/jni_util.cpp | 14 ------
native/request_handler.cpp | 21 ++++++---
native/request_handler.h | 4 +-
native/signal_restore_posix.cpp | 38 ---------------
native/signal_restore_posix.h | 11 -----
27 files changed, 146 insertions(+), 219 deletions(-)
delete mode 100644 native/signal_restore_posix.cpp
delete mode 100644 native/signal_restore_posix.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0605a7ac..a5f700c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,7 +130,7 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON)
# Specify the CEF distribution version.
if(NOT DEFINED CEF_VERSION)
- set(CEF_VERSION "122.1.10+gc902316+chromium-122.0.6261.112")
+ set(CEF_VERSION "130.1.9+gfc42567+chromium-130.0.6723.70")
endif()
# Determine the platform.
diff --git a/java/org/cef/CefClient.java b/java/org/cef/CefClient.java
index 786f1789..687be93d 100644
--- a/java/org/cef/CefClient.java
+++ b/java/org/cef/CefClient.java
@@ -280,10 +280,11 @@ public void removeDialogHandler() {
@Override
public boolean onFileDialog(CefBrowser browser, FileDialogMode mode, String title,
- String defaultFilePath, Vector acceptFilters, CefFileDialogCallback callback) {
+ String defaultFilePath, Vector acceptFilters, Vector acceptExtensions,
+ Vector acceptDescriptions, CefFileDialogCallback callback) {
if (dialogHandler_ != null && browser != null) {
- return dialogHandler_.onFileDialog(
- browser, mode, title, defaultFilePath, acceptFilters, callback);
+ return dialogHandler_.onFileDialog(browser, mode, title, defaultFilePath, acceptFilters,
+ acceptExtensions, acceptDescriptions, callback);
}
return false;
}
@@ -371,10 +372,12 @@ public void removeDownloadHandler() {
}
@Override
- public void onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
+ public boolean onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
String suggestedName, CefBeforeDownloadCallback callback) {
if (downloadHandler_ != null && browser != null)
- downloadHandler_.onBeforeDownload(browser, downloadItem, suggestedName, callback);
+ return downloadHandler_.onBeforeDownload(
+ browser, downloadItem, suggestedName, callback);
+ return false;
}
@Override
@@ -849,8 +852,10 @@ public boolean onCertificateError(
}
@Override
- public void onRenderProcessTerminated(CefBrowser browser, TerminationStatus status) {
- if (requestHandler_ != null) requestHandler_.onRenderProcessTerminated(browser, status);
+ public void onRenderProcessTerminated(
+ CefBrowser browser, TerminationStatus status, int error_code, String error_string) {
+ if (requestHandler_ != null)
+ requestHandler_.onRenderProcessTerminated(browser, status, error_code, error_string);
}
// CefWindowHandler
diff --git a/java/org/cef/CefSettings.java b/java/org/cef/CefSettings.java
index 577a96ea..83bb1fcc 100644
--- a/java/org/cef/CefSettings.java
+++ b/java/org/cef/CefSettings.java
@@ -210,15 +210,6 @@ public ColorType clone() {
*/
public String locales_dir_path = null;
- /**
- * Set to true to disable loading of pack files for resources and locales.
- * A resource bundle handler must be provided for the browser and render
- * processes via CefApp::GetResourceBundleHandler() if loading of pack files
- * is disabled. Also configurable using the "disable-pack-loading" command-
- * line switch.
- */
- public boolean pack_loading_disabled = false;
-
/**
* Set to a value between 1024 and 65535 to enable remote debugging on the
* specified port. For example, if 8080 is specified the remote debugging URL
@@ -278,7 +269,6 @@ public CefSettings clone() {
tmp.javascript_flags = javascript_flags;
tmp.resources_dir_path = resources_dir_path;
tmp.locales_dir_path = locales_dir_path;
- tmp.pack_loading_disabled = pack_loading_disabled;
tmp.remote_debugging_port = remote_debugging_port;
tmp.uncaught_exception_stack_size = uncaught_exception_stack_size;
if (background_color != null) tmp.background_color = background_color.clone();
diff --git a/java/org/cef/browser/CefBrowser.java b/java/org/cef/browser/CefBrowser.java
index 437a0192..96f8e1ab 100644
--- a/java/org/cef/browser/CefBrowser.java
+++ b/java/org/cef/browser/CefBrowser.java
@@ -337,18 +337,21 @@ public void runFileDialog(FileDialogMode mode, String title, String defaultFileP
public void stopFinding(boolean clearSelection);
/**
- * Get an instance of the DevTools to be displayed in its own window or to be
- * embedded within your UI. Only one instance per browser is available.
+ * Get an instance of the DevTools to be displayed in its own window.
*/
- public CefBrowser getDevTools();
+ public void openDevTools();
/**
- * Get an instance of the DevTools to be displayed in its own window or to be
- * embedded within your UI. Only one instance per browser is available.
+ * Open an instance of the DevTools to be displayed in its own window.
*
* @param inspectAt a position in the UI which should be inspected.
*/
- public CefBrowser getDevTools(Point inspectAt);
+ public void openDevTools(Point inspectAt);
+
+ /**
+ * Close the DevTools.
+ */
+ public void closeDevTools();
/**
* Get an instance of a client that can be used to leverage the DevTools
diff --git a/java/org/cef/browser/CefBrowser_N.java b/java/org/cef/browser/CefBrowser_N.java
index 94530dab..e46327f1 100644
--- a/java/org/cef/browser/CefBrowser_N.java
+++ b/java/org/cef/browser/CefBrowser_N.java
@@ -45,7 +45,6 @@ abstract class CefBrowser_N extends CefNativeAdapter implements CefBrowser {
private final CefRequestContext request_context_;
private volatile CefBrowser_N parent_ = null;
private volatile Point inspectAt_ = null;
- private volatile CefBrowser_N devTools_ = null;
private volatile CefDevToolsClient devToolsClient_ = null;
private boolean closeAllowed_ = false;
private volatile boolean isClosed_ = false;
@@ -134,7 +133,6 @@ public synchronized void onBeforeClose() {
if (request_context_ != null) request_context_.dispose();
if (parent_ != null) {
parent_.closeDevTools();
- parent_.devTools_ = null;
parent_ = null;
}
if (devToolsClient_ != null) {
@@ -143,16 +141,13 @@ public synchronized void onBeforeClose() {
}
@Override
- public CefBrowser getDevTools() {
- return getDevTools(null);
+ public void openDevTools() {
+ openDevTools(null);
}
@Override
- public synchronized CefBrowser getDevTools(Point inspectAt) {
- if (devTools_ == null) {
- devTools_ = createDevToolsBrowser(client_, url_, request_context_, this, inspectAt);
- }
- return devTools_;
+ public synchronized void openDevTools(Point inspectAt) {
+ createDevToolsBrowser(client_, url_, request_context_, this, inspectAt).createImmediately();
}
@Override
@@ -594,7 +589,8 @@ public void stopFinding(boolean clearSelection) {
}
}
- protected final void closeDevTools() {
+ @Override
+ public void closeDevTools() {
try {
N_CloseDevTools();
} catch (UnsatisfiedLinkError ule) {
diff --git a/java/org/cef/handler/CefDialogHandler.java b/java/org/cef/handler/CefDialogHandler.java
index 311de4cb..12ffdea7 100644
--- a/java/org/cef/handler/CefDialogHandler.java
+++ b/java/org/cef/handler/CefDialogHandler.java
@@ -38,11 +38,17 @@ enum FileDialogMode {
* "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
* combined description and file extension delimited using "|" and ";" (e.g.
* "Image Types|.png;.gif;.jpg").
+ * @param acceptExtensions provides the semicolon-delimited expansion of MIME
+ * types to file extensions (if known, or empty string otherwise).
+ * @param acceptDescriptions provides the descriptions for MIME types (if known,
+ * or empty string otherwise). For example, the "image/*" mime type might
+ * have extensions ".png;.jpg;.bmp;..." and description "Image Files".
* @param callback is a callback handler for handling own file dialogs.
*
* @return To display a custom dialog return true and execute callback.
* To display the default dialog return false.
*/
public boolean onFileDialog(CefBrowser browser, FileDialogMode mode, String title,
- String defaultFilePath, Vector acceptFilters, CefFileDialogCallback callback);
+ String defaultFilePath, Vector acceptFilters, Vector acceptExtensions,
+ Vector acceptDescriptions, CefFileDialogCallback callback);
}
diff --git a/java/org/cef/handler/CefDownloadHandler.java b/java/org/cef/handler/CefDownloadHandler.java
index 66ea49a4..3f0ee6f2 100644
--- a/java/org/cef/handler/CefDownloadHandler.java
+++ b/java/org/cef/handler/CefDownloadHandler.java
@@ -15,9 +15,11 @@
*/
public interface CefDownloadHandler {
/**
- * Called before a download begins. By default the download will be canceled.
- * Execute callback either asynchronously or in this method to continue the download
- * if desired.
+ * Called before a download begins. Return true and execute |callback| either
+ * asynchronously or in this method to continue or cancel the download.
+ * Return false to proceed with default handling (cancel with Alloy style,
+ * download shelf with Chrome style). Do not keep a reference to
+ * downloadItem outside of this method.
*
* @param browser The desired browser.
* @param downloadItem The item to be downloaded. Do not keep a reference to it outside this
@@ -25,7 +27,7 @@ public interface CefDownloadHandler {
* @param suggestedName is the suggested name for the download file.
* @param callback start the download by calling the Continue method
*/
- public void onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
+ public boolean onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
String suggestedName, CefBeforeDownloadCallback callback);
/**
diff --git a/java/org/cef/handler/CefDownloadHandlerAdapter.java b/java/org/cef/handler/CefDownloadHandlerAdapter.java
index 8b1f46aa..f0311637 100644
--- a/java/org/cef/handler/CefDownloadHandlerAdapter.java
+++ b/java/org/cef/handler/CefDownloadHandlerAdapter.java
@@ -16,8 +16,10 @@
*/
public abstract class CefDownloadHandlerAdapter implements CefDownloadHandler {
@Override
- public void onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
- String suggestedName, CefBeforeDownloadCallback callback) {}
+ public boolean onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
+ String suggestedName, CefBeforeDownloadCallback callback) {
+ return false;
+ }
@Override
public void onDownloadUpdated(
diff --git a/java/org/cef/handler/CefLoadHandler.java b/java/org/cef/handler/CefLoadHandler.java
index af50686e..4f0bb831 100644
--- a/java/org/cef/handler/CefLoadHandler.java
+++ b/java/org/cef/handler/CefLoadHandler.java
@@ -213,13 +213,6 @@ enum ErrorCode {
ERR_INVALID_WEB_BUNDLE(-505),
ERR_TRUST_TOKEN_OPERATION_FAILED(-506),
ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST(-507),
- ERR_FTP_FAILED(-601),
- ERR_FTP_SERVICE_UNAVAILABLE(-602),
- ERR_FTP_TRANSFER_ABORTED(-603),
- ERR_FTP_FILE_BUSY(-604),
- ERR_FTP_SYNTAX_ERROR(-605),
- ERR_FTP_COMMAND_NOT_SUPPORTED(-606),
- ERR_FTP_BAD_COMMAND_SEQUENCE(-607),
ERR_PKCS12_IMPORT_BAD_PASSWORD(-701),
ERR_PKCS12_IMPORT_FAILED(-702),
ERR_IMPORT_CA_CERT_NOT_CA(-703),
diff --git a/java/org/cef/handler/CefRequestHandler.java b/java/org/cef/handler/CefRequestHandler.java
index 7a508323..93cbe95b 100644
--- a/java/org/cef/handler/CefRequestHandler.java
+++ b/java/org/cef/handler/CefRequestHandler.java
@@ -24,7 +24,9 @@ enum TerminationStatus {
TS_ABNORMAL_TERMINATION, //!< Non-zero exit status.
TS_PROCESS_WAS_KILLED, //!< SIGKILL or task manager kill.
TS_PROCESS_CRASHED, //!< Segmentation fault.
- TS_PROCESS_OOM //!< Out of memory.
+ TS_PROCESS_OOM, //!< Out of memory.
+ TS_LAUNCH_FAILED, //!< Failed to launch.
+ TS_INTEGRITY_FAILURE //!< Integrity check failed.
}
/**
@@ -123,6 +125,9 @@ boolean onCertificateError(CefBrowser browser, CefLoadHandler.ErrorCode cert_err
* Called on the browser process UI thread when the render process terminates unexpectedly.
* @param browser The corresponding browser.
* @param status Indicates how the process was terminated.
+ * @param error_code The process error code.
+ * @param error_string A string description of the error.
*/
- void onRenderProcessTerminated(CefBrowser browser, TerminationStatus status);
+ void onRenderProcessTerminated(
+ CefBrowser browser, TerminationStatus status, int error_code, String error_string);
}
diff --git a/java/org/cef/handler/CefRequestHandlerAdapter.java b/java/org/cef/handler/CefRequestHandlerAdapter.java
index dd785529..a6c04ef6 100644
--- a/java/org/cef/handler/CefRequestHandlerAdapter.java
+++ b/java/org/cef/handler/CefRequestHandlerAdapter.java
@@ -51,5 +51,6 @@ public boolean onCertificateError(
}
@Override
- public void onRenderProcessTerminated(CefBrowser browser, TerminationStatus status) {}
+ public void onRenderProcessTerminated(
+ CefBrowser browser, TerminationStatus status, int error_code, String error_string) {}
}
diff --git a/java/tests/detailed/dialog/DevToolsDialog.java b/java/tests/detailed/dialog/DevToolsDialog.java
index d1fb3d8d..07a61809 100644
--- a/java/tests/detailed/dialog/DevToolsDialog.java
+++ b/java/tests/detailed/dialog/DevToolsDialog.java
@@ -16,20 +16,20 @@
@SuppressWarnings("serial")
public class DevToolsDialog extends JDialog {
- private final CefBrowser devTools_;
+ private final CefBrowser browser_;
public DevToolsDialog(Frame owner, String title, CefBrowser browser) {
this(owner, title, browser, null);
}
public DevToolsDialog(Frame owner, String title, CefBrowser browser, Point inspectAt) {
super(owner, title, false);
+ browser_ = browser;
setLayout(new BorderLayout());
setSize(800, 600);
setLocation(owner.getLocation().x + 20, owner.getLocation().y + 20);
- devTools_ = browser.getDevTools(inspectAt);
- add(devTools_.getUIComponent());
+ browser.openDevTools(inspectAt);
addComponentListener(new ComponentAdapter() {
@Override
@@ -41,7 +41,7 @@ public void componentHidden(ComponentEvent e) {
@Override
public void dispose() {
- devTools_.close(true);
+ browser_.closeDevTools();
super.dispose();
}
}
diff --git a/java/tests/detailed/dialog/DownloadDialog.java b/java/tests/detailed/dialog/DownloadDialog.java
index f9717a50..c3ffaeac 100644
--- a/java/tests/detailed/dialog/DownloadDialog.java
+++ b/java/tests/detailed/dialog/DownloadDialog.java
@@ -143,13 +143,15 @@ void update(CefDownloadItem downloadItem, CefDownloadItemCallback callback) {
}
@Override
- public void onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
+ public boolean onBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem,
String suggestedName, CefBeforeDownloadCallback callback) {
callback.Continue(suggestedName, true);
DownloadObject dlObject = new DownloadObject(downloadItem, suggestedName);
downloadObjects_.put(downloadItem.getId(), dlObject);
downloadPanel_.add(dlObject);
+
+ return true;
}
@Override
diff --git a/java/tests/detailed/handler/RequestHandler.java b/java/tests/detailed/handler/RequestHandler.java
index d80e1251..44d102a5 100644
--- a/java/tests/detailed/handler/RequestHandler.java
+++ b/java/tests/detailed/handler/RequestHandler.java
@@ -161,7 +161,9 @@ public boolean onCertificateError(
}
@Override
- public void onRenderProcessTerminated(CefBrowser browser, TerminationStatus status) {
- System.out.println("render process terminated: " + status);
+ public void onRenderProcessTerminated(
+ CefBrowser browser, TerminationStatus status, int error_code, String error_string) {
+ System.out.println("render process terminated: " + status + " errorCode: " + error_code
+ + " errorString: " + error_string);
}
}
diff --git a/java/tests/junittests/TestFrame.java b/java/tests/junittests/TestFrame.java
index b789544c..eee36305 100644
--- a/java/tests/junittests/TestFrame.java
+++ b/java/tests/junittests/TestFrame.java
@@ -243,7 +243,8 @@ public boolean onCertificateError(CefBrowser browser, CefLoadHandler.ErrorCode c
}
@Override
- public void onRenderProcessTerminated(CefBrowser browser, TerminationStatus status) {}
+ public void onRenderProcessTerminated(
+ CefBrowser browser, TerminationStatus status, int error_code, String error_string) {}
// CefResourceRequestHandler methods:
diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt
index ad2b9c17..aef58415 100644
--- a/native/CMakeLists.txt
+++ b/native/CMakeLists.txt
@@ -146,8 +146,6 @@ set(JCEF_SRCS
set(JCEF_SRCS_LINUX
critical_wait_posix.cpp
jni_util_linux.cpp
- signal_restore_posix.cpp
- signal_restore_posix.h
temp_window_x11.cc
temp_window_x11.h
util_linux.cpp
@@ -155,8 +153,6 @@ set(JCEF_SRCS_LINUX
)
set(JCEF_SRCS_MAC
critical_wait_posix.cpp
- signal_restore_posix.cpp
- signal_restore_posix.h
temp_window_mac.h
temp_window_mac.mm
util_mac.h
@@ -283,28 +279,6 @@ if(OS_MAC)
# Avoid CMP0042 policy errors.
set(CMAKE_MACOSX_RPATH 1)
-
- if(NOT DEFINED PROJECT_ARCH)
- message(STATUS "PROJECT_ARCH not defined. Detecting machine architecture.")
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
- set(PROJECT_ARCH arm64)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
- set(PROJECT_ARCH x86_64)
- else()
- message(FATAL_ERROR "Unsupported machine architecture: ${CMAKE_SYSTEM_PROCESSOR}. Please specify the target architecture using -DPROJECT_ARCH=")
- endif()
- endif()
-
- message(STATUS "Building for architecture: ${PROJECT_ARCH}")
-
- if(PROJECT_ARCH STREQUAL "x86_64")
- set(CMAKE_OSX_ARCHITECTURES x86_64)
- elseif(PROJECT_ARCH STREQUAL "arm64")
- set(CMAKE_OSX_ARCHITECTURES arm64)
- else()
- message(FATAL_ERROR "Unsupported architecture: ${PROJECT_ARCH}")
- endif()
-
# Avoid CMP0068 policy errors.
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
@@ -392,20 +366,7 @@ if(OS_MAC)
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
OUTPUT_NAME ${_helper_output_name}
)
- set_target_properties(${JCEF_TARGET} PROPERTIES
- # XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${ENACTOR_CODE_SIGN_IDENTITY}
- XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${ENACTOR_DEVELOPMENT_TEAM}
- # XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES"
- # XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep"
- )
- set_target_properties(${JCEF_HELPER_TARGET} PROPERTIES
- # XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${ENACTOR_CODE_SIGN_IDENTITY}
- XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${ENACTOR_DEVELOPMENT_TEAM}
- # XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES"
- # XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep"
- )
+
if(USE_SANDBOX)
target_link_libraries(${_helper_target} cef_sandbox_lib)
endif()
diff --git a/native/CefBrowser_N.cpp b/native/CefBrowser_N.cpp
index 98b7fb45..0e5f8118 100644
--- a/native/CefBrowser_N.cpp
+++ b/native/CefBrowser_N.cpp
@@ -940,7 +940,29 @@ void create(std::shared_ptr objs,
if (!lifeSpanHandler.get())
return;
+ CefRefPtr parentBrowser =
+ GetCefFromJNIObject(env, objs->jparentBrowser, "CefBrowser");
+
CefWindowInfo windowInfo;
+ CefBrowserSettings settings;
+
+ // If parentBrowser is set, we want to show the DEV-Tools for that browser.
+ // Since that cannot be an Alloy-style window, it cannot be integrated into
+ // Java UI but must be opened as a pop-up.
+ if (parentBrowser.get() != nullptr) {
+ CefPoint inspectAt;
+ if (objs->jinspectAt != nullptr) {
+ int x, y;
+ GetJNIPoint(env, objs->jinspectAt, &x, &y);
+ inspectAt.Set(x, y);
+ }
+
+ parentBrowser->GetHost()->ShowDevTools(windowInfo, clientHandler.get(),
+ settings, inspectAt);
+ JNI_CALL_VOID_METHOD(env, objs->jbrowser, "notifyBrowserCreated", "()V");
+ return;
+ }
+
if (osr == JNI_FALSE) {
CefRect rect;
CefRefPtr windowHandler =
@@ -978,8 +1000,6 @@ void create(std::shared_ptr objs,
windowInfo.SetAsWindowless((CefWindowHandle)windowHandle);
}
- CefBrowserSettings settings;
-
if (transparent == JNI_FALSE) {
// Specify an opaque background color (white) to disable transparency.
settings.background_color = CefColorSetARGB(255, 255, 255, 255);
@@ -998,27 +1018,10 @@ void create(std::shared_ptr objs,
CefRefPtr context = GetCefFromJNIObject(
env, objs->jcontext, "CefRequestContext");
- CefRefPtr parentBrowser =
- GetCefFromJNIObject(env, objs->jparentBrowser, "CefBrowser");
-
// Add a global ref that will be released in LifeSpanHandler::OnAfterCreated.
jobject globalRef = env->NewGlobalRef(objs->jbrowser);
lifeSpanHandler->registerJBrowser(globalRef);
- // If parentBrowser is set, we want to show the DEV-Tools for that browser
- if (parentBrowser.get() != nullptr) {
- CefPoint inspectAt;
- if (objs->jinspectAt != nullptr) {
- int x, y;
- GetJNIPoint(env, objs->jinspectAt, &x, &y);
- inspectAt.Set(x, y);
- }
- parentBrowser->GetHost()->ShowDevTools(windowInfo, clientHandler.get(),
- settings, inspectAt);
- JNI_CALL_VOID_METHOD(env, objs->jbrowser, "notifyBrowserCreated", "()V");
- return;
- }
-
CefRefPtr extra_info;
auto router_configs = BrowserProcessHandler::GetMessageRouterConfigs();
if (router_configs) {
@@ -1027,6 +1030,10 @@ void create(std::shared_ptr objs,
extra_info->SetList("router_configs", router_configs);
}
+ // JCEF requires Alloy runtime style for "normal" browsers in order for them
+ // to be integratable into Java UI.
+ windowInfo.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
+
bool result = CefBrowserHost::CreateBrowser(
windowInfo, clientHandler.get(), strUrl, settings, extra_info, context);
if (!result) {
@@ -1524,7 +1531,6 @@ Java_org_cef_browser_CefBrowser_1N_N_1SetWindowVisibility(JNIEnv* env,
}
#endif
}
-
JNIEXPORT jdouble JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetZoomLevel(JNIEnv* env, jobject obj) {
CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj, 0.0);
diff --git a/native/context.cpp b/native/context.cpp
index a9fd67ae..beb553f1 100644
--- a/native/context.cpp
+++ b/native/context.cpp
@@ -13,10 +13,6 @@
#include "util_mac.h"
#endif
-#if defined(OS_POSIX)
-#include "signal_restore_posix.h"
-#endif
-
namespace {
Context* g_context = nullptr;
@@ -24,6 +20,11 @@ Context* g_context = nullptr;
CefSettings GetJNISettings(JNIEnv* env, jobject obj) {
CefString tmp;
CefSettings settings;
+
+#if defined(OS_POSIX) && !defined(OS_ANDROID)
+ settings.disable_signal_handlers = true;
+#endif
+
if (!obj)
return settings;
@@ -106,8 +107,6 @@ CefSettings GetJNISettings(JNIEnv* env, jobject obj) {
CefString(&settings.locales_dir_path) = tmp;
tmp.clear();
}
- GetJNIFieldBoolean(env, cls, obj, "pack_loading_disabled",
- &settings.pack_loading_disabled);
GetJNIFieldInt(env, cls, obj, "remote_debugging_port",
&settings.remote_debugging_port);
GetJNIFieldInt(env, cls, obj, "uncaught_exception_stack_size",
@@ -226,12 +225,6 @@ bool Context::Initialize(JNIEnv* env,
new ClientApp(CefString(&settings.cache_path), env, appHandler));
bool res = false;
-#if defined(OS_POSIX)
- // CefInitialize will reset signal handlers. Backup/restore the original
- // signal handlers to avoid crashes in the JVM (see issue #41).
- BackupSignalHandlers();
-#endif
-
#if defined(OS_MACOSX)
res = util_mac::CefInitializeOnMainThread(main_args, settings,
client_app.get());
@@ -239,10 +232,6 @@ bool Context::Initialize(JNIEnv* env,
res = CefInitialize(main_args, settings, client_app.get(), nullptr);
#endif
-#if defined(OS_POSIX)
- RestoreSignalHandlers();
-#endif
-
return res;
}
diff --git a/native/dialog_handler.cpp b/native/dialog_handler.cpp
index 30acb467..883f675f 100644
--- a/native/dialog_handler.cpp
+++ b/native/dialog_handler.cpp
@@ -27,12 +27,15 @@ class ScopedJNIFileDialogCallback
DialogHandler::DialogHandler(JNIEnv* env, jobject handler)
: handle_(env, handler) {}
-bool DialogHandler::OnFileDialog(CefRefPtr browser,
- FileDialogMode mode,
- const CefString& title,
- const CefString& default_file_path,
- const std::vector& accept_filters,
- CefRefPtr callback) {
+bool DialogHandler::OnFileDialog(
+ CefRefPtr browser,
+ FileDialogMode mode,
+ const CefString& title,
+ const CefString& default_file_path,
+ const std::vector& accept_filters,
+ const std::vector& accept_extensions,
+ const std::vector& accept_descriptions,
+ CefRefPtr callback) {
ScopedJNIEnv env;
if (!env)
return false;
@@ -42,6 +45,10 @@ bool DialogHandler::OnFileDialog(CefRefPtr browser,
ScopedJNIString jdefaultFilePath(env, default_file_path);
ScopedJNIObjectLocal jacceptFilters(env,
NewJNIStringVector(env, accept_filters));
+ ScopedJNIObjectLocal jacceptExtensions(
+ env, NewJNIStringVector(env, accept_extensions));
+ ScopedJNIObjectLocal jacceptDescriptions(
+ env, NewJNIStringVector(env, accept_descriptions));
ScopedJNIFileDialogCallback jcallback(env, callback);
ScopedJNIObjectResult jmode(env);
@@ -61,9 +68,11 @@ bool DialogHandler::OnFileDialog(CefRefPtr browser,
env, handle_, "onFileDialog",
"(Lorg/cef/browser/CefBrowser;Lorg/cef/handler/"
"CefDialogHandler$FileDialogMode;Ljava/lang/String;Ljava/lang/"
- "String;Ljava/util/Vector;Lorg/cef/callback/CefFileDialogCallback;)Z",
+ "String;Ljava/util/Vector;Ljava/util/Vector;Ljava/util/Vector;Lorg/cef/"
+ "callback/CefFileDialogCallback;)Z",
Boolean, jreturn, jbrowser.get(), jmode.get(), jtitle.get(),
- jdefaultFilePath.get(), jacceptFilters.get(), jcallback.get());
+ jdefaultFilePath.get(), jacceptFilters.get(), jacceptExtensions.get(),
+ jacceptDescriptions.get(), jcallback.get());
if (jreturn == JNI_FALSE) {
// If the Java method returns "false" the callback won't be used and
diff --git a/native/dialog_handler.h b/native/dialog_handler.h
index d4ec0cd3..0a5411ee 100644
--- a/native/dialog_handler.h
+++ b/native/dialog_handler.h
@@ -22,6 +22,8 @@ class DialogHandler : public CefDialogHandler {
const CefString& title,
const CefString& default_file_path,
const std::vector& accept_filters,
+ const std::vector& accept_extensions,
+ const std::vector& accept_descriptions,
CefRefPtr callback) override;
protected:
diff --git a/native/download_handler.cpp b/native/download_handler.cpp
index f594d435..e0b37759 100644
--- a/native/download_handler.cpp
+++ b/native/download_handler.cpp
@@ -49,14 +49,14 @@ class ScopedJNIDownloadItemCallback
DownloadHandler::DownloadHandler(JNIEnv* env, jobject handler)
: handle_(env, handler) {}
-void DownloadHandler::OnBeforeDownload(
+bool DownloadHandler::OnBeforeDownload(
CefRefPtr browser,
CefRefPtr download_item,
const CefString& suggested_name,
CefRefPtr callback) {
ScopedJNIEnv env;
if (!env)
- return;
+ return false;
ScopedJNIBrowser jbrowser(env, browser);
ScopedJNIDownloadItem jdownloadItem(env, download_item);
@@ -64,12 +64,16 @@ void DownloadHandler::OnBeforeDownload(
ScopedJNIString jsuggestedName(env, suggested_name);
ScopedJNIBeforeDownloadCallback jcallback(env, callback);
- JNI_CALL_VOID_METHOD(
- env, handle_, "onBeforeDownload",
+ jboolean jresult = 0;
+
+ JNI_CALL_BOOLEAN_METHOD(
+ jresult, env, handle_, "onBeforeDownload",
"(Lorg/cef/browser/CefBrowser;Lorg/cef/callback/CefDownloadItem;"
- "Ljava/lang/String;Lorg/cef/callback/CefBeforeDownloadCallback;)V",
+ "Ljava/lang/String;Lorg/cef/callback/CefBeforeDownloadCallback;)Z",
jbrowser.get(), jdownloadItem.get(), jsuggestedName.get(),
jcallback.get());
+
+ return jresult;
}
void DownloadHandler::OnDownloadUpdated(
diff --git a/native/download_handler.h b/native/download_handler.h
index d41ca492..adbaacbb 100644
--- a/native/download_handler.h
+++ b/native/download_handler.h
@@ -17,7 +17,7 @@ class DownloadHandler : public CefDownloadHandler {
DownloadHandler(JNIEnv* env, jobject handler);
// CefDownloadHandler methods
- virtual void OnBeforeDownload(
+ virtual bool OnBeforeDownload(
CefRefPtr browser,
CefRefPtr download_item,
const CefString& suggested_name,
diff --git a/native/jni_util.cpp b/native/jni_util.cpp
index d2c2488e..9d948330 100644
--- a/native/jni_util.cpp
+++ b/native/jni_util.cpp
@@ -686,20 +686,6 @@ jobject NewJNIErrorCode(JNIEnv* env, cef_errorcode_t errorCode) {
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST,
jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode", ERR_FTP_FAILED,
- jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
- ERR_FTP_SERVICE_UNAVAILABLE, jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
- ERR_FTP_TRANSFER_ABORTED, jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
- ERR_FTP_FILE_BUSY, jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
- ERR_FTP_SYNTAX_ERROR, jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
- ERR_FTP_COMMAND_NOT_SUPPORTED, jerrorCode);
- JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
- ERR_FTP_BAD_COMMAND_SEQUENCE, jerrorCode);
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
ERR_PKCS12_IMPORT_BAD_PASSWORD, jerrorCode);
JNI_CASE(env, "org/cef/handler/CefLoadHandler$ErrorCode",
diff --git a/native/request_handler.cpp b/native/request_handler.cpp
index 26d50dbd..0b6f6cec 100644
--- a/native/request_handler.cpp
+++ b/native/request_handler.cpp
@@ -175,7 +175,9 @@ bool RequestHandler::OnCertificateError(CefRefPtr browser,
}
void RequestHandler::OnRenderProcessTerminated(CefRefPtr browser,
- TerminationStatus status) {
+ TerminationStatus status,
+ int error_code,
+ const CefString& error_string) {
// Forward request to ClientHandler to make the message_router_ happy.
CefRefPtr client =
(ClientHandler*)browser->GetHost()->GetClient().get();
@@ -197,11 +199,18 @@ void RequestHandler::OnRenderProcessTerminated(CefRefPtr browser,
TS_PROCESS_CRASHED, jstatus);
JNI_CASE(env, "org/cef/handler/CefRequestHandler$TerminationStatus",
TS_PROCESS_OOM, jstatus);
+ JNI_CASE(env, "org/cef/handler/CefRequestHandler$TerminationStatus",
+ TS_LAUNCH_FAILED, jstatus);
+ JNI_CASE(env, "org/cef/handler/CefRequestHandler$TerminationStatus",
+ TS_INTEGRITY_FAILURE, jstatus);
}
- JNI_CALL_VOID_METHOD(
- env, handle_, "onRenderProcessTerminated",
- "(Lorg/cef/browser/CefBrowser;"
- "Lorg/cef/handler/CefRequestHandler$TerminationStatus;)V",
- jbrowser.get(), jstatus.get());
+ ScopedJNIString jerrorString(env, error_string);
+
+ JNI_CALL_VOID_METHOD(env, handle_, "onRenderProcessTerminated",
+ "(Lorg/cef/browser/CefBrowser;"
+ "Lorg/cef/handler/CefRequestHandler$TerminationStatus;"
+ "ILjava/lang/String;)V",
+ jbrowser.get(), jstatus.get(), error_code,
+ jerrorString.get());
}
diff --git a/native/request_handler.h b/native/request_handler.h
index 60b47b0b..9ee8356e 100644
--- a/native/request_handler.h
+++ b/native/request_handler.h
@@ -50,7 +50,9 @@ class RequestHandler : public CefRequestHandler {
CefRefPtr ssl_info,
CefRefPtr callback) override;
void OnRenderProcessTerminated(CefRefPtr browser,
- TerminationStatus status) override;
+ TerminationStatus status,
+ int error_code,
+ const CefString& error_string) override;
protected:
ScopedJNIObjectGlobal handle_;
diff --git a/native/signal_restore_posix.cpp b/native/signal_restore_posix.cpp
deleted file mode 100644
index 03d22496..00000000
--- a/native/signal_restore_posix.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-#include "signal_restore_posix.h"
-
-#include
-#include
-
-// arraysize borrowed from base/macros.h
-template
-char (&ArraySizeHelper(T (&array)[N]))[N];
-#define arraysize(array) (sizeof(ArraySizeHelper(array)))
-
-namespace {
-
-const int signals_to_restore[] = {SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT,
- SIGFPE, SIGSEGV, SIGALRM, SIGTERM, SIGCHLD,
- SIGBUS, SIGTRAP, SIGPIPE};
-
-struct sigaction signal_handlers[arraysize(signals_to_restore)];
-
-} // namespace
-
-void BackupSignalHandlers() {
- struct sigaction sigact;
- for (unsigned i = 0; i < arraysize(signals_to_restore); ++i) {
- memset(&sigact, 0, sizeof(sigact));
- sigaction(signals_to_restore[i], nullptr, &sigact);
- signal_handlers[i] = sigact;
- }
-}
-
-void RestoreSignalHandlers() {
- for (unsigned i = 0; i < arraysize(signals_to_restore); ++i) {
- sigaction(signals_to_restore[i], &signal_handlers[i], nullptr);
- }
-}
diff --git a/native/signal_restore_posix.h b/native/signal_restore_posix.h
deleted file mode 100644
index 830b361a..00000000
--- a/native/signal_restore_posix.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-#ifndef SIGNAL_RESTORE_POSIX_H
-#define SIGNAL_RESTORE_POSIX_H
-
-void BackupSignalHandlers();
-void RestoreSignalHandlers();
-
-#endif // SIGNAL_RESTORE_POSIX_H
From 2ac37d75e08f3fca524241a5f49a4d5378c0e1f7 Mon Sep 17 00:00:00 2001
From: Lasitha Gunawardena
Date: Thu, 5 Dec 2024 14:55:10 +0530
Subject: [PATCH 36/50] Restore enactor notorization support
---
java/.idea/.gitignore | 3 +
java/.idea/misc.xml | 6 ++
java/.idea/modules.xml | 8 ++
java/.idea/vcs.xml | 6 ++
java/java-cef.iml | 11 +++
java/out/production/java-cef/.idea/.gitignore | 3 +
java/out/production/java-cef/.idea/misc.xml | 6 ++
.../out/production/java-cef/.idea/modules.xml | 8 ++
java/out/production/java-cef/.idea/vcs.xml | 6 ++
java/out/production/java-cef/java-cef.iml | 11 +++
.../production/java-cef/manifest/MANIFEST.MF | 2 +
.../tests/detailed/handler/binding_test.html | 28 ++++++
.../tests/detailed/handler/binding_test2.html | 81 ++++++++++++++++++
.../tests/detailed/handler/localstorage.html | 24 ++++++
.../java-cef/tests/detailed/handler/logo.png | Bin 0 -> 24025 bytes
.../tests/detailed/handler/spellcheck.html | 14 +++
.../tests/detailed/handler/transparency.html | 63 ++++++++++++++
native/CMakeLists.txt | 39 ++++++++-
pom.xml | 32 +++----
19 files changed, 334 insertions(+), 17 deletions(-)
create mode 100644 java/.idea/.gitignore
create mode 100644 java/.idea/misc.xml
create mode 100644 java/.idea/modules.xml
create mode 100644 java/.idea/vcs.xml
create mode 100644 java/java-cef.iml
create mode 100644 java/out/production/java-cef/.idea/.gitignore
create mode 100644 java/out/production/java-cef/.idea/misc.xml
create mode 100644 java/out/production/java-cef/.idea/modules.xml
create mode 100644 java/out/production/java-cef/.idea/vcs.xml
create mode 100644 java/out/production/java-cef/java-cef.iml
create mode 100644 java/out/production/java-cef/manifest/MANIFEST.MF
create mode 100644 java/out/production/java-cef/tests/detailed/handler/binding_test.html
create mode 100644 java/out/production/java-cef/tests/detailed/handler/binding_test2.html
create mode 100644 java/out/production/java-cef/tests/detailed/handler/localstorage.html
create mode 100644 java/out/production/java-cef/tests/detailed/handler/logo.png
create mode 100644 java/out/production/java-cef/tests/detailed/handler/spellcheck.html
create mode 100644 java/out/production/java-cef/tests/detailed/handler/transparency.html
diff --git a/java/.idea/.gitignore b/java/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/java/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/java/.idea/misc.xml b/java/.idea/misc.xml
new file mode 100644
index 00000000..862d09bd
--- /dev/null
+++ b/java/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/.idea/modules.xml b/java/.idea/modules.xml
new file mode 100644
index 00000000..70f5b0ee
--- /dev/null
+++ b/java/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/.idea/vcs.xml b/java/.idea/vcs.xml
new file mode 100644
index 00000000..6c0b8635
--- /dev/null
+++ b/java/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/java-cef.iml b/java/java-cef.iml
new file mode 100644
index 00000000..b107a2dd
--- /dev/null
+++ b/java/java-cef.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/out/production/java-cef/.idea/.gitignore b/java/out/production/java-cef/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/java/out/production/java-cef/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/java/out/production/java-cef/.idea/misc.xml b/java/out/production/java-cef/.idea/misc.xml
new file mode 100644
index 00000000..862d09bd
--- /dev/null
+++ b/java/out/production/java-cef/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/out/production/java-cef/.idea/modules.xml b/java/out/production/java-cef/.idea/modules.xml
new file mode 100644
index 00000000..70f5b0ee
--- /dev/null
+++ b/java/out/production/java-cef/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/out/production/java-cef/.idea/vcs.xml b/java/out/production/java-cef/.idea/vcs.xml
new file mode 100644
index 00000000..6c0b8635
--- /dev/null
+++ b/java/out/production/java-cef/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/out/production/java-cef/java-cef.iml b/java/out/production/java-cef/java-cef.iml
new file mode 100644
index 00000000..b107a2dd
--- /dev/null
+++ b/java/out/production/java-cef/java-cef.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/out/production/java-cef/manifest/MANIFEST.MF b/java/out/production/java-cef/manifest/MANIFEST.MF
new file mode 100644
index 00000000..9993ab64
--- /dev/null
+++ b/java/out/production/java-cef/manifest/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Automatic-Module-Name: jcef
diff --git a/java/out/production/java-cef/tests/detailed/handler/binding_test.html b/java/out/production/java-cef/tests/detailed/handler/binding_test.html
new file mode 100644
index 00000000..9ee0775e
--- /dev/null
+++ b/java/out/production/java-cef/tests/detailed/handler/binding_test.html
@@ -0,0 +1,28 @@
+
+
+Binding Test
+
+
+
+
+
+
+
diff --git a/java/out/production/java-cef/tests/detailed/handler/binding_test2.html b/java/out/production/java-cef/tests/detailed/handler/binding_test2.html
new file mode 100644
index 00000000..8a61a96f
--- /dev/null
+++ b/java/out/production/java-cef/tests/detailed/handler/binding_test2.html
@@ -0,0 +1,81 @@
+
+
+Binding Test - Part 2
+
+
+
+
+
+
+
Please note: If you leave this page (myQuery enabled) and you return
+ after a while - without closing the browser - the JavaScript binding is
+ still enabled.