diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index b2cfd8ce..4e8d4bc4 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -52,7 +52,7 @@ uses {$ELSE} Windows, Classes, {$ENDIF} - uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar; + uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar, uCEFBrowserProcessHandler; const CEF_SUPPORTED_VERSION_MAJOR = 3; @@ -125,6 +125,7 @@ type FUpdateChromeVer : boolean; FShowMessageDlg : boolean; FSetCurrentDir : boolean; + FGlobalContextInitialized : boolean; FChromeVersionInfo : TFileVersionInfo; FLibHandle : THandle; FOnRegisterCustomSchemes : TOnRegisterCustomSchemes; @@ -135,6 +136,12 @@ type FDeviceScaleFactor : single; FCheckDevToolsResources : boolean; + // ICefBrowserProcessHandler + FOnContextInitializedEvent : TOnContextInitializedEvent; + FOnBeforeChildProcessLaunchEvent : TOnBeforeChildProcessLaunchEvent; + FOnRenderProcessThreadCreatedEvent : TOnRenderProcessThreadCreatedEvent; + FOnScheduleMessagePumpWorkEvent : TOnScheduleMessagePumpWorkEvent; + procedure SetFrameworkDirPath(const aValue : ustring); procedure SetResourcesDirPath(const aValue : ustring); procedure SetLocalesDirPath(const aValue : ustring); @@ -206,74 +213,82 @@ type function StartSubProcess : boolean; procedure UpdateDeviceScaleFactor; - // Internal procedures. Only TInternalApp should use them. + // Internal procedures. Only TInternalApp and TCefCustomBrowserProcessHandler should use them. procedure Internal_OnBeforeCommandLineProcessing(const processType: ustring; const commandLine: ICefCommandLine); procedure Internal_OnRegisterCustomSchemes(const registrar: TCefSchemeRegistrarRef); procedure Internal_OnGetResourceBundleHandler(var aCefResourceBundleHandler : ICefResourceBundleHandler); procedure Internal_OnGetBrowserProcessHandler(var aCefBrowserProcessHandler : ICefBrowserProcessHandler); procedure Internal_OnGetRenderProcessHandler(var aCefRenderProcessHandler : ICefRenderProcessHandler); + procedure Internal_OnContextInitialized; + procedure Internal_OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); + procedure Internal_OnRenderProcessThreadCreated(const extraInfo: ICefListValue); + procedure Internal_OnScheduleMessagePumpWork(const delayMs: Int64); - property Cache : ustring read FCache write FCache; - property Cookies : ustring read FCookies write FCookies; - property UserDataPath : ustring read FUserDataPath write FUserDataPath; - property UserAgent : ustring read FUserAgent write FUserAgent; - property ProductVersion : ustring read FProductVersion write FProductVersion; - property Locale : ustring read FLocale write FLocale; - property LogFile : ustring read FLogFile write FLogFile; - property BrowserSubprocessPath : ustring read FBrowserSubprocessPath write FBrowserSubprocessPath; - property FrameworkDirPath : ustring read FFrameworkDirPath write SetFrameworkDirPath; - property LogSeverity : TCefLogSeverity read FLogSeverity write FLogSeverity; - property JavaScriptFlags : ustring read FJavaScriptFlags write FJavaScriptFlags; - property ResourcesDirPath : ustring read FResourcesDirPath write SetResourcesDirPath; - property LocalesDirPath : ustring read FLocalesDirPath write SetLocalesDirPath; - property SingleProcess : Boolean read FSingleProcess write FSingleProcess; - property NoSandbox : Boolean read FNoSandbox write FNoSandbox; - property CommandLineArgsDisabled : Boolean read FCommandLineArgsDisabled write FCommandLineArgsDisabled; - property PackLoadingDisabled : Boolean read FPackLoadingDisabled write FPackLoadingDisabled; - property RemoteDebuggingPort : Integer read FRemoteDebuggingPort write FRemoteDebuggingPort; - property UncaughtExceptionStackSize : Integer read FUncaughtExceptionStackSize write FUncaughtExceptionStackSize; - property PersistSessionCookies : Boolean read FPersistSessionCookies write FPersistSessionCookies; - property PersistUserPreferences : Boolean read FPersistUserPreferences write FPersistUserPreferences; - property IgnoreCertificateErrors : Boolean read FIgnoreCertificateErrors write FIgnoreCertificateErrors; - property EnableNetSecurityExpiration : boolean read FEnableNetSecurityExpiration write FEnableNetSecurityExpiration; - property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor; - property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList; - property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo; - property WindowlessRenderingEnabled : Boolean read FWindowlessRenderingEnabled write FWindowlessRenderingEnabled; - property MultiThreadedMessageLoop : boolean read FMultiThreadedMessageLoop write FMultiThreadedMessageLoop; - property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump; - property DeleteCache : boolean read FDeleteCache write FDeleteCache; - property DeleteCookies : boolean read FDeleteCookies write FDeleteCookies; - property FlashEnabled : boolean read FFlashEnabled write FFlashEnabled; - property EnableSpellingService : boolean read FEnableSpellingService write FEnableSpellingService; - property EnableMediaStream : boolean read FEnableMediaStream write FEnableMediaStream; - property EnableSpeechInput : boolean read FEnableSpeechInput write FEnableSpeechInput; - property EnableGPU : boolean read FEnableGPU write FEnableGPU; - property CheckCEFFiles : boolean read FCheckCEFFiles write FCheckCEFFiles; - property ShowMessageDlg : boolean read FShowMessageDlg write FShowMessageDlg; - property SetCurrentDir : boolean read FSetCurrentDir write FSetCurrentDir; - property ChromeMajorVer : uint16 read FChromeVersionInfo.MajorVer; - property ChromeMinorVer : uint16 read FChromeVersionInfo.MinorVer; - property ChromeRelease : uint16 read FChromeVersionInfo.Release; - property ChromeBuild : uint16 read FChromeVersionInfo.Build; - property ChromeVersion : string read GetChromeVersion; - property LibCefPath : string read GetLibCefPath; - property ChromeElfPath : string read GetChromeElfPath; - property OnRegCustomSchemes : TOnRegisterCustomSchemes read FOnRegisterCustomSchemes write FOnRegisterCustomSchemes; - property ResourceBundleHandler : ICefResourceBundleHandler read FResourceBundleHandler write FResourceBundleHandler; - property BrowserProcessHandler : ICefBrowserProcessHandler read FBrowserProcessHandler write FBrowserProcessHandler; - property RenderProcessHandler : ICefRenderProcessHandler read FRenderProcessHandler write FRenderProcessHandler; - property SmoothScrolling : boolean read FSmoothScrolling write FSmoothScrolling; - property FastUnload : boolean read FFastUnload write FFastUnload; - property DisableSafeBrowsing : boolean read FDisableSafeBrowsing write FDisableSafeBrowsing; - property LibLoaded : boolean read FLibLoaded; - property EnableHighDPISupport : boolean read FEnableHighDPISupport write FEnableHighDPISupport; - property MuteAudio : boolean read FMuteAudio write FMuteAudio; - property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions; - property DeviceScaleFactor : single read FDeviceScaleFactor; - property CheckDevToolsResources : boolean read FCheckDevToolsResources write FCheckDevToolsResources; - property LocalesRequired : ustring read FLocalesRequired write FLocalesRequired; - property CustomFlashPath : ustring read FCustomFlashPath write FCustomFlashPath; + property Cache : ustring read FCache write FCache; + property Cookies : ustring read FCookies write FCookies; + property UserDataPath : ustring read FUserDataPath write FUserDataPath; + property UserAgent : ustring read FUserAgent write FUserAgent; + property ProductVersion : ustring read FProductVersion write FProductVersion; + property Locale : ustring read FLocale write FLocale; + property LogFile : ustring read FLogFile write FLogFile; + property BrowserSubprocessPath : ustring read FBrowserSubprocessPath write FBrowserSubprocessPath; + property FrameworkDirPath : ustring read FFrameworkDirPath write SetFrameworkDirPath; + property LogSeverity : TCefLogSeverity read FLogSeverity write FLogSeverity; + property JavaScriptFlags : ustring read FJavaScriptFlags write FJavaScriptFlags; + property ResourcesDirPath : ustring read FResourcesDirPath write SetResourcesDirPath; + property LocalesDirPath : ustring read FLocalesDirPath write SetLocalesDirPath; + property SingleProcess : Boolean read FSingleProcess write FSingleProcess; + property NoSandbox : Boolean read FNoSandbox write FNoSandbox; + property CommandLineArgsDisabled : Boolean read FCommandLineArgsDisabled write FCommandLineArgsDisabled; + property PackLoadingDisabled : Boolean read FPackLoadingDisabled write FPackLoadingDisabled; + property RemoteDebuggingPort : Integer read FRemoteDebuggingPort write FRemoteDebuggingPort; + property UncaughtExceptionStackSize : Integer read FUncaughtExceptionStackSize write FUncaughtExceptionStackSize; + property PersistSessionCookies : Boolean read FPersistSessionCookies write FPersistSessionCookies; + property PersistUserPreferences : Boolean read FPersistUserPreferences write FPersistUserPreferences; + property IgnoreCertificateErrors : Boolean read FIgnoreCertificateErrors write FIgnoreCertificateErrors; + property EnableNetSecurityExpiration : boolean read FEnableNetSecurityExpiration write FEnableNetSecurityExpiration; + property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor; + property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList; + property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo; + property WindowlessRenderingEnabled : Boolean read FWindowlessRenderingEnabled write FWindowlessRenderingEnabled; + property MultiThreadedMessageLoop : boolean read FMultiThreadedMessageLoop write FMultiThreadedMessageLoop; + property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump; + property DeleteCache : boolean read FDeleteCache write FDeleteCache; + property DeleteCookies : boolean read FDeleteCookies write FDeleteCookies; + property FlashEnabled : boolean read FFlashEnabled write FFlashEnabled; + property EnableSpellingService : boolean read FEnableSpellingService write FEnableSpellingService; + property EnableMediaStream : boolean read FEnableMediaStream write FEnableMediaStream; + property EnableSpeechInput : boolean read FEnableSpeechInput write FEnableSpeechInput; + property EnableGPU : boolean read FEnableGPU write FEnableGPU; + property CheckCEFFiles : boolean read FCheckCEFFiles write FCheckCEFFiles; + property ShowMessageDlg : boolean read FShowMessageDlg write FShowMessageDlg; + property SetCurrentDir : boolean read FSetCurrentDir write FSetCurrentDir; + property GlobalContextInitialized : boolean read FGlobalContextInitialized; + property ChromeMajorVer : uint16 read FChromeVersionInfo.MajorVer; + property ChromeMinorVer : uint16 read FChromeVersionInfo.MinorVer; + property ChromeRelease : uint16 read FChromeVersionInfo.Release; + property ChromeBuild : uint16 read FChromeVersionInfo.Build; + property ChromeVersion : string read GetChromeVersion; + property LibCefPath : string read GetLibCefPath; + property ChromeElfPath : string read GetChromeElfPath; + property OnRegCustomSchemes : TOnRegisterCustomSchemes read FOnRegisterCustomSchemes write FOnRegisterCustomSchemes; + property ResourceBundleHandler : ICefResourceBundleHandler read FResourceBundleHandler write FResourceBundleHandler; + property RenderProcessHandler : ICefRenderProcessHandler read FRenderProcessHandler write FRenderProcessHandler; + property SmoothScrolling : boolean read FSmoothScrolling write FSmoothScrolling; + property FastUnload : boolean read FFastUnload write FFastUnload; + property DisableSafeBrowsing : boolean read FDisableSafeBrowsing write FDisableSafeBrowsing; + property LibLoaded : boolean read FLibLoaded; + property EnableHighDPISupport : boolean read FEnableHighDPISupport write FEnableHighDPISupport; + property MuteAudio : boolean read FMuteAudio write FMuteAudio; + property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions; + property DeviceScaleFactor : single read FDeviceScaleFactor; + property CheckDevToolsResources : boolean read FCheckDevToolsResources write FCheckDevToolsResources; + property LocalesRequired : ustring read FLocalesRequired write FLocalesRequired; + property CustomFlashPath : ustring read FCustomFlashPath write FCustomFlashPath; + property OnContextInitialized : TOnContextInitializedEvent read FOnContextInitializedEvent write FOnContextInitializedEvent; + property OnBeforeChildProcessLaunch : TOnBeforeChildProcessLaunchEvent read FOnBeforeChildProcessLaunchEvent write FOnBeforeChildProcessLaunchEvent; + property OnRenderProcessThreadCreated : TOnRenderProcessThreadCreatedEvent read FOnRenderProcessThreadCreatedEvent write FOnRenderProcessThreadCreatedEvent; + property OnScheduleMessagePumpWork : TOnScheduleMessagePumpWorkEvent read FOnScheduleMessagePumpWorkEvent write FOnScheduleMessagePumpWorkEvent; end; TCefAppOwn = class(TCefBaseRefCountedOwn, ICefApp) @@ -303,6 +318,20 @@ type destructor Destroy; override; end; + TCefCustomBrowserProcessHandler = class(TCefBrowserProcessHandlerOwn) + protected + FCefApp : TCefApplication; + + procedure OnContextInitialized; override; + procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); override; + procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); override; + procedure OnScheduleMessagePumpWork(const delayMs: Int64); override; + + public + constructor Create(const aCefApp : TCefApplication); reintroduce; + destructor Destroy; override; + end; + var GlobalCEFApp : TCefApplication = nil; @@ -376,10 +405,17 @@ begin FLibLoaded := False; FShowMessageDlg := True; FSetCurrentDir := False; + FGlobalContextInitialized := False; FUpdateChromeVer := aUpdateChromeVer; FCheckDevToolsResources := True; FLocalesRequired := ''; + // ICefBrowserProcessHandler + FOnContextInitializedEvent := nil; + FOnBeforeChildProcessLaunchEvent := nil; + FOnRenderProcessThreadCreatedEvent := nil; + FOnScheduleMessagePumpWorkEvent := nil; + UpdateDeviceScaleFactor; FAppSettings.size := SizeOf(TCefSettings); @@ -413,6 +449,7 @@ begin FCustomCommandLines := TStringList.Create; FCustomCommandLineValues := TStringList.Create; + FBrowserProcessHandler := TCefCustomBrowserProcessHandler.Create(self); end; procedure TCefApplication.AddCustomCommandLine(const aCommandLine, aValue : string); @@ -705,8 +742,7 @@ begin InitializeSettings(FAppSettings); - Result := (cef_initialize(@HInstance, @FAppSettings, aApp.Wrap, FWindowsSandboxInfo) <> 0) and - InitializeCookies; + Result := (cef_initialize(@HInstance, @FAppSettings, aApp.Wrap, FWindowsSandboxInfo) <> 0); except on e : exception do if CustomExceptionHandler('TCefApplication.InitializeLibrary', e) then raise; @@ -815,6 +851,29 @@ begin if FShowMessageDlg then MessageDlg(aError, mtError, [mbOk], 0); end; +procedure TCefApplication.Internal_OnContextInitialized; +begin + InitializeCookies; + FGlobalContextInitialized := True; + + if assigned(FOnContextInitializedEvent) then FOnContextInitializedEvent; +end; + +procedure TCefApplication.Internal_OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); +begin + if assigned(FOnBeforeChildProcessLaunchEvent) then FOnBeforeChildProcessLaunchEvent(commandLine); +end; + +procedure TCefApplication.Internal_OnRenderProcessThreadCreated(const extraInfo: ICefListValue); +begin + if assigned(FOnRenderProcessThreadCreatedEvent) then FOnRenderProcessThreadCreatedEvent(extraInfo); +end; + +procedure TCefApplication.Internal_OnScheduleMessagePumpWork(const delayMs: Int64); +begin + if assigned(FOnScheduleMessagePumpWorkEvent) then FOnScheduleMessagePumpWorkEvent(delayMs); +end; + procedure TCefApplication.Internal_OnBeforeCommandLineProcessing(const processType : ustring; const commandLine : ICefCommandLine); var @@ -1650,4 +1709,40 @@ begin inherited Destroy; end; +// TCefCustomBrowserProcessHandler + +constructor TCefCustomBrowserProcessHandler.Create(const aCefApp : TCefApplication); +begin + inherited Create; + + FCefApp := aCefApp; +end; + +destructor TCefCustomBrowserProcessHandler.Destroy; +begin + FCefApp := nil; + + inherited Destroy; +end; + +procedure TCefCustomBrowserProcessHandler.OnContextInitialized; +begin + if (FCefApp <> nil) then FCefApp.Internal_OnContextInitialized; +end; + +procedure TCefCustomBrowserProcessHandler.OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); +begin + if (FCefApp <> nil) then FCefApp.Internal_OnBeforeChildProcessLaunch(commandLine); +end; + +procedure TCefCustomBrowserProcessHandler.OnRenderProcessThreadCreated(const extraInfo: ICefListValue); +begin + if (FCefApp <> nil) then FCefApp.Internal_OnRenderProcessThreadCreated(extraInfo); +end; + +procedure TCefCustomBrowserProcessHandler.OnScheduleMessagePumpWork(const delayMs: Int64); +begin + if (FCefApp <> nil) then FCefApp.Internal_OnScheduleMessagePumpWork(delayMs); +end; + end. diff --git a/source/uCEFBrowserProcessHandler.pas b/source/uCEFBrowserProcessHandler.pas index 625f4c68..40add39f 100644 --- a/source/uCEFBrowserProcessHandler.pas +++ b/source/uCEFBrowserProcessHandler.pas @@ -51,13 +51,14 @@ uses type TCefBrowserProcessHandlerOwn = class(TCefBaseRefCountedOwn, ICefBrowserProcessHandler) - protected - procedure OnContextInitialized; virtual; - procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); virtual; - procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); virtual; - procedure OnScheduleMessagePumpWork(delayMs: Int64); virtual; - public - constructor Create; virtual; + protected + procedure OnContextInitialized; virtual; + procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); virtual; + procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); virtual; + procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; + + public + constructor Create; virtual; end; implementation @@ -96,11 +97,11 @@ begin with PCefBrowserProcessHandler(FData)^ do begin - on_context_initialized := cef_browser_process_handler_on_context_initialized; - on_before_child_process_launch := cef_browser_process_handler_on_before_child_process_launch; + on_context_initialized := cef_browser_process_handler_on_context_initialized; + on_before_child_process_launch := cef_browser_process_handler_on_before_child_process_launch; on_render_process_thread_created := cef_browser_process_handler_on_render_process_thread_created; - get_print_handler := nil; // linux - on_schedule_message_pump_work := cef_browser_process_handler_on_schedule_message_pump_work; + get_print_handler := nil; // linux + on_schedule_message_pump_work := cef_browser_process_handler_on_schedule_message_pump_work; end; end; @@ -119,7 +120,7 @@ begin end; -procedure TCefBrowserProcessHandlerOwn.OnScheduleMessagePumpWork(delayMs: Int64); +procedure TCefBrowserProcessHandlerOwn.OnScheduleMessagePumpWork(const delayMs: Int64); begin end; diff --git a/source/uCEFChromium.pas b/source/uCEFChromium.pas index 24bfe75e..96fdfec9 100644 --- a/source/uCEFChromium.pas +++ b/source/uCEFChromium.pas @@ -924,11 +924,19 @@ begin Result := False; try + // GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser + // even if you use a custom request context. + // If you create a browser in the initialization of your app, make sure you call this + // function when GlobalCEFApp.GlobalContextInitialized is TRUE. + // Use the GlobalCEFApp.OnContextInitialized event to know when + // GlobalCEFApp.GlobalContextInitialized is set to TRUE. + if not(csDesigning in ComponentState) and not(FClosing) and (FBrowser = nil) and (FBrowserId = 0) and (GlobalCEFApp <> nil) and + GlobalCEFApp.GlobalContextInitialized and CreateClientHandler(aParentHandle = 0) then begin GetSettings(FBrowserSettings); diff --git a/source/uCEFInterfaces.pas b/source/uCEFInterfaces.pas index 0146ea86..7bf1623a 100644 --- a/source/uCEFInterfaces.pas +++ b/source/uCEFInterfaces.pas @@ -107,21 +107,25 @@ type TCefBinaryValueArray = array of ICefBinaryValue; TCefFrameIdentifierArray = array of int64; - TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean); - TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument); - TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const document: ICefDomDocument); - TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring); - TOnRegisterCustomSchemes = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const registrar: TCefSchemeRegistrarRef) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnRenderThreadCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const extraInfo: ICefListValue) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnWebKitInitializedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure() {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnBrowserCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnBrowserDestroyedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnBeforeNavigationEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; navigationType: TCefNavigationType; isRedirect: Boolean; var aStopNavigation : boolean) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnContextCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnContextReleasedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnUncaughtExceptionEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnFocusedNodeChangedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; - TOnProcessMessageReceivedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean); + TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument); + TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const document: ICefDomDocument); + TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring); + TOnRegisterCustomSchemes = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const registrar: TCefSchemeRegistrarRef) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnRenderThreadCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const extraInfo: ICefListValue) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnWebKitInitializedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure() {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnBrowserCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnBrowserDestroyedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnBeforeNavigationEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; navigationType: TCefNavigationType; isRedirect: Boolean; var aStopNavigation : boolean) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnContextCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnContextReleasedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnUncaughtExceptionEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnFocusedNodeChangedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnProcessMessageReceivedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnContextInitializedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure() {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnBeforeChildProcessLaunchEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const commandLine: ICefCommandLine) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnRenderProcessThreadCreatedEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const extraInfo: ICefListValue) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; + TOnScheduleMessagePumpWorkEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const delayMs: Int64) {$IFNDEF DELPHI12_UP}of object{$ENDIF}; TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure; TCefSetCookieCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(success: Boolean); @@ -857,7 +861,7 @@ type procedure OnContextInitialized; procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); - procedure OnScheduleMessagePumpWork(delayMs: Int64); + procedure OnScheduleMessagePumpWork(const delayMs: Int64); end; ICefRenderProcessHandler = interface(ICefBaseRefCounted)