1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Update to CEF 115.3.11

This commit is contained in:
salvadordf
2023-07-30 18:47:35 +02:00
parent 1aae8fcb16
commit 99ffca1375
22 changed files with 7655 additions and 911 deletions

View File

@ -3,15 +3,15 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file. CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 114.2.13 which includes Chromium 114.0.5735.200. CEF4Delphi uses CEF 115.3.11 which includes Chromium 115.0.5790.114.
The CEF binaries used by CEF4Delphi are available for download at Spotify : The CEF binaries used by CEF4Delphi are available for download at Spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_114.2.13%2Bg6792e13%2Bchromium-114.0.5735.200_windows32.tar.bz2) * [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_115.3.11%2Bga61da9b%2Bchromium-115.0.5790.114_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_114.2.13%2Bg6792e13%2Bchromium-114.0.5735.200_windows64.tar.bz2) * [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_115.3.11%2Bga61da9b%2Bchromium-115.0.5790.114_windows64.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_114.2.13%2Bg6792e13%2Bchromium-114.0.5735.200_linux64.tar.bz2) * [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_115.3.11%2Bga61da9b%2Bchromium-115.0.5790.114_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_114.2.13%2Bg6792e13%2Bchromium-114.0.5735.200_linuxarm.tar.bz2) * [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_115.3.11%2Bga61da9b%2Bchromium-115.0.5790.114_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_114.2.13%2Bg6792e13%2Bchromium-114.0.5735.200_linuxarm64.tar.bz2) * [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_115.3.11%2Bga61da9b%2Bchromium-115.0.5790.114_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_114.2.13%2Bg6792e13%2Bchromium-114.0.5735.200_macosx64.tar.bz2) * [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_115.3.11%2Bga61da9b%2Bchromium-115.0.5790.114_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 11.3 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.6/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components. CEF4Delphi was developed and tested on Delphi 11.3 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.6/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
@ -49,14 +49,16 @@ Delphinus-Support
* [DCPcrypt](https://sourceforge.net/projects/lazarus-ccr/files/DCPcrypt/) * [DCPcrypt](https://sourceforge.net/projects/lazarus-ccr/files/DCPcrypt/)
* [Chromium](https://chromium.googlesource.com/chromium/src/) * [Chromium](https://chromium.googlesource.com/chromium/src/)
## Other resources
* [Learn Delphi](https://learndelphi.org/)
* [Essential Pascal by Marco Cantù](https://www.marcocantu.com/epascal/)
* [Free Pascal Reference guide](https://www.freepascal.org/docs-html/ref/ref.html)
* [Modern Object Pascal Introduction for Programmers](https://castle-engine.io/modern_pascal)
* [FreePascal from Square One by Jeff Duntemann](http://www.copperwood.com/pub/FreePascalFromSquareOne.pdf)
* [Pascal and Lazarus Books and Magazines](https://wiki.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines)
* [Lazarus Documentation](https://wiki.freepascal.org/Lazarus_Documentation)
## Attribution ## Attribution
* [Fugue & Diagona icons](http://yusukekamiyamane.com/) * [Fugue & Diagona icons](http://yusukekamiyamane.com/)
* [FatCow Farm-Fresh Web Icons](https://www.fatcow.com/free-icons) * [FatCow Farm-Fresh Web Icons](https://www.fatcow.com/free-icons)
* [Material Design Icons](https://github.com/google/material-design-icons) * [Material Design Icons](https://github.com/google/material-design-icons)
## Other resources
* [Learn Delphi](https://learndelphi.org/)
* [Essential Pascal by Marco Cantù](https://www.marcocantu.com/epascal/)
* [FreePascal from Square One by Jeff Duntemann](http://www.copperwood.com/pub/FreePascalFromSquareOne.pdf)
* [Pascal and Lazarus Books and Magazines](https://wiki.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines)
* [Lazarus Documentation](https://wiki.freepascal.org/Lazarus_Documentation)

View File

@ -21,7 +21,7 @@
</CompilerOptions> </CompilerOptions>
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/> <Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
<License Value="MPL 1.1"/> <License Value="MPL 1.1"/>
<Version Major="114" Minor="2" Release="13"/> <Version Major="115" Minor="3" Release="11"/>
<Files Count="214"> <Files Count="214">
<Item1> <Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/> <Filename Value="..\source\uCEFAccessibilityHandler.pas"/>

View File

@ -57,6 +57,12 @@ uses
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar, uCEFApplicationCore; uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar, uCEFApplicationCore;
type type
/// <summary>
///
/// </summary>
/// <remarks>
/// <see cref="uCEFInterfaces|ICefApp">Implements ICefApp</see>
/// </remarks>
TCefAppOwn = class(TCefBaseRefCountedOwn, ICefApp) TCefAppOwn = class(TCefBaseRefCountedOwn, ICefApp)
protected protected
procedure OnBeforeCommandLineProcessing(const processType: ustring; const commandLine: ICefCommandLine); virtual; abstract; procedure OnBeforeCommandLineProcessing(const processType: ustring; const commandLine: ICefCommandLine); virtual; abstract;

View File

@ -108,7 +108,6 @@ type
FCommandLineArgsDisabled : boolean; FCommandLineArgsDisabled : boolean;
FCache : ustring; FCache : ustring;
FRootCache : ustring; FRootCache : ustring;
FUserDataPath : ustring;
FPersistSessionCookies : boolean; FPersistSessionCookies : boolean;
FPersistUserPreferences : boolean; FPersistUserPreferences : boolean;
FUserAgent : ustring; FUserAgent : ustring;
@ -263,12 +262,15 @@ type
procedure SetCache(const aValue : ustring); procedure SetCache(const aValue : ustring);
procedure SetRootCache(const aValue : ustring); procedure SetRootCache(const aValue : ustring);
procedure SetUserDataPath(const aValue : ustring);
procedure SetBrowserSubprocessPath(const aValue : ustring); procedure SetBrowserSubprocessPath(const aValue : ustring);
procedure SetFrameworkDirPath(const aValue : ustring); procedure SetFrameworkDirPath(const aValue : ustring);
procedure SetResourcesDirPath(const aValue : ustring); procedure SetResourcesDirPath(const aValue : ustring);
procedure SetLocalesDirPath(const aValue : ustring); procedure SetLocalesDirPath(const aValue : ustring);
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
/// <summary>
/// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
/// modal message loop. Set to false (0) after exiting the modal message loop.
/// </summary>
procedure SetOsmodalLoop(aValue : boolean); procedure SetOsmodalLoop(aValue : boolean);
{$ENDIF} {$ENDIF}
procedure SetKioskPrinting(aValue : boolean); procedure SetKioskPrinting(aValue : boolean);
@ -426,34 +428,242 @@ type
procedure Internal_GetDefaultClient(var aClient : ICefClient); procedure Internal_GetDefaultClient(var aClient : ICefClient);
// Properties used to populate TCefSettings (cef_settings_t) // Properties used to populate TCefSettings (cef_settings_t)
/// <summary>
/// Set to true (1) to disable the sandbox for sub-processes. See
/// cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
/// configurable using the "no-sandbox" command-line switch.
/// </summary>
property NoSandbox : Boolean read FNoSandbox write FNoSandbox; property NoSandbox : Boolean read FNoSandbox write FNoSandbox;
/// <summary>
/// The path to a separate executable that will be launched for sub-processes.
/// If this value is empty on Windows or Linux then the main process
/// executable will be used. If this value is empty on macOS then a helper
/// executable must exist at "Contents/Frameworks/<app>
/// Helper.app/Contents/MacOS/<app> Helper" in the top-level app bundle. See
/// the comments on CefExecuteProcess() for details. If this value is
/// non-empty then it must be an absolute path. Also configurable using the
/// "browser-subprocess-path" command-line switch.
/// </summary>
property BrowserSubprocessPath : ustring read FBrowserSubprocessPath write SetBrowserSubprocessPath; property BrowserSubprocessPath : ustring read FBrowserSubprocessPath write SetBrowserSubprocessPath;
/// <summary>
/// The path to the CEF framework directory on macOS. If this value is empty
/// then the framework must exist at "Contents/Frameworks/Chromium Embedded
/// Framework.framework" in the top-level app bundle. If this value is
/// non-empty then it must be an absolute path. Also configurable using the
/// "framework-dir-path" command-line switch.
/// </summary>
property FrameworkDirPath : ustring read FFrameworkDirPath write SetFrameworkDirPath; property FrameworkDirPath : ustring read FFrameworkDirPath write SetFrameworkDirPath;
/// <summary>
/// The path to the main bundle on macOS. If this value is empty then it
/// defaults to the top-level app bundle. If this value is non-empty then it
/// must be an absolute path. Also configurable using the "main-bundle-path"
/// command-line switch.
/// </summary>
property MainBundlePath : ustring read FMainBundlePath write FMainBundlePath; // Only used in macOS property MainBundlePath : ustring read FMainBundlePath write FMainBundlePath; // Only used in macOS
/// <summary>
/// Set to true (1) to enable use of the Chrome runtime in CEF. This feature
/// is considered experimental and is not recommended for most users at this
/// time. See issue #2969 for details.
/// </summary>
property ChromeRuntime : boolean read FChromeRuntime write FChromeRuntime; property ChromeRuntime : boolean read FChromeRuntime write FChromeRuntime;
/// <summary>
/// Set to true (1) to have the browser process message loop run in a separate
/// thread. If false (0) then the CefDoMessageLoopWork() function must be
/// called from your application message loop. This option is only supported
/// on Windows and Linux.
/// </summary>
property MultiThreadedMessageLoop : boolean read FMultiThreadedMessageLoop write FMultiThreadedMessageLoop; property MultiThreadedMessageLoop : boolean read FMultiThreadedMessageLoop write FMultiThreadedMessageLoop;
/// <summary>
/// Set to true (1) to control browser process main (UI) thread message pump
/// scheduling via the ICefBrowserProcessHandler.OnScheduleMessagePumpWork()
/// callback. This option is recommended for use in combination with the
/// CefDoMessageLoopWork() function in cases where the CEF message loop must
/// be integrated into an existing application message loop (see additional
/// comments and warnings on CefDoMessageLoopWork). Enabling this option is
/// not recommended for most users; leave this option disabled and use either
/// the CefRunMessageLoop() function or multi_threaded_message_loop if
/// possible.
/// </summary>
property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump; property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump;
/// <summary>
/// Set to true (1) to enable windowless (off-screen) rendering support. Do
/// not enable this value if the application does not use windowless rendering
/// as it may reduce rendering performance on some systems.
/// </summary>
property WindowlessRenderingEnabled : Boolean read FWindowlessRenderingEnabled write FWindowlessRenderingEnabled; property WindowlessRenderingEnabled : Boolean read FWindowlessRenderingEnabled write FWindowlessRenderingEnabled;
/// <summary>
/// Set to true (1) to disable configuration of browser process features using
/// standard CEF and Chromium command-line arguments. Configuration can still
/// be specified using CEF data structures or via the
/// ICefApp.OnBeforeCommandLineProcessing() method.
/// </summary>
property CommandLineArgsDisabled : Boolean read FCommandLineArgsDisabled write FCommandLineArgsDisabled; property CommandLineArgsDisabled : Boolean read FCommandLineArgsDisabled write FCommandLineArgsDisabled;
/// <summary>
/// The location where data for the global browser cache will be stored on
/// disk. If this value is non-empty then it must be an absolute path that is
/// either equal to or a child directory of TCefSettings.root_cache_path. If
/// this value is empty then browsers will be created in "incognito mode"
/// where in-memory caches are used for storage and no data is persisted to
/// disk. HTML5 databases such as localStorage will only persist across
/// sessions if a cache path is specified. Can be overridden for individual
/// CefRequestContext instances via the TCefRequestContextSettings.cache_path
/// value. When using the Chrome runtime the "default" profile will be used if
/// |cache_path| and |root_cache_path| have the same value.
/// </summary>
property Cache : ustring read FCache write SetCache; property Cache : ustring read FCache write SetCache;
/// <summary>
/// The root directory that all TCefSettings.cache_path and
/// TCefRequestContextSettings.cache_path values must have in common. If this
/// value is empty and TCefSettings.cache_path is non-empty then it will
/// default to the TCefSettings.cache_path value. 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). If this value is
/// non-empty then it must be an absolute path. Failure to set this value
/// correctly may result in the sandbox blocking read/write access to certain
/// files.
/// </summary>
property RootCache : ustring read FRootCache write SetRootCache; property RootCache : ustring read FRootCache write SetRootCache;
property UserDataPath : ustring read FUserDataPath write SetUserDataPath; /// <summary>
/// To persist session cookies (cookies without an expiry date or validity
/// interval) by default when using the global cookie manager set this value
/// to true (1). Session cookies are generally intended to be transient and
/// most Web browsers do not persist them. A |cache_path| value must also be
/// specified to enable this feature. Also configurable using the
/// "persist-session-cookies" command-line switch. Can be overridden for
/// individual CefRequestContext instances via the
/// TCefRequestContextSettings.persist_session_cookies value.
/// </summary>
property PersistSessionCookies : Boolean read FPersistSessionCookies write FPersistSessionCookies; property PersistSessionCookies : Boolean read FPersistSessionCookies write FPersistSessionCookies;
/// <summary>
/// To persist user preferences as a JSON file in the cache path directory set
/// this value to true (1). A |cache_path| value must also be specified
/// to enable this feature. Also configurable using the
/// "persist-user-preferences" command-line switch. Can be overridden for
/// individual CefRequestContext instances via the
/// TCefRequestContextSettings.persist_user_preferences value.
/// </summary>
property PersistUserPreferences : Boolean read FPersistUserPreferences write FPersistUserPreferences; property PersistUserPreferences : Boolean read FPersistUserPreferences write FPersistUserPreferences;
/// <summary>
/// Value that will be returned as the User-Agent HTTP header. If empty the
/// default User-Agent string will be used. Also configurable using the
/// "user-agent" command-line switch.
/// </summary>
property UserAgent : ustring read FUserAgent write FUserAgent; property UserAgent : ustring read FUserAgent write FUserAgent;
/// <summary>
/// Value that will be inserted as the product portion of the default
/// User-Agent string. If empty the Chromium product version will be used. If
/// |userAgent| is specified this value will be ignored. Also configurable
/// using the "user-agent-product" command-line switch.
/// </summary>
property UserAgentProduct : ustring read FUserAgentProduct write FUserAgentProduct; property UserAgentProduct : ustring read FUserAgentProduct write FUserAgentProduct;
/// <summary>
/// The locale string that will be passed to WebKit. If empty the default
/// locale of "en-US" will be used. This value is ignored on Linux where
/// locale is determined using environment variable parsing with the
/// precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also
/// configurable using the "lang" command-line switch.
/// </summary>
property Locale : ustring read FLocale write FLocale; property Locale : ustring read FLocale write FLocale;
/// <summary>
/// The directory and file name to use for the debug log. If empty a default
/// log file name and location will be used. On Windows and Linux a
/// "debug.log" file will be written in the main executable directory. On
/// MacOS a "~/Library/Logs/[app name]_debug.log" file will be written where
/// [app name] is the name of the main app executable. Also configurable using
/// the "log-file" command-line switch.
/// </summary>
property LogFile : ustring read FLogFile write FLogFile; property LogFile : ustring read FLogFile write FLogFile;
/// <summary>
/// The log severity. Only messages of this severity level or higher will be
/// logged. When set to DISABLE no messages will be written to the log file,
/// but FATAL messages will still be output to stderr. Also configurable using
/// the "log-severity" command-line switch with a value of "verbose", "info",
/// "warning", "error", "fatal" or "disable".
/// </summary>
property LogSeverity : TCefLogSeverity read FLogSeverity write FLogSeverity; property LogSeverity : TCefLogSeverity read FLogSeverity write FLogSeverity;
/// <summary>
/// Custom flags that will be used when initializing the V8 JavaScript engine.
/// The consequences of using custom flags may not be well tested. Also
/// configurable using the "js-flags" command-line switch.
/// </summary>
property JavaScriptFlags : ustring read FJavaScriptFlags write FJavaScriptFlags; property JavaScriptFlags : ustring read FJavaScriptFlags write FJavaScriptFlags;
/// <summary>
/// The fully qualified path for the resources directory. If this value is
/// empty the *.pak files must be located in the module directory on
/// Windows/Linux or the app bundle Resources directory on MacOS. If this
/// value is non-empty then it must be an absolute path. Also configurable
/// using the "resources-dir-path" command-line switch.
/// </summary>
property ResourcesDirPath : ustring read GetResourcesDirPath write SetResourcesDirPath; property ResourcesDirPath : ustring read GetResourcesDirPath write SetResourcesDirPath;
/// <summary>
/// The fully qualified path for the locales directory. If this value is empty
/// the locales directory must be located in the module directory. If this
/// value is non-empty then it must be an absolute path. This value is ignored
/// on MacOS where pack files are always loaded from the app bundle Resources
/// directory. Also configurable using the "locales-dir-path" command-line
/// switch.
/// </summary>
property LocalesDirPath : ustring read GetLocalesDirPath write SetLocalesDirPath; property LocalesDirPath : ustring read GetLocalesDirPath write SetLocalesDirPath;
/// <summary>
/// Set to true (1) to disable loading of pack files for resources and
/// locales. A resource bundle handler must be provided for the browser and
/// render processes via ICefApp.GetResourceBundleHandler() if loading of pack
/// files is disabled. Also configurable using the "disable-pack-loading"
/// command- line switch.
/// </summary>
property PackLoadingDisabled : Boolean read FPackLoadingDisabled write FPackLoadingDisabled; property PackLoadingDisabled : Boolean read FPackLoadingDisabled write FPackLoadingDisabled;
/// <summary>
/// Set to a value between 1024 and 65535 to enable remote debugging on the
/// specified port. Also configurable using the "remote-debugging-port"
/// command-line switch. Remote debugging can be accessed by loading the
/// chrome://inspect page in Google Chrome. Port numbers 9222 and 9229 are
/// discoverable by default. Other port numbers may need to be configured via
/// "Discover network targets" on the Devices tab.
/// </summary>
property RemoteDebuggingPort : Integer read FRemoteDebuggingPort write FRemoteDebuggingPort; property RemoteDebuggingPort : Integer read FRemoteDebuggingPort write FRemoteDebuggingPort;
/// <summary>
/// The number of stack trace frames to capture for uncaught exceptions.
/// Specify a positive value to enable the
/// ICefRenderProcessHandler.OnUncaughtException() callback. Specify 0
/// (default value) and OnUncaughtException() will not be called. Also
/// configurable using the "uncaught-exception-stack-size" command-line
/// switch.
/// </summary>
property UncaughtExceptionStackSize : Integer read FUncaughtExceptionStackSize write FUncaughtExceptionStackSize; property UncaughtExceptionStackSize : Integer read FUncaughtExceptionStackSize write FUncaughtExceptionStackSize;
property IgnoreCertificateErrors : Boolean read FIgnoreCertificateErrors write FIgnoreCertificateErrors; /// <summary>
/// Background color used for the browser before a document is loaded and when
/// no document color is specified. The alpha component must be either fully
/// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
/// opaque then the RGB components will be used as the background color. If
/// the alpha component is fully transparent for a windowed browser then the
/// default value of opaque white be used. If the alpha component is fully
/// transparent for a windowless (off-screen) browser then transparent
/// painting will be enabled.
/// </summary>
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor; property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor;
/// <summary>
/// Comma delimited ordered list of language codes without any whitespace that
/// will be used in the "Accept-Language" HTTP header. May be overridden on a
/// per-browser basis using the TCefBrowserSettings.accept_language_list value.
/// If both values are empty then "en-US,en" will be used. Can be overridden
/// for individual ICefRequestContext instances via the
/// TCefRequestContextSettings.accept_language_list value.
/// </summary>
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList; property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
/// <summary>
/// Comma delimited list of schemes supported by the associated
/// ICefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0)
/// the default schemes ("http", "https", "ws" and "wss") will also be
/// supported. Not specifying a |cookieable_schemes_list| value and setting
/// |cookieable_schemes_exclude_defaults| to true (1) will disable all loading
/// and saving of cookies. These settings will only impact the global
/// ICefRequestContext. Individual ICefRequestContext instances can be
/// configured via the TCefRequestContextSettings.cookieable_schemes_list and
/// TCefRequestContextSettings.cookieable_schemes_exclude_defaults values.
/// </summary>
property CookieableSchemesList : ustring read FCookieableSchemesList write FCookieableSchemesList; property CookieableSchemesList : ustring read FCookieableSchemesList write FCookieableSchemesList;
property CookieableSchemesExcludeDefaults : boolean read FCookieableSchemesExcludeDefaults write FCookieableSchemesExcludeDefaults; property CookieableSchemesExcludeDefaults : boolean read FCookieableSchemesExcludeDefaults write FCookieableSchemesExcludeDefaults;
@ -520,6 +730,7 @@ type
property NetLogCaptureMode : TCefNetLogCaptureMode read FNetLogCaptureMode write FNetLogCaptureMode; // --net-log-capture-mode property NetLogCaptureMode : TCefNetLogCaptureMode read FNetLogCaptureMode write FNetLogCaptureMode; // --net-log-capture-mode
property RemoteAllowOrigins : ustring read FRemoteAllowOrigins write FRemoteAllowOrigins; // --remote-allow-origins property RemoteAllowOrigins : ustring read FRemoteAllowOrigins write FRemoteAllowOrigins; // --remote-allow-origins
property AutoAcceptCamAndMicCapture : boolean read FAutoAcceptCamAndMicCapture write FAutoAcceptCamAndMicCapture; // --auto-accept-camera-and-microphone-capture property AutoAcceptCamAndMicCapture : boolean read FAutoAcceptCamAndMicCapture write FAutoAcceptCamAndMicCapture; // --auto-accept-camera-and-microphone-capture
property IgnoreCertificateErrors : Boolean read FIgnoreCertificateErrors write FIgnoreCertificateErrors; // --ignore-certificate-errors
// Properties used during the CEF initialization // Properties used during the CEF initialization
property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo; property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo;
@ -570,6 +781,10 @@ type
property ApiHashCommit : ustring read GetApiHashCommit; property ApiHashCommit : ustring read GetApiHashCommit;
property LastErrorMessage : ustring read FLastErrorMessage; property LastErrorMessage : ustring read FLastErrorMessage;
{$IFDEF LINUX} {$IFDEF LINUX}
/// <summary>
/// Return the singleton X11 display shared with Chromium. The display is not
/// thread-safe and must only be accessed on the browser process UI thread.
/// </summary>
property XDisplay : PXDisplay read GetXDisplay; property XDisplay : PXDisplay read GetXDisplay;
{$ENDIF} {$ENDIF}
@ -692,7 +907,6 @@ begin
FCommandLineArgsDisabled := False; FCommandLineArgsDisabled := False;
FCache := ''; FCache := '';
FRootCache := ''; FRootCache := '';
FUserDataPath := '';
FPersistSessionCookies := False; FPersistSessionCookies := False;
FPersistUserPreferences := False; FPersistUserPreferences := False;
FUserAgent := ''; FUserAgent := '';
@ -1082,11 +1296,6 @@ begin
FRootCache := CustomAbsolutePath(aValue); FRootCache := CustomAbsolutePath(aValue);
end; end;
procedure TCefApplicationCore.SetUserDataPath(const aValue : ustring);
begin
FUserDataPath := CustomAbsolutePath(aValue);
end;
procedure TCefApplicationCore.SetBrowserSubprocessPath(const aValue : ustring); procedure TCefApplicationCore.SetBrowserSubprocessPath(const aValue : ustring);
begin begin
FBrowserSubprocessPath := CustomAbsolutePath(aValue); FBrowserSubprocessPath := CustomAbsolutePath(aValue);
@ -1451,7 +1660,6 @@ begin
aSettings.command_line_args_disabled := Ord(FCommandLineArgsDisabled); aSettings.command_line_args_disabled := Ord(FCommandLineArgsDisabled);
aSettings.cache_path := CefString(FCache); aSettings.cache_path := CefString(FCache);
aSettings.root_cache_path := CefString(FRootCache); aSettings.root_cache_path := CefString(FRootCache);
aSettings.user_data_path := CefString(FUserDataPath);
aSettings.persist_session_cookies := Ord(FPersistSessionCookies); aSettings.persist_session_cookies := Ord(FPersistSessionCookies);
aSettings.persist_user_preferences := Ord(FPersistUserPreferences); aSettings.persist_user_preferences := Ord(FPersistUserPreferences);
aSettings.user_agent := CefString(FUserAgent); aSettings.user_agent := CefString(FUserAgent);

View File

@ -905,12 +905,16 @@ type
procedure CreateRoute(const source: ICefMediaSource; const sink: ICefMediaSink); procedure CreateRoute(const source: ICefMediaSource; const sink: ICefMediaSink);
procedure GetDeviceInfo(const aMediaSink: ICefMediaSink); procedure GetDeviceInfo(const aMediaSink: ICefMediaSink);
// ICefRequestContext methods for extensions // ICefRequestContext methods
function LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue = nil; const handler: ICefExtensionHandler = nil; const requestContext : ICefRequestContext = nil) : boolean; function LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue = nil; const handler: ICefExtensionHandler = nil; const requestContext : ICefRequestContext = nil) : boolean;
function DidLoadExtension(const extension_id: ustring): boolean; function DidLoadExtension(const extension_id: ustring): boolean;
function HasExtension(const extension_id: ustring): boolean; function HasExtension(const extension_id: ustring): boolean;
function GetExtensions(const extension_ids: TStringList): boolean; function GetExtensions(const extension_ids: TStringList): boolean;
function GetExtension(const extension_id: ustring): ICefExtension; function GetExtension(const extension_id: ustring): ICefExtension;
function GetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): ICefValue;
procedure SetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue);
function GetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): TCefContentSettingValues;
procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
property DefaultUrl : ustring read FDefaultUrl write SetDefaultUrl; property DefaultUrl : ustring read FDefaultUrl write SetDefaultUrl;
property Options : TChromiumOptions read FOptions write FOptions; property Options : TChromiumOptions read FOptions write FOptions;
@ -7131,6 +7135,62 @@ begin
end; end;
end; end;
function TChromiumCore.GetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): ICefValue;
var
TempContext : ICefRequestContext;
begin
Result := nil;
if Initialized then
begin
TempContext := Browser.Host.RequestContext;
if (TempContext <> nil) then
Result := TempContext.GetWebsiteSetting(requesting_url, top_level_url, content_type);
end;
end;
procedure TChromiumCore.SetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue);
var
TempContext : ICefRequestContext;
begin
if Initialized then
begin
TempContext := Browser.Host.RequestContext;
if (TempContext <> nil) then
TempContext.SetWebsiteSetting(requesting_url, top_level_url, content_type, value);
end;
end;
function TChromiumCore.GetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): TCefContentSettingValues;
var
TempContext : ICefRequestContext;
begin
Result := CEF_CONTENT_SETTING_VALUE_DEFAULT;
if Initialized then
begin
TempContext := Browser.Host.RequestContext;
if (TempContext <> nil) then
Result := TempContext.GetContentSetting(requesting_url, top_level_url, content_type);
end;
end;
procedure TChromiumCore.SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
var
TempContext : ICefRequestContext;
begin
if Initialized then
begin
TempContext := Browser.Host.RequestContext;
if (TempContext <> nil) then
TempContext.SetContentSetting(requesting_url, top_level_url, content_type, value);
end;
end;
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
function TChromiumCore.CopyDCToBitmapStream(aSrcDC : HDC; const aSrcRect : TRect; const aStream : TStream) : boolean; function TChromiumCore.CopyDCToBitmapStream(aSrcDC : HDC; const aSrcRect : TRect; const aStream : TStream) : boolean;
var var

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -372,15 +372,15 @@ var
cef_time_from_basetime : function(const from: TCefBaseTime; to_: PCefTime) : integer; cdecl; cef_time_from_basetime : function(const from: TCefBaseTime; to_: PCefTime) : integer; cdecl;
// /include/internal/cef_trace_event_internal.h // /include/internal/cef_trace_event_internal.h
cef_trace_event_instant : procedure(const category, name, arg1_name: PAnsiChar; arg1_val: uint64; const arg2_name: PAnsiChar; arg2_val: UInt64; copy: Integer); cdecl; cef_trace_event_instant : procedure(const category, name, arg1_name: PAnsiChar; arg1_val: uint64; const arg2_name: PAnsiChar; arg2_val: UInt64); cdecl;
cef_trace_event_begin : procedure(const category, name, arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64; copy: Integer); cdecl; cef_trace_event_begin : procedure(const category, name, arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64); cdecl;
cef_trace_event_end : procedure(const category, name, arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64; copy: Integer); cdecl; cef_trace_event_end : procedure(const category, name, arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64); cdecl;
cef_trace_counter : procedure(const category, name, value1_name: PAnsiChar; value1_val: UInt64; const value2_name: PAnsiChar; value2_val: UInt64; copy: Integer); cdecl; cef_trace_counter : procedure(const category, name, value1_name: PAnsiChar; value1_val: UInt64; const value2_name: PAnsiChar; value2_val: UInt64); cdecl;
cef_trace_counter_id : procedure(const category, name: PAnsiChar; id: UInt64; const value1_name: PAnsiChar; value1_val: UInt64; const value2_name: PAnsiChar; value2_val: UInt64; copy: Integer); cdecl; cef_trace_counter_id : procedure(const category, name: PAnsiChar; id: UInt64; const value1_name: PAnsiChar; value1_val: UInt64; const value2_name: PAnsiChar; value2_val: UInt64); cdecl;
cef_trace_event_async_begin : procedure(const category, name: PAnsiChar; id: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64; copy: Integer); cdecl; cef_trace_event_async_begin : procedure(const category, name: PAnsiChar; id: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64); cdecl;
cef_trace_event_async_step_into : procedure(const category, name: PAnsiChar; id, step: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64; copy: Integer); cdecl; cef_trace_event_async_step_into : procedure(const category, name: PAnsiChar; id, step: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64); cdecl;
cef_trace_event_async_step_past : procedure(const category, name: PAnsiChar; id, step: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64; copy: Integer); cdecl; cef_trace_event_async_step_past : procedure(const category, name: PAnsiChar; id, step: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64); cdecl;
cef_trace_event_async_end : procedure(const category, name: PAnsiChar; id: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64; copy: Integer); cdecl; cef_trace_event_async_end : procedure(const category, name: PAnsiChar; id: UInt64; const arg1_name: PAnsiChar; arg1_val: UInt64; const arg2_name: PAnsiChar; arg2_val: UInt64); cdecl;
{$IFDEF LINUX} {$IFDEF LINUX}
// /include/internal/cef_types_linux.h // /include/internal/cef_types_linux.h

View File

@ -85,16 +85,22 @@ const
User32DLL = 'User32.dll'; User32DLL = 'User32.dll';
Netapi32DLL = 'Netapi32.dll'; Netapi32DLL = 'Netapi32.dll';
/// <summary>Return the alpha byte from a cef_color_t value.</summary>
function CefColorGetA(color: TCefColor): Byte; function CefColorGetA(color: TCefColor): Byte;
/// <summary>Return the red byte from a cef_color_t value.</summary>
function CefColorGetR(color: TCefColor): byte; function CefColorGetR(color: TCefColor): byte;
/// <summary>Return the green byte from a cef_color_t value.</summary>
function CefColorGetG(color: TCefColor): Byte; function CefColorGetG(color: TCefColor): Byte;
/// <summary>Return the blue byte from a cef_color_t value.</summary>
function CefColorGetB(color: TCefColor): Byte; function CefColorGetB(color: TCefColor): Byte;
/// <summary>Return an cef_color_t value with the specified byte component values.</summary>
function CefColorSetARGB(a, r, g, b: Byte): TCefColor; function CefColorSetARGB(a, r, g, b: Byte): TCefColor;
/// <summary>Return an int64_t value with the specified low and high int32_t component values.</summary>
function CefInt64Set(int32_low, int32_high: Integer): Int64; function CefInt64Set(int32_low, int32_high: Integer): Int64;
/// <summary>Return the low int32_t value from an int64_t value.</summary>
function CefInt64GetLow(const int64_val: Int64): Integer; function CefInt64GetLow(const int64_val: Int64): Integer;
/// <summary>Return the high int32_t value from an int64_t value.</summary>
function CefInt64GetHigh(const int64_val: Int64): Integer; function CefInt64GetHigh(const int64_val: Int64): Integer;
function CefGetObject(ptr: Pointer): TObject; {$IFNDEF CEF4DELHI_ALLOC_DEBUG}{$IFDEF SUPPORTS_INLINE}inline;{$ENDIF}{$ENDIF} function CefGetObject(ptr: Pointer): TObject; {$IFNDEF CEF4DELHI_ALLOC_DEBUG}{$IFDEF SUPPORTS_INLINE}inline;{$ENDIF}{$ENDIF}
@ -211,6 +217,10 @@ function CefIsCertStatusError(Status : TCefCertStatus) : boolean;
function CefCrashReportingEnabled : boolean; function CefCrashReportingEnabled : boolean;
procedure CefSetCrashKeyValue(const aKey, aValue : ustring); procedure CefSetCrashKeyValue(const aKey, aValue : ustring);
/// <summary>
/// Add a log message. See the LogSeverity defines for supported |severity|
/// values.
/// </summary>
procedure CefLog(const aFile : string; aLine, aSeverity : integer; const aMessage : string); procedure CefLog(const aFile : string; aLine, aSeverity : integer; const aMessage : string);
procedure CefDebugLog(const aMessage : string; aSeverity : integer = CEF_LOG_SEVERITY_ERROR); procedure CefDebugLog(const aMessage : string; aSeverity : integer = CEF_LOG_SEVERITY_ERROR);
procedure CefKeyEventLog(const aEvent : TCefKeyEvent); procedure CefKeyEventLog(const aEvent : TCefKeyEvent);

View File

@ -57,33 +57,268 @@ uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes, uCEFCompletionCallback, uCEFPreferenceManager; uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes, uCEFCompletionCallback, uCEFPreferenceManager;
type type
/// <summary>
/// A request context provides request handling for a set of related browser or
/// URL request objects. A request context can be specified when creating a new
/// browser via the cef_browser_host_t static factory functions or when creating
/// a new URL request via the cef_urlrequest_t static factory functions. Browser
/// objects with different request contexts will never be hosted in the same
/// render process. Browser objects with the same request context may or may not
/// be hosted in the same render process depending on the process model. Browser
/// objects created indirectly via the JavaScript window.open function or
/// targeted links will share the same render process and the same request
/// context as the source browser. When running in single-process mode there is
/// only a single render process (the main process) and so all browsers created
/// in single-process mode will share the same request context. This will be the
/// first request context passed into a cef_browser_host_t static factory
/// function and all other request context objects will be ignored.
/// </summary>
TCefRequestContextRef = class(TCefPreferenceManagerRef, ICefRequestContext) TCefRequestContextRef = class(TCefPreferenceManagerRef, ICefRequestContext)
protected protected
/// <summary>
/// Returns true (1) if this object is pointing to the same context as |that|
/// object.
/// </summary>
function IsSame(const other: ICefRequestContext): Boolean; function IsSame(const other: ICefRequestContext): Boolean;
/// <summary>
/// Returns true (1) if this object is sharing the same storage as |that|
/// object.
/// </summary>
function IsSharingWith(const other: ICefRequestContext): Boolean; function IsSharingWith(const other: ICefRequestContext): Boolean;
/// <summary>
/// Returns true (1) if this object is the global context. The global context
/// is used by default when creating a browser or URL request with a NULL
/// context argument.
/// </summary>
function IsGlobal: Boolean; function IsGlobal: Boolean;
/// <summary>
/// Returns the handler for this context if any.
/// </summary>
function GetHandler: ICefRequestContextHandler; function GetHandler: ICefRequestContextHandler;
/// <summary>
/// Returns the cache path for this object. If NULL an "incognito mode" in-
/// memory cache is being used.
/// </summary>
function GetCachePath: ustring; function GetCachePath: ustring;
/// <summary>
/// Returns the cookie manager for this object. If |callback| is non-NULL it
/// will be executed asnychronously on the UI thread after the manager's
/// storage has been initialized.
/// </summary>
function GetCookieManager(const callback: ICefCompletionCallback): ICefCookieManager; function GetCookieManager(const callback: ICefCompletionCallback): ICefCookieManager;
function GetCookieManagerProc(const callback: TCefCompletionCallbackProc): ICefCookieManager; function GetCookieManagerProc(const callback: TCefCompletionCallbackProc): ICefCookieManager;
/// <summary>
/// Register a scheme handler factory for the specified |scheme_name| and
/// optional |domain_name|. An NULL |domain_name| value for a standard scheme
/// will cause the factory to match all domain names. The |domain_name| value
/// will be ignored for non-standard schemes. If |scheme_name| is a built-in
/// scheme and no handler is returned by |factory| then the built-in scheme
/// handler factory will be called. If |scheme_name| is a custom scheme then
/// you must also implement the cef_app_t::on_register_custom_schemes()
/// function in all processes. This function may be called multiple times to
/// change or remove the factory that matches the specified |scheme_name| and
/// optional |domain_name|. Returns false (0) if an error occurs. This
/// function may be called on any thread in the browser process.
/// </summary>
function RegisterSchemeHandlerFactory(const schemeName, domainName: ustring; const factory: ICefSchemeHandlerFactory): Boolean; function RegisterSchemeHandlerFactory(const schemeName, domainName: ustring; const factory: ICefSchemeHandlerFactory): Boolean;
/// <summary>
/// Clear all registered scheme handler factories. Returns false (0) on error.
/// This function may be called on any thread in the browser process.
/// </summary>
function ClearSchemeHandlerFactories: Boolean; function ClearSchemeHandlerFactories: Boolean;
/// <summary>
/// Clears all certificate exceptions that were added as part of handling
/// cef_request_handler_t::on_certificate_error(). If you call this it is
/// recommended that you also call close_all_connections() or you risk not
/// being prompted again for server certificates if you reconnect quickly. If
/// |callback| is non-NULL it will be executed on the UI thread after
/// completion.
/// </summary>
procedure ClearCertificateExceptions(const callback: ICefCompletionCallback); procedure ClearCertificateExceptions(const callback: ICefCompletionCallback);
/// <summary>
/// Clears all HTTP authentication credentials that were added as part of
/// handling GetAuthCredentials. If |callback| is non-NULL it will be executed
/// on the UI thread after completion.
/// </summary>
procedure ClearHttpAuthCredentials(const callback: ICefCompletionCallback); procedure ClearHttpAuthCredentials(const callback: ICefCompletionCallback);
/// <summary>
/// Clears all active and idle connections that Chromium currently has. This
/// is only recommended if you have released all other CEF objects but don't
/// yet want to call cef_shutdown(). If |callback| is non-NULL it will be
/// executed on the UI thread after completion.
/// </summary>
procedure CloseAllConnections(const callback: ICefCompletionCallback); procedure CloseAllConnections(const callback: ICefCompletionCallback);
/// <summary>
/// Attempts to resolve |origin| to a list of associated IP addresses.
/// |callback| will be executed on the UI thread after completion.
/// </summary>
procedure ResolveHost(const origin: ustring; const callback: ICefResolveCallback); procedure ResolveHost(const origin: ustring; const callback: ICefResolveCallback);
/// <summary>
/// Load an extension.
///
/// If extension resources will be read from disk using the default load
/// implementation then |root_directory| should be the absolute path to the
/// extension resources directory and |manifest| should be NULL. If extension
/// resources will be provided by the client (e.g. via cef_request_handler_t
/// and/or cef_extension_handler_t) then |root_directory| should be a path
/// component unique to the extension (if not absolute this will be internally
/// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the
/// contents that would otherwise be read from the "manifest.json" file on
/// disk.
///
/// The loaded extension will be accessible in all contexts sharing the same
/// storage (HasExtension returns true (1)). However, only the context on
/// which this function was called is considered the loader (DidLoadExtension
/// returns true (1)) and only the loader will receive
/// cef_request_context_handler_t callbacks for the extension.
///
/// cef_extension_handler_t::OnExtensionLoaded will be called on load success
/// or cef_extension_handler_t::OnExtensionLoadFailed will be called on load
/// failure.
///
/// If the extension specifies a background script via the "background"
/// manifest key then cef_extension_handler_t::OnBeforeBackgroundBrowser will
/// be called to create the background browser. See that function for
/// additional information about background scripts.
///
/// For visible extension views the client application should evaluate the
/// manifest to determine the correct extension URL to load and then pass that
/// URL to the cef_browser_host_t::CreateBrowser* function after the extension
/// has loaded. For example, the client can look for the "browser_action"
/// manifest key as documented at
/// https://developer.chrome.com/extensions/browserAction. Extension URLs take
/// the form "chrome-extension://<extension_id>/<path>".
///
/// Browsers that host extensions differ from normal browsers as follows:
/// - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit
/// chrome://extensions-support for the list of extension APIs currently
/// supported by CEF.
/// - Main frame navigation to non-extension content is blocked.
/// - Pinch-zooming is disabled.
/// - CefBrowserHost::GetExtension returns the hosted extension.
/// - CefBrowserHost::IsBackgroundHost returns true for background hosts.
///
/// See https://developer.chrome.com/extensions for extension implementation
/// and usage documentation.
/// </summary>
procedure LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue; const handler: ICefExtensionHandler); procedure LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue; const handler: ICefExtensionHandler);
/// <summary>
/// Returns true (1) if this context was used to load the extension identified
/// by |extension_id|. Other contexts sharing the same storage will also have
/// access to the extension (see HasExtension). This function must be called
/// on the browser process UI thread.
/// </summary>
function DidLoadExtension(const extension_id: ustring): boolean; function DidLoadExtension(const extension_id: ustring): boolean;
/// <summary>
/// Returns true (1) if this context has access to the extension identified by
/// |extension_id|. This may not be the context that was used to load the
/// extension (see DidLoadExtension). This function must be called on the
/// browser process UI thread.
/// </summary>
function HasExtension(const extension_id: ustring): boolean; function HasExtension(const extension_id: ustring): boolean;
/// <summary>
/// Retrieve the list of all extensions that this context has access to (see
/// HasExtension). |extension_ids| will be populated with the list of
/// extension ID values. Returns true (1) on success. This function must be
/// called on the browser process UI thread.
/// </summary>
function GetExtensions(const extension_ids: TStringList): boolean; function GetExtensions(const extension_ids: TStringList): boolean;
/// <summary>
/// Returns the extension matching |extension_id| or NULL if no matching
/// extension is accessible in this context (see HasExtension). This function
/// must be called on the browser process UI thread.
///
function GetExtension(const extension_id: ustring): ICefExtension; function GetExtension(const extension_id: ustring): ICefExtension;
/// <summary>
/// Returns the MediaRouter object associated with this context. If
/// |callback| is non-NULL it will be executed asnychronously on the UI thread
/// after the manager's context has been initialized.
/// </summary>
function GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter; function GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter;
/// <summary>
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are NULL the default value will be returned.
/// Returns nullptr if no value is configured. Must be called on the browser
/// process UI thread.
/// </summary>
function GetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): ICefValue;
/// <summary>
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are NULL, and the context is not incognito,
/// the default value will be set. Pass nullptr for |value| to remove the
/// default value for this content type.
///
/// WARNING: Incorrect usage of this function may cause instability or
/// security issues in Chromium. Make sure that you first understand the
/// potential impact of any changes to |content_type| by reviewing the related
/// source code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
/// </summary>
procedure SetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue);
/// <summary>
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are NULL the default value will be returned.
/// Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must
/// be called on the browser process UI thread.
/// </summary>
function GetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): TCefContentSettingValues;
/// <summary>
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are NULL, and the context is not incognito,
/// the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for
/// |value| to use the default value for this content type.
///
/// WARNING: Incorrect usage of this function may cause instability or
/// security issues in Chromium. Make sure that you first understand the
/// potential impact of any changes to |content_type| by reviewing the related
/// source code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
/// </summary>
procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
public public
class function UnWrap(data: Pointer): ICefRequestContext; reintroduce; class function UnWrap(data: Pointer): ICefRequestContext; reintroduce;
/// <summary>
/// Returns the global context object.
/// </summary>
class function Global: ICefRequestContext; reintroduce; class function Global: ICefRequestContext; reintroduce;
/// <summary>
/// Creates a new context object with the specified |settings| and optional
/// |handler|.
/// </summary>
class function New(const settings: PCefRequestContextSettings; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload; class function New(const settings: PCefRequestContextSettings; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload;
class function New(const aCache, aAcceptLanguageList, aCookieableSchemesList : ustring; aCookieableSchemesExcludeDefaults, aPersistSessionCookies, aPersistUserPreferences : boolean; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload; class function New(const aCache, aAcceptLanguageList, aCookieableSchemesList : ustring; aCookieableSchemesExcludeDefaults, aPersistSessionCookies, aPersistUserPreferences : boolean; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload;
/// <summary>
/// Creates a new context object that shares storage with |other| and uses an
/// optional |handler|.
/// </summary>
class function Shared(const other: ICefRequestContext; const handler: ICefRequestContextHandler): ICefRequestContext; class function Shared(const other: ICefRequestContext; const handler: ICefRequestContextHandler): ICefRequestContext;
end; end;
@ -106,7 +341,7 @@ implementation
uses uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager, uCEFRequestContextHandler, uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager, uCEFRequestContextHandler,
uCEFExtension, uCEFStringList, uCEFMediaRouter; uCEFExtension, uCEFStringList, uCEFMediaRouter, uCEFValue;
function TCefRequestContextRef.ClearSchemeHandlerFactories: Boolean; function TCefRequestContextRef.ClearSchemeHandlerFactories: Boolean;
begin begin
@ -262,6 +497,42 @@ begin
Result := TCefMediaRouterRef.UnWrap(PCefRequestContext(FData)^.get_media_router(PCefRequestContext(FData), CefGetData(callback))); Result := TCefMediaRouterRef.UnWrap(PCefRequestContext(FData)^.get_media_router(PCefRequestContext(FData), CefGetData(callback)));
end; end;
function TCefRequestContextRef.GetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): ICefValue;
var
TempRequestingURL, TempTopLevelURL : TCefString;
begin
TempRequestingURL := CefString(requesting_url);
TempTopLevelURL := CefString(top_level_url);
Result := TCefValueRef.UnWrap(PCefRequestContext(FData)^.get_website_setting(PCefRequestContext(FData), @TempRequestingURL, @TempTopLevelURL, content_type));
end;
procedure TCefRequestContextRef.SetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue);
var
TempRequestingURL, TempTopLevelURL : TCefString;
begin
TempRequestingURL := CefString(requesting_url);
TempTopLevelURL := CefString(top_level_url);
PCefRequestContext(FData)^.set_website_setting(PCefRequestContext(FData), @TempRequestingURL, @TempTopLevelURL, content_type, CefGetData(value));
end;
function TCefRequestContextRef.GetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): TCefContentSettingValues;
var
TempRequestingURL, TempTopLevelURL : TCefString;
begin
TempRequestingURL := CefString(requesting_url);
TempTopLevelURL := CefString(top_level_url);
Result := PCefRequestContext(FData)^.get_content_setting(PCefRequestContext(FData), @TempRequestingURL, @TempTopLevelURL, content_type);
end;
procedure TCefRequestContextRef.SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
var
TempRequestingURL, TempTopLevelURL : TCefString;
begin
TempRequestingURL := CefString(requesting_url);
TempTopLevelURL := CefString(top_level_url);
PCefRequestContext(FData)^.set_content_setting(PCefRequestContext(FData), @TempRequestingURL, @TempTopLevelURL, content_type, value);
end;
function TCefRequestContextRef.RegisterSchemeHandlerFactory(const schemeName : ustring; function TCefRequestContextRef.RegisterSchemeHandlerFactory(const schemeName : ustring;
const domainName : ustring; const domainName : ustring;
const factory : ICefSchemeHandlerFactory): Boolean; const factory : ICefSchemeHandlerFactory): Boolean;

View File

@ -57,15 +57,34 @@ uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type type
/// <summary>
/// CEF string maps are a set of key/value string pairs.
/// </summary>
TCefCustomStringList = class(TInterfacedObject, ICefStringList) TCefCustomStringList = class(TInterfacedObject, ICefStringList)
protected protected
FHandle : TCefStringList; FHandle : TCefStringList;
function GetHandle: TCefStringMap; virtual; function GetHandle: TCefStringMap; virtual;
/// <summary>
/// Return the number of elements in the string list.
/// </summary>
function GetSize: NativeUInt; virtual; function GetSize: NativeUInt; virtual;
/// <summary>
/// Retrieve the value at the specified zero-based string list index. Returns
/// true (1) if the value was successfully retrieved.
/// </summary>
function GetValue(index: NativeUInt): ustring; virtual; function GetValue(index: NativeUInt): ustring; virtual;
/// <summary>
/// Append a new value at the end of the string list.
/// </summary>
procedure Append(const value: ustring); virtual; procedure Append(const value: ustring); virtual;
/// <summary>
/// Clear the string list.
/// </summary>
procedure Clear; virtual; procedure Clear; virtual;
/// <summary>
/// Creates a copy of an existing string list.
/// </summary>
function Copy : TCefStringList; virtual; function Copy : TCefStringList; virtual;
procedure CopyToStrings(const aStrings : TStrings); virtual; procedure CopyToStrings(const aStrings : TStrings); virtual;
procedure AddStrings(const aStrings : TStrings); virtual; procedure AddStrings(const aStrings : TStrings); virtual;
@ -76,7 +95,13 @@ type
TCefStringListOwn = class(TCefCustomStringList) TCefStringListOwn = class(TCefCustomStringList)
public public
/// <summary>
/// Allocate a new string map.
/// </summary>
constructor Create; override; constructor Create; override;
/// <summary>
/// Free the string list.
/// </summary>
destructor Destroy; override; destructor Destroy; override;
end; end;

View File

@ -52,16 +52,38 @@ uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type type
/// <summary>
/// CEF string maps are a set of key/value string pairs.
/// </summary>
TCefCustomStringMap = class(TInterfacedObject, ICefStringMap) TCefCustomStringMap = class(TInterfacedObject, ICefStringMap)
protected protected
FHandle : TCefStringMap; FHandle : TCefStringMap;
function GetHandle: TCefStringMap; virtual; function GetHandle: TCefStringMap; virtual;
/// <summary>
/// Return the number of elements in the string map.
/// </summary>
function GetSize: NativeUInt; virtual; function GetSize: NativeUInt; virtual;
/// <summary>
/// Return the value assigned to the specified key.
/// </summary>
function Find(const key: ustring): ustring; virtual; function Find(const key: ustring): ustring; virtual;
/// <summary>
/// Return the key at the specified zero-based string map index.
/// </summary>
function GetKey(index: NativeUInt): ustring; virtual; function GetKey(index: NativeUInt): ustring; virtual;
/// <summary>
/// Return the value at the specified zero-based string map index.
/// </summary>
function GetValue(index: NativeUInt): ustring; virtual; function GetValue(index: NativeUInt): ustring; virtual;
/// <summary>
/// Append a new key/value pair at the end of the string map. If the key exists,
/// overwrite the existing value with a new value w/o changing the pair order.
/// </summary>
function Append(const key, value: ustring) : boolean; virtual; function Append(const key, value: ustring) : boolean; virtual;
/// <summary>
/// Clear the string map.
/// </summary>
procedure Clear; virtual; procedure Clear; virtual;
public public
@ -70,7 +92,13 @@ type
TCefStringMapOwn = class(TCefCustomStringMap) TCefStringMapOwn = class(TCefCustomStringMap)
public public
/// <summary>
/// Allocate a new string map.
/// </summary>
constructor Create; override; constructor Create; override;
/// <summary>
/// Free the string map.
/// </summary>
destructor Destroy; override; destructor Destroy; override;
end; end;

View File

@ -52,17 +52,42 @@ uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type type
/// <summary>
/// CEF string multimaps are a set of key/value string pairs.
/// More than one value can be assigned to a single key.
/// </summary>
TCefCustomStringMultimap = class(TInterfacedObject, ICefStringMultimap) TCefCustomStringMultimap = class(TInterfacedObject, ICefStringMultimap)
protected protected
FHandle : TCefStringMultimap; FHandle : TCefStringMultimap;
function GetHandle: TCefStringMultimap; virtual; function GetHandle: TCefStringMultimap; virtual;
/// <summary>
/// Return the number of elements in the string multimap.
/// </summary>
function GetSize: NativeUInt; virtual; function GetSize: NativeUInt; virtual;
/// <summary>
/// Return the number of values with the specified key.
/// </summary>
function FindCount(const Key: ustring): NativeUInt; virtual; function FindCount(const Key: ustring): NativeUInt; virtual;
/// <summary>
/// Return the value_index-th value with the specified key.
/// </summary>
function GetEnumerate(const Key: ustring; ValueIndex: NativeUInt): ustring; virtual; function GetEnumerate(const Key: ustring; ValueIndex: NativeUInt): ustring; virtual;
/// <summary>
/// Return the key at the specified zero-based string multimap index.
/// </summary>
function GetKey(Index: NativeUInt): ustring; virtual; function GetKey(Index: NativeUInt): ustring; virtual;
/// <summary>
/// Return the value at the specified zero-based string multimap index.
/// </summary>
function GetValue(Index: NativeUInt): ustring; virtual; function GetValue(Index: NativeUInt): ustring; virtual;
/// <summary>
/// Append a new key/value pair at the end of the string multimap.
/// </summary>
function Append(const Key, Value: ustring) : boolean; virtual; function Append(const Key, Value: ustring) : boolean; virtual;
/// <summary>
/// Clear the string multimap.
/// </summary>
procedure Clear; virtual; procedure Clear; virtual;
public public
@ -71,7 +96,13 @@ type
TCefStringMultimapOwn = class(TCefCustomStringMultimap) TCefStringMultimapOwn = class(TCefCustomStringMultimap)
public public
/// <summary>
/// Allocate a new string multimap.
/// </summary>
constructor Create; override; constructor Create; override;
/// <summary>
/// Free the string multimap.
/// </summary>
destructor Destroy; override; destructor Destroy; override;
end; end;

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
CEF_SUPPORTED_VERSION_MAJOR = 114; CEF_SUPPORTED_VERSION_MAJOR = 115;
CEF_SUPPORTED_VERSION_MINOR = 2; CEF_SUPPORTED_VERSION_MINOR = 3;
CEF_SUPPORTED_VERSION_RELEASE = 13; CEF_SUPPORTED_VERSION_RELEASE = 11;
CEF_SUPPORTED_VERSION_BUILD = 0; CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = CEF_SUPPORTED_VERSION_MAJOR; CEF_CHROMEELF_VERSION_MAJOR = CEF_SUPPORTED_VERSION_MAJOR;
CEF_CHROMEELF_VERSION_MINOR = 0; CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 5735; CEF_CHROMEELF_VERSION_RELEASE = 5790;
CEF_CHROMEELF_VERSION_BUILD = 200; CEF_CHROMEELF_VERSION_BUILD = 114;

View File

@ -97,6 +97,7 @@ type
TOnWindowActivationChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; active: boolean) of object; TOnWindowActivationChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; active: boolean) of object;
TOnWindowBoundsChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; const new_bounds: TCefRect) of object; TOnWindowBoundsChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; const new_bounds: TCefRect) of object;
TOnGetParentWindowEvent = procedure(const Sender: TObject; const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object; TOnGetParentWindowEvent = procedure(const Sender: TObject; const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object;
TOnIsWindowModalDialogEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
TOnGetInitialBoundsEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : TCefRect) of object; TOnGetInitialBoundsEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : TCefRect) of object;
TOnGetInitialShowStateEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : TCefShowState) of object; TOnGetInitialShowStateEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : TCefShowState) of object;
TOnIsFramelessEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object; TOnIsFramelessEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;

View File

@ -57,44 +57,265 @@ uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes, uCEFPanel; uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes, uCEFPanel;
type type
/// <summary>
/// A Window is a top-level Window/widget in the Views hierarchy. By default it
/// will have a non-client area with title bar, icon and buttons that supports
/// moving and resizing. All size and position values are in density independent
/// pixels (DIP) unless otherwise indicated. Methods must be called on the
/// browser process UI thread unless otherwise indicated.
/// </summary>
TCefWindowRef = class(TCefPanelRef, ICefWindow) TCefWindowRef = class(TCefPanelRef, ICefWindow)
protected protected
/// <summary>
/// Show the Window.
/// </summary>
procedure Show; procedure Show;
/// <summary>
/// Show the Window as a browser modal dialog relative to |browser_view|. A
/// parent Window must be returned via
/// cef_window_delegate_t::get_parent_window() and |browser_view| must belong
/// to that parent Window. While this Window is visible, |browser_view| will
/// be disabled while other controls in the parent Window remain enabled.
/// Navigating or destroying the |browser_view| will close this Window
/// automatically. Alternately, use show() and return true (1) from
/// cef_window_delegate_t::is_window_modal_dialog() for a window modal dialog
/// where all controls in the parent Window are disabled.
/// </summary>
procedure ShowAsBrowserModalDialog(const browser_view: ICefBrowserView);
/// <summary>
/// Hide the Window.
/// </summary>
procedure Hide; procedure Hide;
/// <summary>
/// Sizes the Window to |size| and centers it in the current display.
/// </summary>
procedure CenterWindow(const size_: TCefSize); procedure CenterWindow(const size_: TCefSize);
/// <summary>
/// Close the Window.
/// </summary>
procedure Close; procedure Close;
/// <summary>
/// Returns true (1) if the Window has been closed.
/// </summary>
function IsClosed : boolean; function IsClosed : boolean;
/// <summary>
/// Activate the Window, assuming it already exists and is visible.
/// </summary>
procedure Activate; procedure Activate;
/// <summary>
/// Deactivate the Window, making the next Window in the Z order the active
/// Window.
/// </summary>
procedure Deactivate; procedure Deactivate;
/// <summary>
/// Returns whether the Window is the currently active Window.
/// </summary>
function IsActive : boolean; function IsActive : boolean;
/// <summary>
/// Bring this Window to the top of other Windows in the Windowing system.
/// </summary>
procedure BringToTop; procedure BringToTop;
/// <summary>
/// Set the Window to be on top of other Windows in the Windowing system.
/// </summary>
procedure SetAlwaysOnTop(on_top: boolean); procedure SetAlwaysOnTop(on_top: boolean);
/// <summary>
/// Returns whether the Window has been set to be on top of other Windows in
/// the Windowing system.
/// </summary>
function IsAlwaysOnTop : boolean; function IsAlwaysOnTop : boolean;
/// <summary>
/// Maximize the Window.
/// </summary>
procedure Maximize; procedure Maximize;
/// <summary>
/// Minimize the Window.
/// </summary>
procedure Minimize; procedure Minimize;
/// <summary>
/// Restore the Window.
/// </summary>
procedure Restore; procedure Restore;
/// <summary>
/// Set fullscreen Window state.
/// </summary>
procedure SetFullscreen(fullscreen: boolean); procedure SetFullscreen(fullscreen: boolean);
/// <summary>
/// Returns true (1) if the Window is maximized.
/// </summary>
function IsMaximized : boolean; function IsMaximized : boolean;
/// <summary>
/// Returns true (1) if the Window is minimized.
/// </summary>
function IsMinimized : boolean; function IsMinimized : boolean;
/// <summary>
/// Returns true (1) if the Window is fullscreen.
/// </summary>
function IsFullscreen : boolean; function IsFullscreen : boolean;
/// <summary>
/// Set the Window title.
/// </summary>
procedure SetTitle(const title_: ustring); procedure SetTitle(const title_: ustring);
/// <summary>
/// Get the Window title.
/// </summary>
function GetTitle : ustring; function GetTitle : ustring;
/// <summary>
/// Set the Window icon. This should be a 16x16 icon suitable for use in the
/// Windows's title bar.
/// </summary>
procedure SetWindowIcon(const image: ICefImage); procedure SetWindowIcon(const image: ICefImage);
/// <summary>
/// Get the Window icon.
/// </summary>
function GetWindowIcon : ICefImage; function GetWindowIcon : ICefImage;
/// <summary>
/// Set the Window App icon. This should be a larger icon for use in the host
/// environment app switching UI. On Windows, this is the ICON_BIG used in
/// Alt-Tab list and Windows taskbar. The Window icon will be used by default
/// if no Window App icon is specified.
/// </summary>
procedure SetWindowAppIcon(const image: ICefImage); procedure SetWindowAppIcon(const image: ICefImage);
/// <summary>
/// Get the Window App icon.
/// </summary>
function GetWindowAppIcon : ICefImage; function GetWindowAppIcon : ICefImage;
/// <summary>
/// Add a View that will be overlayed on the Window contents with absolute
/// positioning and high z-order. Positioning is controlled by |docking_mode|
/// as described below. The returned cef_overlay_controller_t object is used
/// to control the overlay. Overlays are hidden by default.
///
/// With CEF_DOCKING_MODE_CUSTOM:
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
/// and positioned in the top-left corner.
/// 2. Optionally change the overlay position and/or size by calling
/// CefOverlayController methods.
/// 3. Call CefOverlayController::SetVisible(true) to show the overlay.
/// 4. The overlay will be automatically re-sized if |view|'s layout
/// changes. Optionally change the overlay position and/or size when
/// OnLayoutChanged is called on the Window's delegate to indicate a
/// change in Window bounds.
///
/// With other docking modes:
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
/// and positioned based on |docking_mode|.
/// 2. Call CefOverlayController::SetVisible(true) to show the overlay.
/// 3. The overlay will be automatically re-sized if |view|'s layout changes
/// and re-positioned as appropriate when the Window resizes.
///
/// Overlays created by this function will receive a higher z-order then any
/// child Views added previously. It is therefore recommended to call this
/// function last after all other child Views have been added so that the
/// overlay displays as the top-most child of the Window.
/// </summary>
function AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController; function AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController;
/// <summary>
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
/// position in screen coordinates. |anchor_position| specifies how the menu
/// will be anchored relative to |screen_point|.
/// </summary>
procedure ShowMenu(const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition); procedure ShowMenu(const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition);
/// <summary>
/// Cancel the menu that is currently showing, if any.
/// </summary>
procedure CancelMenu; procedure CancelMenu;
/// <summary>
/// Returns the Display that most closely intersects the bounds of this
/// Window. May return NULL if this Window is not currently displayed.
/// </summary>
function GetDisplay : ICefDisplay; function GetDisplay : ICefDisplay;
/// <summary>
/// Returns the bounds (size and position) of this Window's client area.
/// Position is in screen coordinates.
/// </summary>
function GetClientAreaBoundsInScreen : TCefRect; function GetClientAreaBoundsInScreen : TCefRect;
/// <summary>
/// Set the regions where mouse events will be intercepted by this Window to
/// support drag operations. Call this function with an NULL vector to clear
/// the draggable regions. The draggable region bounds should be in window
/// coordinates.
/// </summary>
procedure SetDraggableRegions(regionsCount: NativeUInt; const regions: PCefDraggableRegionArray); procedure SetDraggableRegions(regionsCount: NativeUInt; const regions: PCefDraggableRegionArray);
/// <summary>
/// Retrieve the platform window handle for this Window.
/// </summary>
function GetWindowHandle : TCefWindowHandle; function GetWindowHandle : TCefWindowHandle;
/// <summary>
/// Simulate a key press. |key_code| is the VKEY_* value from Chromium's
/// ui/events/keycodes/keyboard_codes.h header (VK_* values on Windows).
/// |event_flags| is some combination of EVENTFLAG_SHIFT_DOWN,
/// EVENTFLAG_CONTROL_DOWN and/or EVENTFLAG_ALT_DOWN. This function is exposed
/// primarily for testing purposes.
/// </summary>
procedure SendKeyPress(key_code: Integer; event_flags: cardinal); procedure SendKeyPress(key_code: Integer; event_flags: cardinal);
/// <summary>
/// Simulate a mouse move. The mouse cursor will be moved to the specified
/// (screen_x, screen_y) position. This function is exposed primarily for
/// testing purposes.
/// </summary>
procedure SendMouseMove(screen_x, screen_y: Integer); procedure SendMouseMove(screen_x, screen_y: Integer);
/// <summary>
/// Simulate mouse down and/or mouse up events. |button| is the mouse button
/// type. If |mouse_down| is true (1) a mouse down event will be sent. If
/// |mouse_up| is true (1) a mouse up event will be sent. If both are true (1)
/// a mouse down event will be sent followed by a mouse up event (equivalent
/// to clicking the mouse button). The events will be sent using the current
/// cursor position so make sure to call send_mouse_move() first to position
/// the mouse. This function is exposed primarily for testing purposes.
/// </summary>
procedure SendMouseEvents(button: TCefMouseButtonType; mouse_down, mouse_up: boolean); procedure SendMouseEvents(button: TCefMouseButtonType; mouse_down, mouse_up: boolean);
/// <summary>
/// Set the keyboard accelerator for the specified |command_id|. |key_code|
/// can be any virtual key or character value.
/// cef_window_delegate_t::OnAccelerator will be called if the keyboard
/// combination is triggered while this window has focus.
/// </summary>
procedure SetAccelerator(command_id, key_code : Integer; shift_pressed, ctrl_pressed, alt_pressed: boolean); procedure SetAccelerator(command_id, key_code : Integer; shift_pressed, ctrl_pressed, alt_pressed: boolean);
/// <summary>
/// Remove the keyboard accelerator for the specified |command_id|.
/// </summary>
procedure RemoveAccelerator(command_id: Integer); procedure RemoveAccelerator(command_id: Integer);
/// <summary>
/// Remove all keyboard accelerators.
/// </summary>
procedure RemoveAllAccelerators; procedure RemoveAllAccelerators;
public public
@ -112,6 +333,11 @@ begin
PCefWindow(FData)^.show(PCefWindow(FData)); PCefWindow(FData)^.show(PCefWindow(FData));
end; end;
procedure TCefWindowRef.ShowAsBrowserModalDialog(const browser_view: ICefBrowserView);
begin
PCefWindow(FData)^.show_as_browser_modal_dialog(PCefWindow(FData), CefGetData(browser_view));
end;
procedure TCefWindowRef.Hide; procedure TCefWindowRef.Hide;
begin begin
PCefWindow(FData)^.hide(PCefWindow(FData)); PCefWindow(FData)^.hide(PCefWindow(FData));

View File

@ -73,6 +73,7 @@ type
FOnWindowActivationChanged : TOnWindowActivationChangedEvent; FOnWindowActivationChanged : TOnWindowActivationChangedEvent;
FOnWindowBoundsChanged : TOnWindowBoundsChangedEvent; FOnWindowBoundsChanged : TOnWindowBoundsChangedEvent;
FOnGetParentWindow : TOnGetParentWindowEvent; FOnGetParentWindow : TOnGetParentWindowEvent;
FOnIsWindowModalDialog : TOnIsWindowModalDialogEvent;
FOnGetInitialBounds : TOnGetInitialBoundsEvent; FOnGetInitialBounds : TOnGetInitialBoundsEvent;
FOnGetInitialShowState : TOnGetInitialShowStateEvent; FOnGetInitialShowState : TOnGetInitialShowStateEvent;
FOnIsFrameless : TOnIsFramelessEvent; FOnIsFrameless : TOnIsFramelessEvent;
@ -119,6 +120,7 @@ type
procedure doOnWindowActivationChanged(const window_: ICefWindow; active: boolean); procedure doOnWindowActivationChanged(const window_: ICefWindow; active: boolean);
procedure doOnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); procedure doOnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect);
procedure doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); procedure doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
procedure doOnIsWindowModalDialog(const window_: ICefWindow; var aResult : boolean);
procedure doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
procedure doOnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); procedure doOnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState);
procedure doOnIsFrameless(const window_: ICefWindow; var aResult : boolean); procedure doOnIsFrameless(const window_: ICefWindow; var aResult : boolean);
@ -178,6 +180,7 @@ type
property OnWindowActivationChanged : TOnWindowActivationChangedEvent read FOnWindowActivationChanged write FOnWindowActivationChanged; property OnWindowActivationChanged : TOnWindowActivationChangedEvent read FOnWindowActivationChanged write FOnWindowActivationChanged;
property OnWindowBoundsChanged : TOnWindowBoundsChangedEvent read FOnWindowBoundsChanged write FOnWindowBoundsChanged; property OnWindowBoundsChanged : TOnWindowBoundsChangedEvent read FOnWindowBoundsChanged write FOnWindowBoundsChanged;
property OnGetParentWindow : TOnGetParentWindowEvent read FOnGetParentWindow write FOnGetParentWindow; property OnGetParentWindow : TOnGetParentWindowEvent read FOnGetParentWindow write FOnGetParentWindow;
property OnIsWindowModalDialog : TOnIsWindowModalDialogEvent read FOnIsWindowModalDialog write FOnIsWindowModalDialog;
property OnGetInitialBounds : TOnGetInitialBoundsEvent read FOnGetInitialBounds write FOnGetInitialBounds; property OnGetInitialBounds : TOnGetInitialBoundsEvent read FOnGetInitialBounds write FOnGetInitialBounds;
property OnGetInitialShowState : TOnGetInitialShowStateEvent read FOnGetInitialShowState write FOnGetInitialShowState; property OnGetInitialShowState : TOnGetInitialShowStateEvent read FOnGetInitialShowState write FOnGetInitialShowState;
property OnIsFrameless : TOnIsFramelessEvent read FOnIsFrameless write FOnIsFrameless; property OnIsFrameless : TOnIsFramelessEvent read FOnIsFrameless write FOnIsFrameless;
@ -240,6 +243,7 @@ begin
FOnWindowActivationChanged := nil; FOnWindowActivationChanged := nil;
FOnWindowBoundsChanged := nil; FOnWindowBoundsChanged := nil;
FOnGetParentWindow := nil; FOnGetParentWindow := nil;
FOnIsWindowModalDialog := nil;
FOnGetInitialBounds := nil; FOnGetInitialBounds := nil;
FOnGetInitialShowState := nil; FOnGetInitialShowState := nil;
FOnIsFrameless := nil; FOnIsFrameless := nil;
@ -348,6 +352,12 @@ begin
FOnGetParentWindow(self, window_, is_menu, can_activate_menu, aResult); FOnGetParentWindow(self, window_, is_menu, can_activate_menu, aResult);
end; end;
procedure TCEFWindowComponent.doOnIsWindowModalDialog(const window_: ICefWindow; var aResult : boolean);
begin
if assigned(FOnIsWindowModalDialog) then
FOnIsWindowModalDialog(self, window_, aResult);
end;
procedure TCEFWindowComponent.doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure TCEFWindowComponent.doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
begin begin
if assigned(FOnGetInitialBounds) then if assigned(FOnGetInitialBounds) then

View File

@ -65,6 +65,7 @@ type
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean);
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect);
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean);
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState);
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean);
@ -90,6 +91,7 @@ type
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); virtual; procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); virtual;
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); virtual; procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); virtual;
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); virtual; procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); virtual;
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean); virtual;
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); virtual; procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); virtual;
procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); virtual; procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); virtual;
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); virtual; procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); virtual;
@ -132,6 +134,7 @@ type
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); override; procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); override;
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); override; procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); override;
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override; procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override;
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean); override;
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); override; procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); override;
procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); override; procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); override;
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); override; procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); override;
@ -201,6 +204,11 @@ begin
can_activate_menu := TempCanActivateMenu <> 0; can_activate_menu := TempCanActivateMenu <> 0;
end; end;
procedure TCefWindowDelegateRef.OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean);
begin
aResult := (PCefWindowDelegate(FData)^.is_window_modal_dialog(PCefWindowDelegate(FData), CefGetData(window_)) <> 0);
end;
procedure TCefWindowDelegateRef.OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure TCefWindowDelegateRef.OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
begin begin
aResult := PCefWindowDelegate(FData)^.get_initial_bounds(PCefWindowDelegate(FData), CefGetData(window_)); aResult := PCefWindowDelegate(FData)^.get_initial_bounds(PCefWindowDelegate(FData), CefGetData(window_));
@ -333,6 +341,20 @@ begin
Result := CefGetData(TempWindow); Result := CefGetData(TempWindow);
end; end;
function cef_window_delegate_is_window_modal_dialog(self: PCefWindowDelegate; window_: PCefWindow): Integer; stdcall;
var
TempObject : TObject;
TempResult : boolean;
begin
TempObject := CefGetObject(self);
TempResult := False;
if (TempObject <> nil) and (TempObject is TCefWindowDelegateOwn) then
TCefWindowDelegateOwn(TempObject).OnIsWindowModalDialog(TCefWindowRef.UnWrap(window_), TempResult);
Result := ord(TempResult);
end;
function cef_window_delegate_get_initial_bounds(self: PCefWindowDelegate; window_: PCefWindow): TCefRect; stdcall; function cef_window_delegate_get_initial_bounds(self: PCefWindowDelegate; window_: PCefWindow): TCefRect; stdcall;
var var
TempObject : TObject; TempObject : TObject;
@ -498,6 +520,7 @@ begin
on_window_destroyed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_destroyed; on_window_destroyed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_destroyed;
on_window_activation_changed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_activation_changed; on_window_activation_changed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_activation_changed;
get_parent_window := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_parent_window; get_parent_window := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_parent_window;
is_window_modal_dialog := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_is_window_modal_dialog;
get_initial_bounds := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_bounds; get_initial_bounds := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_bounds;
get_initial_show_state := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_show_state; get_initial_show_state := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_show_state;
is_frameless := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_is_frameless; is_frameless := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_is_frameless;
@ -541,6 +564,11 @@ begin
// //
end; end;
procedure TCefWindowDelegateOwn.OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean);
begin
//
end;
procedure TCefWindowDelegateOwn.OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure TCefWindowDelegateOwn.OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
begin begin
// //
@ -789,6 +817,17 @@ begin
end; end;
end; end;
procedure TCustomWindowDelegate.OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean);
begin
try
if (FEvents <> nil) then
ICefWindowDelegateEvents(FEvents).doOnIsWindowModalDialog(window_, aResult);
except
on e : exception do
if CustomExceptionHandler('TCustomWindowDelegate.OnIsWindowModalDialog', e) then raise;
end;
end;
procedure TCustomWindowDelegate.OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure TCustomWindowDelegate.OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
begin begin
try try

View File

@ -64,10 +64,8 @@ type
function GetLocalityName: ustring; function GetLocalityName: ustring;
function GetStateOrProvinceName: ustring; function GetStateOrProvinceName: ustring;
function GetCountryName: ustring; function GetCountryName: ustring;
procedure GetStreetAddresses(const addresses: TStrings);
procedure GetOrganizationNames(const names: TStrings); procedure GetOrganizationNames(const names: TStrings);
procedure GetOrganizationUnitNames(const names: TStrings); procedure GetOrganizationUnitNames(const names: TStrings);
procedure GetDomainComponents(const components: TStrings);
public public
class function UnWrap(data: Pointer): ICefX509CertPrincipal; class function UnWrap(data: Pointer): ICefX509CertPrincipal;
@ -108,18 +106,6 @@ begin
Result := CefStringFreeAndGet(PCefX509CertPrincipal(FData)^.get_country_name(PCefX509CertPrincipal(FData))); Result := CefStringFreeAndGet(PCefX509CertPrincipal(FData)^.get_country_name(PCefX509CertPrincipal(FData)));
end; end;
procedure TCefX509CertPrincipalRef.GetStreetAddresses(const addresses: TStrings);
var
TempSL : ICefStringList;
begin
if (addresses <> nil) then
begin
TempSL := TCefStringListOwn.Create;
PCefX509CertPrincipal(FData)^.get_street_addresses(PCefX509CertPrincipal(FData), TempSL.Handle);
TempSL.CopyToStrings(addresses);
end;
end;
procedure TCefX509CertPrincipalRef.GetOrganizationNames(const names: TStrings); procedure TCefX509CertPrincipalRef.GetOrganizationNames(const names: TStrings);
var var
TempSL : ICefStringList; TempSL : ICefStringList;
@ -144,18 +130,6 @@ begin
end; end;
end; end;
procedure TCefX509CertPrincipalRef.GetDomainComponents(const components: TStrings);
var
TempSL : ICefStringList;
begin
if (components <> nil) then
begin
TempSL := TCefStringListOwn.Create;
PCefX509CertPrincipal(FData)^.get_domain_components(PCefX509CertPrincipal(FData), TempSL.Handle);
TempSL.CopyToStrings(components);
end;
end;
class function TCefX509CertPrincipalRef.UnWrap(data: Pointer): ICefX509CertPrincipal; class function TCefX509CertPrincipalRef.UnWrap(data: Pointer): ICefX509CertPrincipal;
begin begin
if (data <> nil) then if (data <> nil) then

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 494, "InternalVersion" : 495,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "114.2.13" "Version" : "115.3.11"
} }
], ],
"UpdatePackageData" : { "UpdatePackageData" : {