Added TCEFComponentIdList.
Added IChromiumEvents..GetComponentID
Added ICEFUrlRequestClientEvents..GetComponentID
Added ICefViewDelegateEvents..GetComponentID
Added TCefManagedTask.
Added TCefChromiumTask.
Added TCefViewDelegateTask.
Added TCefURLRequestClientTask.
This commit is contained in:
salvadordf 2023-11-29 13:04:33 +01:00
parent 9e5b90303c
commit 44668e873d
14 changed files with 619 additions and 447 deletions

Binary file not shown.

View File

@ -234,7 +234,8 @@ contains
uCEFPreferenceRegistrar in '..\source\uCEFPreferenceRegistrar.pas',
uCEFPreferenceManager in '..\source\uCEFPreferenceManager.pas',
uCEFApplicationEvents in '..\source\uCEFApplicationEvents.pas',
uCEFBrowserBitmap in '..\source\uCEFBrowserBitmap.pas';
uCEFBrowserBitmap in '..\source\uCEFBrowserBitmap.pas',
uCEFComponentIdList in '..\source\uCEFComponentIdList.pas';
end.

View File

@ -234,7 +234,8 @@ contains
uCEFPreferenceRegistrar in '..\source\uCEFPreferenceRegistrar.pas',
uCEFPreferenceManager in '..\source\uCEFPreferenceManager.pas',
uCEFApplicationEvents in '..\source\uCEFApplicationEvents.pas',
uCEFBrowserBitmap in '..\source\uCEFBrowserBitmap.pas';
uCEFBrowserBitmap in '..\source\uCEFBrowserBitmap.pas',
uCEFComponentIdList in '..\source\uCEFComponentIdList.pas';
end.

View File

@ -46,6 +46,7 @@ VizGraphClasses=0
VizGraphUses=0
CheckSpelling=0
LatexGraphicsPackage=0
ImplementationComments=0
[Defines]
Count=2
@ -66,7 +67,7 @@ Count=1
Item_0=..\source
[Files]
Count=217
Count=218
Item_0=..\source\uCEFAccessibilityHandler.pas
Item_1=..\source\uCEFApp.pas
Item_2=..\source\uCEFApplication.pas
@ -103,187 +104,188 @@ Item_32=..\source\uCEFClient.pas
Item_33=..\source\uCEFCommandHandler.pas
Item_34=..\source\uCEFCommandLine.pas
Item_35=..\source\uCEFCompletionCallback.pas
Item_36=..\source\uCEFConstants.pas
Item_37=..\source\uCEFContextMenuHandler.pas
Item_38=..\source\uCEFContextMenuParams.pas
Item_39=..\source\uCEFCookieAccessFilter.pas
Item_40=..\source\uCEFCookieManager.pas
Item_41=..\source\uCEFCookieVisitor.pas
Item_42=..\source\uCEFCustomStreamReader.pas
Item_43=..\source\uCEFDeleteCookiesCallback.pas
Item_44=..\source\uCEFDevToolsMessageObserver.pas
Item_45=..\source\uCEFDialogHandler.pas
Item_46=..\source\uCEFDictionaryValue.pas
Item_47=..\source\uCEFDisplay.pas
Item_48=..\source\uCEFDisplayHandler.pas
Item_49=..\source\uCEFDomDocument.pas
Item_50=..\source\uCEFDomNode.pas
Item_51=..\source\uCEFDomVisitor.pas
Item_52=..\source\uCEFDownloadHandler.pas
Item_53=..\source\uCEFDownloadImageCallBack.pas
Item_54=..\source\uCEFDownLoadItem.pas
Item_55=..\source\uCEFDownloadItemCallback.pas
Item_56=..\source\uCEFDragAndDropMgr.pas
Item_57=..\source\uCEFDragData.pas
Item_58=..\source\uCEFDragHandler.pas
Item_59=..\source\uCEFEndTracingCallback.pas
Item_60=..\source\uCEFExtension.pas
Item_61=..\source\uCEFExtensionHandler.pas
Item_62=..\source\uCEFFileDialogCallback.pas
Item_63=..\source\uCEFFileDialogInfo.pas
Item_64=..\source\uCEFFillLayout.pas
Item_65=..\source\uCEFFindHandler.pas
Item_66=..\source\uCEFFMXBufferPanel.pas
Item_67=..\source\uCEFFMXChromium.pas
Item_68=..\source\uCEFFMXWindowParent.pas
Item_69=..\source\uCEFFMXWorkScheduler.pas
Item_70=..\source\uCEFFocusHandler.pas
Item_71=..\source\uCEFFrame.pas
Item_72=..\source\uCEFFrameHandler.pas
Item_73=..\source\uCEFGetExtensionResourceCallback.pas
Item_74=..\source\uCEFImage.pas
Item_75=..\source\uCEFInterfaces.pas
Item_76=..\source\uCEFJsDialogCallback.pas
Item_77=..\source\uCEFJsDialogHandler.pas
Item_78=..\source\uCEFJson.pas
Item_79=..\source\uCEFKeyboardHandler.pas
Item_80=..\source\uCEFLabelButton.pas
Item_81=..\source\uCEFLabelButtonComponent.pas
Item_82=..\source\uCEFLayout.pas
Item_83=..\source\uceflazaruscocoa.pas
Item_84=..\source\uCEFLibFunctions.pas
Item_85=..\source\uCEFLifeSpanHandler.pas
Item_86=..\source\uCEFLinkedWinControlBase.pas
Item_87=..\source\uCEFLinkedWindowParent.pas
Item_88=..\source\uCEFLinuxConstants.pas
Item_89=..\source\uCEFLinuxEventPipe.pas
Item_90=..\source\uCEFLinuxFunctions.pas
Item_91=..\source\uCEFLinuxTypes.pas
Item_92=..\source\uCEFListValue.pas
Item_93=..\source\uCEFLoadHandler.pas
Item_94=..\source\uCEFMacOSConstants.pas
Item_95=..\source\uCEFMacOSCustomCocoaTimer.pas
Item_96=..\source\uCEFMacOSFunctions.pas
Item_97=..\source\uCEFMacOSInterfaces.pas
Item_98=..\source\uCEFMediaAccessCallback.pas
Item_99=..\source\uCEFMediaAccessHandler.pas
Item_100=..\source\uCEFMediaObserver.pas
Item_101=..\source\uCEFMediaRoute.pas
Item_102=..\source\uCEFMediaRouteCreateCallback.pas
Item_103=..\source\uCEFMediaRouter.pas
Item_104=..\source\uCEFMediaSink.pas
Item_105=..\source\uCEFMediaSinkDeviceInfoCallback.pas
Item_106=..\source\uCEFMediaSource.pas
Item_107=..\source\uCEFMenuButton.pas
Item_108=..\source\uCEFMenuButtonComponent.pas
Item_109=..\source\uCEFMenuButtonDelegate.pas
Item_110=..\source\uCEFMenuButtonPressedLock.pas
Item_111=..\source\uCEFMenuModel.pas
Item_112=..\source\uCEFMenuModelDelegate.pas
Item_113=..\source\uCEFMiscFunctions.pas
Item_114=..\source\uCEFNavigationEntry.pas
Item_115=..\source\uCEFNavigationEntryVisitor.pas
Item_116=..\source\uCEFOAuth2Helper.pas
Item_117=..\source\uCEFOLEDragAndDrop.pas
Item_118=..\source\uCEFOsrBrowserWindow.pas
Item_119=..\source\uCEFOSRIMEHandler.pas
Item_120=..\source\uCEFOverlayController.pas
Item_121=..\source\uCEFPanel.pas
Item_122=..\source\uCEFPanelComponent.pas
Item_123=..\source\uCEFPanelDelegate.pas
Item_124=..\source\uCEFPDFPrintCallback.pas
Item_125=..\source\uCEFPDFPrintOptions.pas
Item_126=..\source\uCEFPermissionHandler.pas
Item_127=..\source\uCEFPermissionPromptCallback.pas
Item_128=..\source\uCEFPostData.pas
Item_129=..\source\uCEFPostDataElement.pas
Item_130=..\source\uCEFPreferenceManager.pas
Item_131=..\source\uCEFPreferenceRegistrar.pas
Item_132=..\source\uCEFPrintDialogCallback.pas
Item_133=..\source\uCEFPrintHandler.pas
Item_134=..\source\uCEFPrintJobCallback.pas
Item_135=..\source\uCEFPrintSettings.pas
Item_136=..\source\uCEFProcessMessage.pas
Item_137=..\source\uCEFRegistration.pas
Item_138=..\source\uCEFRenderHandler.pas
Item_139=..\source\uCEFRenderProcessHandler.pas
Item_140=..\source\uCEFRequest.pas
Item_141=..\source\uCEFRequestContext.pas
Item_142=..\source\uCEFRequestContextHandler.pas
Item_143=..\source\uCEFRequestHandler.pas
Item_144=..\source\uCEFResolveCallback.pas
Item_145=..\source\uCEFResourceBundle.pas
Item_146=..\source\uCEFResourceBundleHandler.pas
Item_147=..\source\uCEFResourceHandler.pas
Item_148=..\source\uCEFResourceReadCallback.pas
Item_149=..\source\uCEFResourceRequestHandler.pas
Item_150=..\source\uCEFResourceSkipCallback.pas
Item_151=..\source\uCEFResponse.pas
Item_152=..\source\uCEFResponseFilter.pas
Item_153=..\source\uCEFRunContextMenuCallback.pas
Item_154=..\source\uCEFRunFileDialogCallback.pas
Item_155=..\source\uCEFRunQuickMenuCallback.pas
Item_156=..\source\uCEFSchemeHandlerFactory.pas
Item_157=..\source\uCEFSchemeRegistrar.pas
Item_158=..\source\uCEFScrollView.pas
Item_159=..\source\uCEFScrollViewComponent.pas
Item_160=..\source\uCEFSelectClientCertificateCallback.pas
Item_161=..\source\uCEFSentinel.pas
Item_162=..\source\uCEFServer.pas
Item_163=..\source\uCEFServerComponent.pas
Item_164=..\source\uCEFServerEvents.pas
Item_165=..\source\uCEFServerHandler.pas
Item_166=..\source\uCEFSetCookieCallback.pas
Item_167=..\source\uCEFSharedMemoryRegion.pas
Item_168=..\source\uCEFSharedProcessMessageBuilder.pas
Item_169=..\source\uCEFSslInfo.pas
Item_170=..\source\uCEFSSLStatus.pas
Item_171=..\source\uCEFStreamReader.pas
Item_172=..\source\uCEFStreamWriter.pas
Item_173=..\source\uCEFStringList.pas
Item_174=..\source\uCEFStringMap.pas
Item_175=..\source\uCEFStringMultimap.pas
Item_176=..\source\uCEFStringVisitor.pas
Item_177=..\source\uCEFTask.pas
Item_178=..\source\uCEFTaskRunner.pas
Item_179=..\source\uCEFTextfield.pas
Item_180=..\source\uCEFTextfieldComponent.pas
Item_181=..\source\uCEFTextfieldDelegate.pas
Item_182=..\source\uCEFThread.pas
Item_183=..\source\uCEFTimerWorkScheduler.pas
Item_184=..\source\uCEFTypes.pas
Item_185=..\source\uCEFUrlRequest.pas
Item_186=..\source\uCEFUrlrequestClient.pas
Item_187=..\source\uCEFUrlRequestClientComponent.pas
Item_188=..\source\uCEFUrlRequestClientEvents.pas
Item_189=..\source\uCEFv8Accessor.pas
Item_190=..\source\uCEFv8ArrayBufferReleaseCallback.pas
Item_191=..\source\uCEFv8Context.pas
Item_192=..\source\uCEFv8Exception.pas
Item_193=..\source\uCEFv8Handler.pas
Item_194=..\source\uCEFv8Interceptor.pas
Item_195=..\source\uCEFv8StackFrame.pas
Item_196=..\source\uCEFv8StackTrace.pas
Item_197=..\source\uCEFv8Value.pas
Item_198=..\source\uCEFValue.pas
Item_199=..\source\uCEFView.pas
Item_200=..\source\uCEFViewComponent.pas
Item_201=..\source\uCEFViewDelegate.pas
Item_202=..\source\uCEFViewsFrameworkEvents.pas
Item_203=..\source\uCEFWaitableEvent.pas
Item_204=..\source\uCEFWinControl.pas
Item_205=..\source\uCEFWindow.pas
Item_206=..\source\uCEFWindowComponent.pas
Item_207=..\source\uCEFWindowDelegate.pas
Item_208=..\source\uCEFWindowParent.pas
Item_209=..\source\uCEFWorkScheduler.pas
Item_210=..\source\uCEFWorkSchedulerQueueThread.pas
Item_211=..\source\uCEFWorkSchedulerThread.pas
Item_212=..\source\uCEFWriteHandler.pas
Item_213=..\source\uCEFX509Certificate.pas
Item_214=..\source\uCEFX509CertPrincipal.pas
Item_215=..\source\uCEFXmlReader.pas
Item_216=..\source\uCEFZipReader.pas
Item_36=..\source\uCEFComponentIdList.pas
Item_37=..\source\uCEFConstants.pas
Item_38=..\source\uCEFContextMenuHandler.pas
Item_39=..\source\uCEFContextMenuParams.pas
Item_40=..\source\uCEFCookieAccessFilter.pas
Item_41=..\source\uCEFCookieManager.pas
Item_42=..\source\uCEFCookieVisitor.pas
Item_43=..\source\uCEFCustomStreamReader.pas
Item_44=..\source\uCEFDeleteCookiesCallback.pas
Item_45=..\source\uCEFDevToolsMessageObserver.pas
Item_46=..\source\uCEFDialogHandler.pas
Item_47=..\source\uCEFDictionaryValue.pas
Item_48=..\source\uCEFDisplay.pas
Item_49=..\source\uCEFDisplayHandler.pas
Item_50=..\source\uCEFDomDocument.pas
Item_51=..\source\uCEFDomNode.pas
Item_52=..\source\uCEFDomVisitor.pas
Item_53=..\source\uCEFDownloadHandler.pas
Item_54=..\source\uCEFDownloadImageCallBack.pas
Item_55=..\source\uCEFDownLoadItem.pas
Item_56=..\source\uCEFDownloadItemCallback.pas
Item_57=..\source\uCEFDragAndDropMgr.pas
Item_58=..\source\uCEFDragData.pas
Item_59=..\source\uCEFDragHandler.pas
Item_60=..\source\uCEFEndTracingCallback.pas
Item_61=..\source\uCEFExtension.pas
Item_62=..\source\uCEFExtensionHandler.pas
Item_63=..\source\uCEFFileDialogCallback.pas
Item_64=..\source\uCEFFileDialogInfo.pas
Item_65=..\source\uCEFFillLayout.pas
Item_66=..\source\uCEFFindHandler.pas
Item_67=..\source\uCEFFMXBufferPanel.pas
Item_68=..\source\uCEFFMXChromium.pas
Item_69=..\source\uCEFFMXWindowParent.pas
Item_70=..\source\uCEFFMXWorkScheduler.pas
Item_71=..\source\uCEFFocusHandler.pas
Item_72=..\source\uCEFFrame.pas
Item_73=..\source\uCEFFrameHandler.pas
Item_74=..\source\uCEFGetExtensionResourceCallback.pas
Item_75=..\source\uCEFImage.pas
Item_76=..\source\uCEFInterfaces.pas
Item_77=..\source\uCEFJsDialogCallback.pas
Item_78=..\source\uCEFJsDialogHandler.pas
Item_79=..\source\uCEFJson.pas
Item_80=..\source\uCEFKeyboardHandler.pas
Item_81=..\source\uCEFLabelButton.pas
Item_82=..\source\uCEFLabelButtonComponent.pas
Item_83=..\source\uCEFLayout.pas
Item_84=..\source\uceflazaruscocoa.pas
Item_85=..\source\uCEFLibFunctions.pas
Item_86=..\source\uCEFLifeSpanHandler.pas
Item_87=..\source\uCEFLinkedWinControlBase.pas
Item_88=..\source\uCEFLinkedWindowParent.pas
Item_89=..\source\uCEFLinuxConstants.pas
Item_90=..\source\uCEFLinuxEventPipe.pas
Item_91=..\source\uCEFLinuxFunctions.pas
Item_92=..\source\uCEFLinuxTypes.pas
Item_93=..\source\uCEFListValue.pas
Item_94=..\source\uCEFLoadHandler.pas
Item_95=..\source\uCEFMacOSConstants.pas
Item_96=..\source\uCEFMacOSCustomCocoaTimer.pas
Item_97=..\source\uCEFMacOSFunctions.pas
Item_98=..\source\uCEFMacOSInterfaces.pas
Item_99=..\source\uCEFMediaAccessCallback.pas
Item_100=..\source\uCEFMediaAccessHandler.pas
Item_101=..\source\uCEFMediaObserver.pas
Item_102=..\source\uCEFMediaRoute.pas
Item_103=..\source\uCEFMediaRouteCreateCallback.pas
Item_104=..\source\uCEFMediaRouter.pas
Item_105=..\source\uCEFMediaSink.pas
Item_106=..\source\uCEFMediaSinkDeviceInfoCallback.pas
Item_107=..\source\uCEFMediaSource.pas
Item_108=..\source\uCEFMenuButton.pas
Item_109=..\source\uCEFMenuButtonComponent.pas
Item_110=..\source\uCEFMenuButtonDelegate.pas
Item_111=..\source\uCEFMenuButtonPressedLock.pas
Item_112=..\source\uCEFMenuModel.pas
Item_113=..\source\uCEFMenuModelDelegate.pas
Item_114=..\source\uCEFMiscFunctions.pas
Item_115=..\source\uCEFNavigationEntry.pas
Item_116=..\source\uCEFNavigationEntryVisitor.pas
Item_117=..\source\uCEFOAuth2Helper.pas
Item_118=..\source\uCEFOLEDragAndDrop.pas
Item_119=..\source\uCEFOsrBrowserWindow.pas
Item_120=..\source\uCEFOSRIMEHandler.pas
Item_121=..\source\uCEFOverlayController.pas
Item_122=..\source\uCEFPanel.pas
Item_123=..\source\uCEFPanelComponent.pas
Item_124=..\source\uCEFPanelDelegate.pas
Item_125=..\source\uCEFPDFPrintCallback.pas
Item_126=..\source\uCEFPDFPrintOptions.pas
Item_127=..\source\uCEFPermissionHandler.pas
Item_128=..\source\uCEFPermissionPromptCallback.pas
Item_129=..\source\uCEFPostData.pas
Item_130=..\source\uCEFPostDataElement.pas
Item_131=..\source\uCEFPreferenceManager.pas
Item_132=..\source\uCEFPreferenceRegistrar.pas
Item_133=..\source\uCEFPrintDialogCallback.pas
Item_134=..\source\uCEFPrintHandler.pas
Item_135=..\source\uCEFPrintJobCallback.pas
Item_136=..\source\uCEFPrintSettings.pas
Item_137=..\source\uCEFProcessMessage.pas
Item_138=..\source\uCEFRegistration.pas
Item_139=..\source\uCEFRenderHandler.pas
Item_140=..\source\uCEFRenderProcessHandler.pas
Item_141=..\source\uCEFRequest.pas
Item_142=..\source\uCEFRequestContext.pas
Item_143=..\source\uCEFRequestContextHandler.pas
Item_144=..\source\uCEFRequestHandler.pas
Item_145=..\source\uCEFResolveCallback.pas
Item_146=..\source\uCEFResourceBundle.pas
Item_147=..\source\uCEFResourceBundleHandler.pas
Item_148=..\source\uCEFResourceHandler.pas
Item_149=..\source\uCEFResourceReadCallback.pas
Item_150=..\source\uCEFResourceRequestHandler.pas
Item_151=..\source\uCEFResourceSkipCallback.pas
Item_152=..\source\uCEFResponse.pas
Item_153=..\source\uCEFResponseFilter.pas
Item_154=..\source\uCEFRunContextMenuCallback.pas
Item_155=..\source\uCEFRunFileDialogCallback.pas
Item_156=..\source\uCEFRunQuickMenuCallback.pas
Item_157=..\source\uCEFSchemeHandlerFactory.pas
Item_158=..\source\uCEFSchemeRegistrar.pas
Item_159=..\source\uCEFScrollView.pas
Item_160=..\source\uCEFScrollViewComponent.pas
Item_161=..\source\uCEFSelectClientCertificateCallback.pas
Item_162=..\source\uCEFSentinel.pas
Item_163=..\source\uCEFServer.pas
Item_164=..\source\uCEFServerComponent.pas
Item_165=..\source\uCEFServerEvents.pas
Item_166=..\source\uCEFServerHandler.pas
Item_167=..\source\uCEFSetCookieCallback.pas
Item_168=..\source\uCEFSharedMemoryRegion.pas
Item_169=..\source\uCEFSharedProcessMessageBuilder.pas
Item_170=..\source\uCEFSslInfo.pas
Item_171=..\source\uCEFSSLStatus.pas
Item_172=..\source\uCEFStreamReader.pas
Item_173=..\source\uCEFStreamWriter.pas
Item_174=..\source\uCEFStringList.pas
Item_175=..\source\uCEFStringMap.pas
Item_176=..\source\uCEFStringMultimap.pas
Item_177=..\source\uCEFStringVisitor.pas
Item_178=..\source\uCEFTask.pas
Item_179=..\source\uCEFTaskRunner.pas
Item_180=..\source\uCEFTextfield.pas
Item_181=..\source\uCEFTextfieldComponent.pas
Item_182=..\source\uCEFTextfieldDelegate.pas
Item_183=..\source\uCEFThread.pas
Item_184=..\source\uCEFTimerWorkScheduler.pas
Item_185=..\source\uCEFTypes.pas
Item_186=..\source\uCEFUrlRequest.pas
Item_187=..\source\uCEFUrlrequestClient.pas
Item_188=..\source\uCEFUrlRequestClientComponent.pas
Item_189=..\source\uCEFUrlRequestClientEvents.pas
Item_190=..\source\uCEFv8Accessor.pas
Item_191=..\source\uCEFv8ArrayBufferReleaseCallback.pas
Item_192=..\source\uCEFv8Context.pas
Item_193=..\source\uCEFv8Exception.pas
Item_194=..\source\uCEFv8Handler.pas
Item_195=..\source\uCEFv8Interceptor.pas
Item_196=..\source\uCEFv8StackFrame.pas
Item_197=..\source\uCEFv8StackTrace.pas
Item_198=..\source\uCEFv8Value.pas
Item_199=..\source\uCEFValue.pas
Item_200=..\source\uCEFView.pas
Item_201=..\source\uCEFViewComponent.pas
Item_202=..\source\uCEFViewDelegate.pas
Item_203=..\source\uCEFViewsFrameworkEvents.pas
Item_204=..\source\uCEFWaitableEvent.pas
Item_205=..\source\uCEFWinControl.pas
Item_206=..\source\uCEFWindow.pas
Item_207=..\source\uCEFWindowComponent.pas
Item_208=..\source\uCEFWindowDelegate.pas
Item_209=..\source\uCEFWindowParent.pas
Item_210=..\source\uCEFWorkScheduler.pas
Item_211=..\source\uCEFWorkSchedulerQueueThread.pas
Item_212=..\source\uCEFWorkSchedulerThread.pas
Item_213=..\source\uCEFWriteHandler.pas
Item_214=..\source\uCEFX509Certificate.pas
Item_215=..\source\uCEFX509CertPrincipal.pas
Item_216=..\source\uCEFXmlReader.pas
Item_217=..\source\uCEFZipReader.pas
[AdditionalFiles]
Count=0

View File

@ -22,7 +22,7 @@
<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"/>
<Version Major="119" Minor="4" Release="3"/>
<Files Count="214">
<Files Count="215">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
<UnitName Value="uCEFAccessibilityHandler"/>
@ -897,6 +897,10 @@
<Filename Value="..\source\uCEFBrowserBitmap.pas"/>
<UnitName Value="uCEFBrowserBitmap"/>
</Item214>
<Item215>
<Filename Value="..\source\uCEFComponentIdList.pas"/>
<UnitName Value="uCEFComponentIdList"/>
</Item215>
</Files>
<CompatibilityMode Value="True"/>
<RequiredPkgs Count="5">

View File

@ -70,7 +70,8 @@ uses
uCEFRunQuickMenuCallback, uCEFMediaAccessHandler, uCEFMediaAccessCallback,
uCEFPermissionPromptCallback, uCEFSharedProcessMessageBuilder,
uCEFSharedMemoryRegion, uCEFPreferenceManager, uCEFPreferenceRegistrar,
uCEFApplicationEvents, uCEFBrowserBitmap, LazarusPackageIntf;
uCEFApplicationEvents, uCEFBrowserBitmap, uCEFComponentIdList,
LazarusPackageIntf;
implementation

View File

@ -18,16 +18,16 @@ interface
uses
{$IFDEF DELPHI16_UP}
{$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} System.Classes, System.UITypes,
{$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} System.Classes, System.UITypes, System.SyncObjs,
{$IFDEF FMX}uCEFLinuxTypes,{$ENDIF}
{$ELSE}
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, {$IFDEF FPC}dynlibs,{$ENDIF}
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, {$IFDEF FPC}dynlibs,{$ENDIF} SyncObjs,
{$ENDIF}
{$IFDEF LINUX}
{$IFDEF FPC}xlib,{$ENDIF} uCEFArgCopy,
{$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFApplicationEvents, uCEFBaseRefCounted,
uCEFSchemeRegistrar, uCEFPreferenceRegistrar;
uCEFSchemeRegistrar, uCEFPreferenceRegistrar, uCEFComponentIdList;
const
{$I uCEFVersion.inc}
@ -192,6 +192,7 @@ type
FCustomCommandLineValues : TStringList;
FAppSettings : TCefSettings;
FDisableGPUCache : boolean;
FComponentIDList : TCEFComponentIdList;
// ICefApp
FOnRegisterCustomSchemes : TOnRegisterCustomSchemesEvent;
@ -446,6 +447,19 @@ type
/// </summary>
procedure InitLibLocationFromArgs;
{$ENDIF}
/// <summary>
/// Returns true if a custom component ID is valid before executing a CEF task.
/// </summary>
function ValidComponentID(aComponentID : integer) : boolean;
/// <summary>
/// Returns the next component ID and adds this value to the valid ID list.
/// </summary>
function NextComponentID : integer;
/// <summary>
/// Removes a component ID from the valid ID list when a component is destroyed.
/// </summary>
procedure RemoveComponentID(aComponentID : integer);
/// <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
@ -1859,6 +1873,7 @@ begin
FillChar(FAppSettings, SizeOf(TCefSettings), 0);
FAppSettings.size := SizeOf(TCefSettings);
FDisableGPUCache := True;
FComponentIDList := nil;
// ICefApp
FOnRegisterCustomSchemes := nil;
@ -1914,6 +1929,7 @@ begin
{$ENDIF}
if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines);
if (FCustomCommandLineValues <> nil) then FreeAndNil(FCustomCommandLineValues);
if (FComponentIDList <> nil) then FreeAndNil(FComponentIDList);
finally
inherited Destroy;
end;
@ -2131,6 +2147,7 @@ begin
FCustomCommandLines := TStringList.Create;
FCustomCommandLineValues := TStringList.Create;
FComponentIDList := TCEFComponentIDList.Create;
end;
procedure TCefApplicationCore.AddCustomCommandLine(const aCommandLine, aValue : string);
@ -2571,6 +2588,21 @@ begin
FDeviceScaleFactor := GetDeviceScaleFactor;
end;
function TCefApplicationCore.ValidComponentID(aComponentID : integer) : boolean;
begin
Result := FComponentIDList.ValidID(aComponentID);
end;
function TCefApplicationCore.NextComponentID : integer;
begin
Result := FComponentIDList.NextID;
end;
procedure TCefApplicationCore.RemoveComponentID(aComponentID : integer);
begin
FComponentIDList.RemoveID(aComponentID);
end;
procedure TCefApplicationCore.ShutDown;
begin
try

View File

@ -114,6 +114,7 @@ type
FHighEfficiencyModeState : TCefHighEfficiencyModeState;
FCanFocus : boolean;
FEnableFocusDelayMs : cardinal;
FComponentID : integer;
{$IFDEF LINUX}
FXDisplay : PXDisplay;
@ -371,6 +372,7 @@ type
function GetBrowserById(aID : integer) : ICefBrowser;
function GetBrowserCount : integer;
function GetBrowserIdByIndex(aIndex : integer) : integer;
function GetComponentID : integer;
{$IFDEF LINUX}
function GetXDisplay : PXDisplay;
{$ENDIF}
@ -725,6 +727,7 @@ type
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
/// <summary>
/// Used to create the client handler which will also create most of the browser handlers needed for the browser.
/// </summary>
@ -4024,6 +4027,7 @@ begin
FHighEfficiencyModeState := kDefault;
FCanFocus := False;
FEnableFocusDelayMs := CEF_DEFAULT_ENABLEFOCUSDELAY;
FComponentID := 0;
{$IFDEF LINUX}
FXDisplay := nil;
{$ENDIF}
@ -4093,6 +4097,9 @@ destructor TChromiumCore.Destroy;
begin
try
try
if assigned(GlobalCEFApp) then
GlobalCEFApp.RemoveComponentID(FComponentID);
DestroyAllHandlersAndObservers;
{$IFDEF MSWINDOWS}
@ -4412,6 +4419,17 @@ begin
{$ENDIF}
CreateBrowserInfoList;
CreateRequestContextHandler;
if assigned(GlobalCEFApp) then
FComponentID := GlobalCEFApp.NextComponentID;
end;
procedure TChromiumCore.BeforeDestruction;
begin
if assigned(GlobalCEFApp) then
GlobalCEFApp.RemoveComponentID(FComponentID);
inherited BeforeDestruction;
end;
function TChromiumCore.CreateClientHandler(aIsOSR : boolean) : boolean;
@ -5490,6 +5508,11 @@ begin
end;
end;
function TChromiumCore.GetComponentID : integer;
begin
Result := FComponentID;
end;
{$IFDEF LINUX}
function TChromiumCore.GetXDisplay : PXDisplay;
{$IFDEF FPC}

View File

@ -0,0 +1,158 @@
unit uCEFComponentIdList;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
{$I cef.inc}
interface
uses
{$IFDEF DELPHI16_UP}
System.Classes, System.SyncObjs;
{$ELSE}
Classes, SyncObjs;
{$ENDIF}
type
/// <summary>
/// Class used to keep a list of valid custom component IDs for any component that handles a CEF Task event.
/// </summary>
TCEFComponentIdList = class
protected
{ Using a TList for backwards compatibility reasons. }
FList : TList;
FIdGen : integer;
FSyncObj : TCriticalSection;
function GetInitialized : boolean;
function Lock: boolean;
procedure Unlock;
public
constructor Create;
destructor Destroy; override;
procedure AfterConstruction; override;
/// <summary>
/// Returns true if a custom component ID is valid before executing a CEF task.
/// </summary>
function ValidID(aID : integer) : boolean;
/// <summary>
/// Returns the next component ID and adds this value to the valid ID list.
/// </summary>
function NextID : integer;
/// <summary>
/// Removes a component ID from the valid ID list when a component is destroyed.
/// </summary>
procedure RemoveID(aID : integer);
/// <summary>
/// Returns true when this class is fully initialized and ready to be used.
/// </summary>
property Initialized : boolean read GetInitialized;
end;
implementation
uses
{$IFDEF DELPHI16_UP}
System.SysUtils, System.Types;
{$ELSE}
SysUtils, Types;
{$ENDIF}
constructor TCEFComponentIdList.Create;
begin
inherited Create;
FList := nil;
FIdGen := 0;
FSyncObj := nil;
end;
destructor TCEFComponentIdList.Destroy;
begin
if assigned(FList) then FreeAndNil(FList);
if assigned(FSyncObj) then FreeAndNil(FSyncObj);
inherited Destroy;
end;
procedure TCEFComponentIdList.AfterConstruction;
begin
inherited AfterConstruction;
FList := TList.Create;
FSyncObj := TCriticalSection.Create;
end;
function TCEFComponentIdList.GetInitialized : boolean;
begin
Result := assigned(FSyncObj) and assigned(FList);
end;
function TCEFComponentIdList.Lock: boolean;
begin
Result := False;
if Initialized then
begin
FSyncObj.Acquire;
Result := True;
end;
end;
procedure TCEFComponentIdList.Unlock;
begin
FSyncObj.Release;
end;
function TCEFComponentIdList.ValidID(aID : integer) : boolean;
begin
if (aID <= 0) then
Result := True
else
begin
Result := False;
if Lock then
try
Result := FList.IndexOf(Pointer(aID)) >= 0;
finally
Unlock;
end;
end;
end;
function TCEFComponentIdList.NextID : integer;
begin
Result := 0;
if Lock then
try
repeat
if (FIdGen < pred(high(integer))) then
inc(FIdGen)
else
FIdGen := 1;
until (FList.IndexOf(Pointer(FIdGen)) < 0);
FList.Add(Pointer(FIdGen));
Result := FIdGen;
finally
Unlock;
end;
end;
procedure TCEFComponentIdList.RemoveID(aID : integer);
begin
if (aID > 0) and Lock then
try
FList.Remove(Pointer(aID));
finally
Unlock;
end;
end;
end.

View File

@ -536,6 +536,9 @@ type
function MustCreatePrintHandler : boolean;
function MustCreateFrameHandler : boolean;
function MustCreatePermissionHandler : boolean;
function GetComponentID : integer;
property ComponentID : integer read GetComponentID;
end;
/// <summary>
@ -568,6 +571,9 @@ type
// Custom
procedure doOnCreateURLRequest;
function GetComponentID : integer;
property ComponentID : integer read GetComponentID;
end;
/// <summary>
@ -589,6 +595,9 @@ type
// Custom
procedure doCreateCustomView;
function GetComponentID : integer;
property ComponentID : integer read GetComponentID;
end;
/// <summary>

View File

@ -43,177 +43,158 @@ type
constructor Create(const method: TCefFastTaskProc); reintroduce;
end;
TCefUpdatePrefsTask = class(TCefTaskOwn)
/// <summary>
/// Custom class used to execute CEF tasks with CEF4Delphi components.
/// </summary>
TCefManagedTask = class(TCefTaskOwn)
protected
FComponentID : integer;
FEvents : Pointer;
procedure Execute; override;
function CanExecute: boolean; virtual;
public
constructor Create(const aEvents : IChromiumEvents); reintroduce;
constructor Create; override;
destructor Destroy; override;
end;
TCefSavePrefsTask = class(TCefTaskOwn)
protected
FEvents : Pointer;
procedure Execute; override;
/// <summary>
/// Custom class used to execute CEF tasks with a TChromiumCore component.
/// </summary>
TCefChromiumTask = class(TCefManagedTask)
public
constructor Create(const aEvents : IChromiumEvents); reintroduce;
destructor Destroy; override;
end;
TCefURLRequestTask = class(TCefTaskOwn)
protected
FEvents : Pointer;
procedure Execute; override;
/// <summary>
/// Custom class used to execute CEF tasks with a TCEFViewComponent component.
/// </summary>
TCefViewDelegateTask = class(TCefManagedTask)
public
constructor Create(const aEvents : ICefViewDelegateEvents); reintroduce;
end;
/// <summary>
/// Custom class used to execute CEF tasks with a TCEFUrlRequestClientComponent component.
/// </summary>
TCefURLRequestClientTask = class(TCefManagedTask)
public
constructor Create(const aEvents : ICEFUrlRequestClientEvents); reintroduce;
destructor Destroy; override;
end;
TCefGenericTask = class(TCefTaskOwn)
TCefUpdatePrefsTask = class(TCefChromiumTask)
protected
procedure Execute; override;
end;
TCefSavePrefsTask = class(TCefChromiumTask)
protected
procedure Execute; override;
end;
TCefURLRequestTask = class(TCefURLRequestClientTask)
protected
procedure Execute; override;
end;
TCefGenericTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FTaskID : cardinal;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; aTaskID : cardinal); reintroduce;
destructor Destroy; override;
end;
TCefUpdateZoomStepTask = class(TCefTaskOwn)
TCefUpdateZoomStepTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FInc : boolean;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; aInc : boolean); reintroduce;
destructor Destroy; override;
end;
TCefUpdateZoomPctTask = class(TCefTaskOwn)
TCefUpdateZoomPctTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FInc : boolean;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; aInc : boolean); reintroduce;
destructor Destroy; override;
end;
TCefReadZoomTask = class(TCefTaskOwn)
TCefReadZoomTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents); reintroduce;
destructor Destroy; override;
end;
TCefSetZoomLevelTask = class(TCefTaskOwn)
TCefSetZoomLevelTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FValue : double;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; const aValue : double); reintroduce;
destructor Destroy; override;
end;
TCefSetZoomPctTask = class(TCefTaskOwn)
TCefSetZoomPctTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FValue : double;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; const aValue : double); reintroduce;
destructor Destroy; override;
end;
TCefSetZoomStepTask = class(TCefTaskOwn)
TCefSetZoomStepTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FValue : byte;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; aValue : byte); reintroduce;
destructor Destroy; override;
end;
TCefCreateCustomViewTask = class(TCefTaskOwn)
TCefCreateCustomViewTask = class(TCefViewDelegateTask)
protected
FEvents : Pointer;
procedure Execute; override;
public
constructor Create(const aEvents : ICefViewDelegateEvents); reintroduce;
destructor Destroy; override;
end;
TCefBrowserNavigationTask = class(TCefTaskOwn)
TCefBrowserNavigationTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FTask : TCefBrowserNavigation;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; aTask : TCefBrowserNavigation); reintroduce;
destructor Destroy; override;
end;
TCefSetAudioMutedTask = class(TCefTaskOwn)
TCefSetAudioMutedTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
FValue : boolean;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents; aValue : boolean); reintroduce;
destructor Destroy; override;
end;
TCefToggleAudioMutedTask = class(TCefTaskOwn)
TCefToggleAudioMutedTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents); reintroduce;
destructor Destroy; override;
end;
TCefEnableFocusTask = class(TCefTaskOwn)
TCefEnableFocusTask = class(TCefChromiumTask)
protected
FEvents : Pointer;
procedure Execute; override;
public
constructor Create(const aEvents : IChromiumEvents); reintroduce;
destructor Destroy; override;
end;
implementation
@ -224,7 +205,10 @@ uses
{$ELSE}
SysUtils,
{$ENDIF}
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager, uCEFUrlRequest;
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager, uCEFUrlRequest, uCEFApplicationCore;
// TCefTaskOwn
procedure cef_task_execute(self: PCefTask); stdcall;
var
@ -249,8 +233,8 @@ begin
end;
// TCefTaskRef
// TCefTaskRef
procedure TCefTaskRef.Execute;
begin
@ -266,8 +250,8 @@ begin
end;
// TCefFastTask
// TCefFastTask
constructor TCefFastTask.Create(const method: TCefFastTaskProc);
begin
@ -292,28 +276,77 @@ begin
end;
// TCefUpdatePrefsTask
// TCefManagedTask
constructor TCefUpdatePrefsTask.Create(const aEvents : IChromiumEvents);
constructor TCefManagedTask.Create;
begin
inherited Create;
FEvents := Pointer(aEvents);
FComponentID := 0;
FEvents := nil;
end;
destructor TCefUpdatePrefsTask.Destroy;
destructor TCefManagedTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
function TCefManagedTask.CanExecute: boolean;
begin
Result := (FEvents <> nil) and
assigned(GlobalCEFApp) and
GlobalCEFApp.ValidComponentID(FComponentID);
end;
// TCefChromiumTask
constructor TCefChromiumTask.Create(const aEvents : IChromiumEvents);
begin
inherited Create;
FComponentID := aEvents.ComponentID;
FEvents := Pointer(aEvents);
end;
// TCefViewDelegateTask
constructor TCefViewDelegateTask.Create(const aEvents : ICefViewDelegateEvents);
begin
inherited Create;
FComponentID := aEvents.ComponentID;
FEvents := Pointer(aEvents);
end;
// TCefURLRequestClientTask
constructor TCefURLRequestClientTask.Create(const aEvents : ICEFUrlRequestClientEvents);
begin
inherited Create;
FComponentID := aEvents.ComponentID;
FEvents := Pointer(aEvents);
end;
// TCefUpdatePrefsTask
procedure TCefUpdatePrefsTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doUpdateOwnPreferences;
if CanExecute then
IChromiumEvents(FEvents).doUpdateOwnPreferences;
except
on e : exception do
if CustomExceptionHandler('TCefUpdatePrefsTask.Execute', e) then raise;
@ -326,26 +359,12 @@ end;
// TCefSavePrefsTask
constructor TCefSavePrefsTask.Create(const aEvents : IChromiumEvents);
begin
inherited Create;
FEvents := Pointer(aEvents);
end;
destructor TCefSavePrefsTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
procedure TCefSavePrefsTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doSavePreferences;
if CanExecute then
IChromiumEvents(FEvents).doSavePreferences;
except
on e : exception do
if CustomExceptionHandler('TCefSavePrefsTask.Execute', e) then raise;
@ -356,13 +375,15 @@ begin
end;
// TCefURLRequestTask
procedure TCefURLRequestTask.Execute;
begin
try
try
if (FEvents <> nil) then ICEFUrlRequestClientEvents(FEvents).doOnCreateURLRequest;
if CanExecute then
ICEFUrlRequestClientEvents(FEvents).doOnCreateURLRequest;
except
on e : exception do
if CustomExceptionHandler('TCefURLRequestTask.Execute', e) then raise;
@ -372,19 +393,6 @@ begin
end;
end;
constructor TCefURLRequestTask.Create(const aEvents : ICEFUrlRequestClientEvents);
begin
inherited Create;
FEvents := Pointer(aEvents);
end;
destructor TCefURLRequestTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefGenericTask
@ -393,7 +401,8 @@ procedure TCefGenericTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnExecuteTaskOnCefThread(FTaskID);
if CanExecute then
IChromiumEvents(FEvents).doOnExecuteTaskOnCefThread(FTaskID);
except
on e : exception do
if CustomExceptionHandler('TCefGenericTask.Execute', e) then raise;
@ -405,19 +414,11 @@ end;
constructor TCefGenericTask.Create(const aEvents : IChromiumEvents; aTaskID : cardinal);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FTaskID := aTaskID;
end;
destructor TCefGenericTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefUpdateZoomStepTask
@ -426,7 +427,8 @@ procedure TCefUpdateZoomStepTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doUpdateZoomStep(FInc);
if CanExecute then
IChromiumEvents(FEvents).doUpdateZoomStep(FInc);
except
on e : exception do
if CustomExceptionHandler('TCefUpdateZoomStepTask.Execute', e) then raise;
@ -438,19 +440,11 @@ end;
constructor TCefUpdateZoomStepTask.Create(const aEvents : IChromiumEvents; aInc : boolean);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FInc := aInc;
end;
destructor TCefUpdateZoomStepTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefUpdateZoomPctTask
@ -459,7 +453,8 @@ procedure TCefUpdateZoomPctTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doUpdateZoomPct(FInc);
if CanExecute then
IChromiumEvents(FEvents).doUpdateZoomPct(FInc);
except
on e : exception do
if CustomExceptionHandler('TCefUpdateZoomPctTask.Execute', e) then raise;
@ -471,19 +466,11 @@ end;
constructor TCefUpdateZoomPctTask.Create(const aEvents : IChromiumEvents; aInc : boolean);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FInc := aInc;
end;
destructor TCefUpdateZoomPctTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefReadZoomTask
@ -492,7 +479,8 @@ procedure TCefReadZoomTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doReadZoom;
if CanExecute then
IChromiumEvents(FEvents).doReadZoom;
except
on e : exception do
if CustomExceptionHandler('TCefReadZoomTask.Execute', e) then raise;
@ -502,20 +490,6 @@ begin
end;
end;
constructor TCefReadZoomTask.Create(const aEvents : IChromiumEvents);
begin
inherited Create;
FEvents := Pointer(aEvents);
end;
destructor TCefReadZoomTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefSetZoomLevelTask
@ -524,7 +498,8 @@ procedure TCefSetZoomLevelTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doSetZoomLevel(FValue);
if CanExecute then
IChromiumEvents(FEvents).doSetZoomLevel(FValue);
except
on e : exception do
if CustomExceptionHandler('TCefSetZoomLevelTask.Execute', e) then raise;
@ -536,19 +511,11 @@ end;
constructor TCefSetZoomLevelTask.Create(const aEvents : IChromiumEvents; const aValue : double);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FValue := aValue;
end;
destructor TCefSetZoomLevelTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefSetZoomPctTask
@ -557,7 +524,8 @@ procedure TCefSetZoomPctTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doSetZoomPct(FValue);
if CanExecute then
IChromiumEvents(FEvents).doSetZoomPct(FValue);
except
on e : exception do
if CustomExceptionHandler('TCefSetZoomPctTask.Execute', e) then raise;
@ -569,19 +537,11 @@ end;
constructor TCefSetZoomPctTask.Create(const aEvents : IChromiumEvents; const aValue : double);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FValue := aValue;
end;
destructor TCefSetZoomPctTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefSetZoomStepTask
@ -590,7 +550,8 @@ procedure TCefSetZoomStepTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doSetZoomStep(FValue);
if CanExecute then
IChromiumEvents(FEvents).doSetZoomStep(FValue);
except
on e : exception do
if CustomExceptionHandler('TCefSetZoomStepTask.Execute', e) then raise;
@ -602,18 +563,11 @@ end;
constructor TCefSetZoomStepTask.Create(const aEvents : IChromiumEvents; aValue : byte);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FValue := aValue;
end;
destructor TCefSetZoomStepTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefCreateCustomViewTask
@ -622,7 +576,8 @@ procedure TCefCreateCustomViewTask.Execute;
begin
try
try
if (FEvents <> nil) then ICefViewDelegateEvents(FEvents).doCreateCustomView;
if CanExecute then
ICefViewDelegateEvents(FEvents).doCreateCustomView;
except
on e : exception do
if CustomExceptionHandler('ICefViewDelegateEvents.Execute', e) then raise;
@ -632,19 +587,6 @@ begin
end;
end;
constructor TCefCreateCustomViewTask.Create(const aEvents : ICefViewDelegateEvents);
begin
inherited Create;
FEvents := Pointer(aEvents);
end;
destructor TCefCreateCustomViewTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefBrowserNavigationTask
@ -653,7 +595,8 @@ procedure TCefBrowserNavigationTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doBrowserNavigation(FTask);
if CanExecute then
IChromiumEvents(FEvents).doBrowserNavigation(FTask);
except
on e : exception do
if CustomExceptionHandler('TCefBrowserNavigationTask.Execute', e) then raise;
@ -665,18 +608,11 @@ end;
constructor TCefBrowserNavigationTask.Create(const aEvents : IChromiumEvents; aTask : TCefBrowserNavigation);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FTask := aTask;
end;
destructor TCefBrowserNavigationTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefSetAudioMutedTask
@ -685,7 +621,8 @@ procedure TCefSetAudioMutedTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doSetAudioMuted(FValue);
if CanExecute then
IChromiumEvents(FEvents).doSetAudioMuted(FValue);
except
on e : exception do
if CustomExceptionHandler('TCefSetAudioMutedTask.Execute', e) then raise;
@ -697,18 +634,11 @@ end;
constructor TCefSetAudioMutedTask.Create(const aEvents : IChromiumEvents; aValue : boolean);
begin
inherited Create;
inherited Create(aEvents);
FEvents := Pointer(aEvents);
FValue := aValue;
end;
destructor TCefSetAudioMutedTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefToggleAudioMutedTask
@ -717,7 +647,8 @@ procedure TCefToggleAudioMutedTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doToggleAudioMuted;
if CanExecute then
IChromiumEvents(FEvents).doToggleAudioMuted;
except
on e : exception do
if CustomExceptionHandler('TCefToggleAudioMutedTask.Execute', e) then raise;
@ -727,19 +658,6 @@ begin
end;
end;
constructor TCefToggleAudioMutedTask.Create(const aEvents : IChromiumEvents);
begin
inherited Create;
FEvents := Pointer(aEvents);
end;
destructor TCefToggleAudioMutedTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
// TCefEnableFocusTask
@ -748,7 +666,8 @@ procedure TCefEnableFocusTask.Execute;
begin
try
try
if (FEvents <> nil) then IChromiumEvents(FEvents).doEnableFocus;
if CanExecute then
IChromiumEvents(FEvents).doEnableFocus;
except
on e : exception do
if CustomExceptionHandler('TCefEnableFocusTask.Execute', e) then raise;
@ -758,18 +677,4 @@ begin
end;
end;
constructor TCefEnableFocusTask.Create(const aEvents : IChromiumEvents);
begin
inherited Create;
FEvents := Pointer(aEvents);
end;
destructor TCefEnableFocusTask.Destroy;
begin
FEvents := nil;
inherited Destroy;
end;
end.

View File

@ -34,6 +34,7 @@ type
protected
FClient : ICefUrlrequestClient;
FThreadID : TCefThreadId;
FComponentID : integer;
FOnRequestComplete : TOnRequestComplete;
FOnUploadProgress : TOnUploadProgress;
@ -42,6 +43,8 @@ type
FOnGetAuthCredentials : TOnGetAuthCredentials;
FOnCreateURLRequest : TNotifyEvent;
function GetComponentID : integer;
// ICefUrlrequestClient
procedure doOnRequestComplete(const request: ICefUrlRequest);
procedure doOnUploadProgress(const request: ICefUrlRequest; current, total: Int64);
@ -175,7 +178,7 @@ uses
{$ELSE}
SysUtils,
{$ENDIF}
uCEFRequest, uCEFTask, uCEFMiscFunctions;
uCEFRequest, uCEFTask, uCEFMiscFunctions, uCEFApplicationCore;
constructor TCEFUrlRequestClientComponent.Create(AOwner: TComponent);
@ -190,6 +193,7 @@ begin
FOnDownloadData := nil;
FOnGetAuthCredentials := nil;
FOnCreateURLRequest := nil;
FComponentID := 0;
end;
procedure TCEFUrlRequestClientComponent.AfterConstruction;
@ -198,15 +202,26 @@ begin
if not(csDesigning in ComponentState) then
FClient := TCustomCefUrlrequestClient.Create(self);
if assigned(GlobalCEFApp) then
FComponentID := GlobalCEFApp.NextComponentID;
end;
procedure TCEFUrlRequestClientComponent.BeforeDestruction;
begin
if assigned(GlobalCEFApp) then
GlobalCEFApp.RemoveComponentID(FComponentID);
DestroyRequestClient;
inherited BeforeDestruction;
end;
function TCEFUrlRequestClientComponent.GetComponentID : integer;
begin
Result := FComponentID;
end;
procedure TCEFUrlRequestClientComponent.DestroyRequestClient;
begin
try

View File

@ -37,6 +37,8 @@ type
FOnFocus : TOnFocusEvent;
FOnBlur : TOnBlurEvent;
FComponentID : integer;
procedure CreateView; virtual;
procedure DestroyView; virtual;
procedure Initialize; virtual;
@ -72,6 +74,7 @@ type
function GetViewForID(id_: Integer): ICefView;
function GetHeightForWidth(width: Integer): Integer;
function GetInsets: TCefInsets;
function GetComponentID : integer;
procedure SetID(id_: Integer);
procedure SetGroupID(group_id: Integer);
@ -99,6 +102,7 @@ type
public
constructor Create(AOwner: TComponent); override;
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
/// <summary>
/// Returns a string representation of this View which includes the type and
@ -410,17 +414,29 @@ type
implementation
uses
uCEFViewDelegate, uCEFMiscFunctions, uCEFTask;
uCEFViewDelegate, uCEFMiscFunctions, uCEFTask, uCEFApplicationCore;
constructor TCEFViewComponent.Create(AOwner: TComponent);
begin
inherited Create(aOwner);
Initialize;
FComponentID := 0;
end;
procedure TCEFViewComponent.AfterConstruction;
begin
inherited AfterConstruction;
if assigned(GlobalCEFApp) then
FComponentID := GlobalCEFApp.NextComponentID;
end;
procedure TCEFViewComponent.BeforeDestruction;
begin
if assigned(GlobalCEFApp) then
GlobalCEFApp.RemoveComponentID(FComponentID);
DestroyView;
inherited BeforeDestruction;
@ -465,6 +481,11 @@ begin
Result := False;
end;
function TCEFViewComponent.GetComponentID : integer;
begin
Result := FComponentID;
end;
function TCEFViewComponent.GetAsView : ICefView;
begin
Result := nil;

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 542,
"InternalVersion" : 543,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "119.4.3"
}