mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-02-02 10:25:26 +02:00
Update to CEF 3.3282.1731.gfc9a4fa
- Chromium 64.0.3282.119 which should include partial MP3 support. - Fixed stability issues when you closed the browser due to circular interface references. - Fixed TCefRTTIExtension thanks to Pier. - Added the JSRTTIExtension demo to test TCefRTTIExtension. - Added the TCustomResponseFilter class to filter the resource contents. - Added the ResponseFilterBrowser demo to test the new TCustomResponseFilter class.
This commit is contained in:
parent
fed1c04a3f
commit
e29989623e
@ -141,7 +141,9 @@ begin
|
|||||||
|
|
||||||
if (count = pred(total)) then
|
if (count = pred(total)) then
|
||||||
begin
|
begin
|
||||||
PostMessage(CookieVisitorFrm.Handle, MINIBROWSER_SHOWCOOKIES, 0, 0);
|
if (CookieVisitorFrm <> nil) and CookieVisitorFrm.HandleAllocated then
|
||||||
|
PostMessage(CookieVisitorFrm.Handle, MINIBROWSER_SHOWCOOKIES, 0, 0);
|
||||||
|
|
||||||
Result := False;
|
Result := False;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -121,7 +121,7 @@ uses
|
|||||||
|
|
||||||
// To send a message from the browser process you must use the TChromium.SendProcessMessage
|
// To send a message from the browser process you must use the TChromium.SendProcessMessage
|
||||||
// procedure with a PID_RENDERER parameter. The render process receives those messages in
|
// procedure with a PID_RENDERER parameter. The render process receives those messages in
|
||||||
// the GlobalCEFApp.OnProcessMessageReceived event
|
// the GlobalCEFApp.OnProcessMessageReceived event.
|
||||||
|
|
||||||
// To send messages from the render process you must use the browser.SendProcessMessage
|
// To send messages from the render process you must use the browser.SendProcessMessage
|
||||||
// procedure with a PID_BROWSER parameter. The browser process receives those messages in
|
// procedure with a PID_BROWSER parameter. The browser process receives those messages in
|
||||||
|
@ -105,6 +105,7 @@ object FMXExternalPumpBrowserFrm: TFMXExternalPumpBrowserFrm
|
|||||||
Top = 201
|
Top = 201
|
||||||
end
|
end
|
||||||
object chrmosr: TFMXChromium
|
object chrmosr: TFMXChromium
|
||||||
|
OnTooltip = chrmosrTooltip
|
||||||
OnAfterCreated = chrmosrAfterCreated
|
OnAfterCreated = chrmosrAfterCreated
|
||||||
OnBeforeClose = chrmosrBeforeClose
|
OnBeforeClose = chrmosrBeforeClose
|
||||||
OnClose = chrmosrClose
|
OnClose = chrmosrClose
|
||||||
|
@ -102,6 +102,8 @@ type
|
|||||||
procedure AddressEdtEnter(Sender: TObject);
|
procedure AddressEdtEnter(Sender: TObject);
|
||||||
procedure SnapshotBtnClick(Sender: TObject);
|
procedure SnapshotBtnClick(Sender: TObject);
|
||||||
procedure SnapshotBtnEnter(Sender: TObject);
|
procedure SnapshotBtnEnter(Sender: TObject);
|
||||||
|
procedure chrmosrTooltip(Sender: TObject; const browser: ICefBrowser;
|
||||||
|
var text: ustring; out Result: Boolean);
|
||||||
|
|
||||||
protected
|
protected
|
||||||
FPopUpBitmap : TBitmap;
|
FPopUpBitmap : TBitmap;
|
||||||
@ -693,6 +695,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFMXExternalPumpBrowserFrm.chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean);
|
||||||
|
begin
|
||||||
|
Panel1.Hint := text;
|
||||||
|
Panel1.ShowHint := (length(text) > 0);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFMXExternalPumpBrowserFrm.DoResize;
|
procedure TFMXExternalPumpBrowserFrm.DoResize;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
14
demos/JavaScript/JSRTTIExtension/00-DeleteDCUs.bat
Normal file
14
demos/JavaScript/JSRTTIExtension/00-DeleteDCUs.bat
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
del /s /q *.dcu
|
||||||
|
del /s /q *.exe
|
||||||
|
del /s /q *.res
|
||||||
|
del /s /q *.log
|
||||||
|
del /s /q *.dsk
|
||||||
|
del /s /q *.identcache
|
||||||
|
del /s /q *.stat
|
||||||
|
del /s /q *.local
|
||||||
|
del /s /q *.~*
|
||||||
|
rmdir Win32\Debug
|
||||||
|
rmdir Win32\Release
|
||||||
|
rmdir Win32
|
||||||
|
rmdir __history
|
||||||
|
rmdir __recovery
|
77
demos/JavaScript/JSRTTIExtension/JSRTTIExtension.dpr
Normal file
77
demos/JavaScript/JSRTTIExtension/JSRTTIExtension.dpr
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2017 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
program JSRTTIExtension;
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
Vcl.Forms,
|
||||||
|
WinApi.Windows,
|
||||||
|
{$ELSE}
|
||||||
|
Forms,
|
||||||
|
Windows,
|
||||||
|
{$ENDIF }
|
||||||
|
uCEFApplication,
|
||||||
|
uJSRTTIExtension in 'uJSRTTIExtension.pas' {JSRTTIExtensionFrm},
|
||||||
|
uTestExtension in 'uTestExtension.pas',
|
||||||
|
uSimpleTextViewer in 'uSimpleTextViewer.pas' {SimpleTextViewerFrm};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
// CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM.
|
||||||
|
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
|
||||||
|
|
||||||
|
begin
|
||||||
|
GlobalCEFApp := TCefApplication.Create;
|
||||||
|
GlobalCEFApp.OnWebKitInitialized := GlobalCEFApp_OnWebKitInitialized;
|
||||||
|
|
||||||
|
|
||||||
|
if GlobalCEFApp.StartMainProcess then
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
{$IFDEF DELPHI11_UP}
|
||||||
|
Application.MainFormOnTaskbar := True;
|
||||||
|
{$ENDIF}
|
||||||
|
Application.CreateForm(TJSRTTIExtensionFrm, JSRTTIExtensionFrm);
|
||||||
|
Application.CreateForm(TSimpleTextViewerFrm, SimpleTextViewerFrm);
|
||||||
|
Application.Run;
|
||||||
|
end;
|
||||||
|
|
||||||
|
GlobalCEFApp.Free;
|
||||||
|
end.
|
575
demos/JavaScript/JSRTTIExtension/JSRTTIExtension.dproj
Normal file
575
demos/JavaScript/JSRTTIExtension/JSRTTIExtension.dproj
Normal file
@ -0,0 +1,575 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{7AA32B92-A408-42CB-A571-383721053FFA}</ProjectGuid>
|
||||||
|
<ProjectVersion>18.2</ProjectVersion>
|
||||||
|
<FrameworkType>VCL</FrameworkType>
|
||||||
|
<MainSource>JSRTTIExtension.dpr</MainSource>
|
||||||
|
<Base>True</Base>
|
||||||
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
|
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||||
|
<TargetedPlatforms>1</TargetedPlatforms>
|
||||||
|
<AppType>Application</AppType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||||
|
<Base_Win32>true</Base_Win32>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||||
|
<Base_Win64>true</Base_Win64>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||||
|
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||||
|
<CfgParent>Cfg_1</CfgParent>
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||||
|
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||||
|
<CfgParent>Cfg_2</CfgParent>
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<VerInfo_Locale>3082</VerInfo_Locale>
|
||||||
|
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
|
||||||
|
<SanitizedProjectName>JSRTTIExtension</SanitizedProjectName>
|
||||||
|
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||||
|
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
|
||||||
|
<DCC_E>false</DCC_E>
|
||||||
|
<DCC_N>false</DCC_N>
|
||||||
|
<DCC_S>false</DCC_S>
|
||||||
|
<DCC_F>false</DCC_F>
|
||||||
|
<DCC_K>false</DCC_K>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||||
|
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;frxe23;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;CEF4Delphi;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;frxTee23;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;GR32_DSGN_RSXE5;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;GR32_RSXE5;bindcomp;appanalytics;DBXInformixDriver;bindcompvcl;frxDB23;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;frx23;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
|
||||||
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
|
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||||
|
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||||
|
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||||
|
<DCC_ExeOutput>..\..\..\bin</DCC_ExeOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||||
|
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;bindcompvcl;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
|
||||||
|
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||||
|
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||||
|
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_DebugDCUs>true</DCC_DebugDCUs>
|
||||||
|
<DCC_Optimize>false</DCC_Optimize>
|
||||||
|
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||||
|
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||||
|
<DCC_RemoteDebug>true</DCC_RemoteDebug>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||||
|
<AppEnableHighDPI>true</AppEnableHighDPI>
|
||||||
|
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||||
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<DCC_RemoteDebug>false</DCC_RemoteDebug>
|
||||||
|
<BT_BuildType>Debug</BT_BuildType>
|
||||||
|
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||||
|
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||||
|
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DebugInformation>0</DCC_DebugInformation>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||||
|
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||||
|
<AppEnableHighDPI>true</AppEnableHighDPI>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<DelphiCompile Include="$(MainSource)">
|
||||||
|
<MainSource>MainSource</MainSource>
|
||||||
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="uJSRTTIExtension.pas">
|
||||||
|
<Form>JSRTTIExtensionFrm</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="uTestExtension.pas"/>
|
||||||
|
<DCCReference Include="uSimpleTextViewer.pas">
|
||||||
|
<Form>SimpleTextViewerFrm</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<BuildConfiguration Include="Release">
|
||||||
|
<Key>Cfg_2</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Base">
|
||||||
|
<Key>Base</Key>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Debug">
|
||||||
|
<Key>Cfg_1</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
|
<Borland.ProjectType>Application</Borland.ProjectType>
|
||||||
|
<BorlandProject>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">JSRTTIExtension.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl250.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k250.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="$(BDSBIN)\dclofficexp250.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||||
|
</Excluded_Packages>
|
||||||
|
</Delphi.Personality>
|
||||||
|
<Deployment Version="3">
|
||||||
|
<DeployFile LocalName="..\..\bin\JSRTTIExtension.exe" Configuration="Debug" Class="ProjectOutput">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteName>JSRTTIExtension.exe</RemoteName>
|
||||||
|
<Overwrite>true</Overwrite>
|
||||||
|
</Platform>
|
||||||
|
</DeployFile>
|
||||||
|
<DeployFile LocalName="JSExtension.exe" Configuration="Debug" Class="ProjectOutput"/>
|
||||||
|
<DeployClass Name="AdditionalDebugSymbols">
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidClassesDexFile">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>classes</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidGDBServer">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidLibnativeArmeabiFile">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidLibnativeMipsFile">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\mips</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidServiceOutput">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidSplashImageDef">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidSplashStyles">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\values</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_DefaultAppIcon">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon144">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon36">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon48">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon72">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon96">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage426">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-small</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage470">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-normal</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage640">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-large</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage960">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xlarge</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="DebugSymbols">
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="DependencyFramework">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.framework</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="DependencyModule">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
<Extensions>.dll;.bpl</Extensions>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Required="true" Name="DependencyPackage">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
<Extensions>.bpl</Extensions>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="File">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch1024">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch1536">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch2048">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch768">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPhone_Launch320">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPhone_Launch640">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPhone_Launch640x1136">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectAndroidManifest">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSDeviceDebug">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSDeviceResourceRules">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSEntitlements">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSInfoPList">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSResource">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectOSXEntitlements">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectOSXInfoPList">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectOSXResource">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\Resources</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Required="true" Name="ProjectOutput">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Linux64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectUWPManifest">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="UWP_DelphiLogo150">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win64">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="UWP_DelphiLogo44">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win64">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
|
||||||
|
</Deployment>
|
||||||
|
<Platforms>
|
||||||
|
<Platform value="Win32">True</Platform>
|
||||||
|
<Platform value="Win64">False</Platform>
|
||||||
|
</Platforms>
|
||||||
|
</BorlandProject>
|
||||||
|
<ProjectFileVersion>12</ProjectFileVersion>
|
||||||
|
</ProjectExtensions>
|
||||||
|
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||||
|
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
|
||||||
|
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
|
||||||
|
</Project>
|
384
demos/JavaScript/JSRTTIExtension/cef.inc
Normal file
384
demos/JavaScript/JSRTTIExtension/cef.inc
Normal file
@ -0,0 +1,384 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2017 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
// The complete list of compiler versions is here :
|
||||||
|
// http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions
|
||||||
|
|
||||||
|
{$DEFINE DELPHI_VERSION_UNKNOW}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$DEFINE CEF_MULTI_THREADED_MESSAGE_LOOP}
|
||||||
|
{$DEFINE SUPPORTS_INLINE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 5
|
||||||
|
{$IFDEF VER130}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 6
|
||||||
|
{$IFDEF VER140}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 7
|
||||||
|
{$IFDEF VER150}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 8
|
||||||
|
{$IFDEF VER160}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 2005
|
||||||
|
{$IFDEF VER170}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF VER180}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
// Delphi 2007
|
||||||
|
{$IFDEF VER185}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
// Delphi 2006
|
||||||
|
{$ELSE}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 2009
|
||||||
|
{$IFDEF VER200}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
//Delphi 2010
|
||||||
|
{$IFDEF VER210}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE
|
||||||
|
{$IFDEF VER220}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE2
|
||||||
|
{$IFDEF VER230}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE3
|
||||||
|
{$IFDEF VER240}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE4
|
||||||
|
{$IFDEF VER250}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE5
|
||||||
|
{$IFDEF VER260}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE6
|
||||||
|
{$IFDEF VER270}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE7
|
||||||
|
{$IFDEF VER280}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE8
|
||||||
|
{$IFDEF VER290}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$ENDIF VER290}
|
||||||
|
|
||||||
|
// Rad Studio 10 - Delphi Seattle
|
||||||
|
{$IFDEF VER300}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Rad Studio 10.1 - Delphi Berlin
|
||||||
|
{$IFDEF VER310}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$DEFINE DELPHI24_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Rad Studio 10.2 - Delphi Tokyo
|
||||||
|
{$IFDEF VER320}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$DEFINE DELPHI24_UP}
|
||||||
|
{$DEFINE DELPHI25_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
|
{$IFDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$DEFINE DELPHI24_UP}
|
||||||
|
{$DEFINE DELPHI25_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF DELPHI9_UP}
|
||||||
|
{$DEFINE SUPPORTS_INLINE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
88
demos/JavaScript/JSRTTIExtension/uJSRTTIExtension.dfm
Normal file
88
demos/JavaScript/JSRTTIExtension/uJSRTTIExtension.dfm
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
object JSRTTIExtensionFrm: TJSRTTIExtensionFrm
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Caption = 'JSRTTIExtension'
|
||||||
|
ClientHeight = 589
|
||||||
|
ClientWidth = 978
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'Tahoma'
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
object NavControlPnl: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 978
|
||||||
|
Height = 30
|
||||||
|
Align = alTop
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Enabled = False
|
||||||
|
Padding.Left = 5
|
||||||
|
Padding.Top = 5
|
||||||
|
Padding.Right = 5
|
||||||
|
Padding.Bottom = 5
|
||||||
|
ShowCaption = False
|
||||||
|
TabOrder = 0
|
||||||
|
object Edit1: TEdit
|
||||||
|
Left = 5
|
||||||
|
Top = 5
|
||||||
|
Width = 937
|
||||||
|
Height = 20
|
||||||
|
Margins.Right = 5
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'http://www.google.com'
|
||||||
|
ExplicitHeight = 21
|
||||||
|
end
|
||||||
|
object GoBtn: TButton
|
||||||
|
Left = 942
|
||||||
|
Top = 5
|
||||||
|
Width = 31
|
||||||
|
Height = 20
|
||||||
|
Margins.Left = 5
|
||||||
|
Align = alRight
|
||||||
|
Caption = 'Go'
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = GoBtnClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object StatusBar1: TStatusBar
|
||||||
|
Left = 0
|
||||||
|
Top = 570
|
||||||
|
Width = 978
|
||||||
|
Height = 19
|
||||||
|
Panels = <
|
||||||
|
item
|
||||||
|
Width = 50
|
||||||
|
end>
|
||||||
|
end
|
||||||
|
object CEFWindowParent1: TCEFWindowParent
|
||||||
|
Left = 0
|
||||||
|
Top = 30
|
||||||
|
Width = 978
|
||||||
|
Height = 540
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object Chromium1: TChromium
|
||||||
|
OnProcessMessageReceived = Chromium1ProcessMessageReceived
|
||||||
|
OnBeforeContextMenu = Chromium1BeforeContextMenu
|
||||||
|
OnContextMenuCommand = Chromium1ContextMenuCommand
|
||||||
|
OnAfterCreated = Chromium1AfterCreated
|
||||||
|
Left = 32
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object Timer1: TTimer
|
||||||
|
Enabled = False
|
||||||
|
Interval = 300
|
||||||
|
OnTimer = Timer1Timer
|
||||||
|
Left = 32
|
||||||
|
Top = 288
|
||||||
|
end
|
||||||
|
end
|
263
demos/JavaScript/JSRTTIExtension/uJSRTTIExtension.pas
Normal file
263
demos/JavaScript/JSRTTIExtension/uJSRTTIExtension.pas
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2017 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
unit uJSRTTIExtension;
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||||
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.ComCtrls,
|
||||||
|
{$ELSE}
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||||
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
|
{$ENDIF}
|
||||||
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants;
|
||||||
|
|
||||||
|
const
|
||||||
|
MINIBROWSER_SHOWTEXTVIEWER = WM_APP + $100;
|
||||||
|
|
||||||
|
MINIBROWSER_CONTEXTMENU_SETJSEVENT = MENU_ID_USER_FIRST + 1;
|
||||||
|
MINIBROWSER_CONTEXTMENU_JSVISITDOM = MENU_ID_USER_FIRST + 2;
|
||||||
|
|
||||||
|
MOUSEOVER_MESSAGE_NAME = 'mouseover';
|
||||||
|
CUSTOMNAME_MESSAGE_NAME = 'customname';
|
||||||
|
|
||||||
|
type
|
||||||
|
TJSRTTIExtensionFrm = class(TForm)
|
||||||
|
NavControlPnl: TPanel;
|
||||||
|
Edit1: TEdit;
|
||||||
|
GoBtn: TButton;
|
||||||
|
StatusBar1: TStatusBar;
|
||||||
|
CEFWindowParent1: TCEFWindowParent;
|
||||||
|
Chromium1: TChromium;
|
||||||
|
Timer1: TTimer;
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure GoBtnClick(Sender: TObject);
|
||||||
|
procedure Chromium1BeforeContextMenu(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
|
const params: ICefContextMenuParams; const model: ICefMenuModel);
|
||||||
|
procedure Chromium1ContextMenuCommand(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
|
const params: ICefContextMenuParams; commandId: Integer;
|
||||||
|
eventFlags: Cardinal; out Result: Boolean);
|
||||||
|
procedure Chromium1ProcessMessageReceived(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; sourceProcess: TCefProcessId;
|
||||||
|
const message: ICefProcessMessage; out Result: Boolean);
|
||||||
|
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
procedure Timer1Timer(Sender: TObject);
|
||||||
|
protected
|
||||||
|
FText : string;
|
||||||
|
|
||||||
|
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||||
|
procedure ShowTextViewerMsg(var aMessage : TMessage); message MINIBROWSER_SHOWTEXTVIEWER;
|
||||||
|
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
|
||||||
|
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
JSRTTIExtensionFrm: TJSRTTIExtensionFrm;
|
||||||
|
|
||||||
|
procedure GlobalCEFApp_OnWebKitInitialized;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
uses
|
||||||
|
uSimpleTextViewer, uCEFv8Handler, uTestExtension, uCEFMiscFunctions;
|
||||||
|
|
||||||
|
// The CEF3 document describing extensions is here :
|
||||||
|
// https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md
|
||||||
|
|
||||||
|
// This demo has a TTestExtension class that is registered in the
|
||||||
|
// GlobalCEFApp.OnWebKitInitialized event when the application is initializing.
|
||||||
|
|
||||||
|
// TTestExtension can send information back to the browser with a process message.
|
||||||
|
// The TTestExtension.mouseover function do this by calling
|
||||||
|
// TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
|
||||||
|
|
||||||
|
// TCefv8ContextRef.Current returns the v8 context for the frame that is currently executing JS,
|
||||||
|
// TCefv8ContextRef.Current.Browser.SendProcessMessage should send a message to the right browser even
|
||||||
|
// if you have created several browsers in one app.
|
||||||
|
|
||||||
|
// That message is received in the TChromium.OnProcessMessageReceived event.
|
||||||
|
// Even if you create several TChromium objects you should have no problem because each of them will have its own
|
||||||
|
// TChromium.OnProcessMessageReceived event to receive the messages from the extension.
|
||||||
|
|
||||||
|
procedure GlobalCEFApp_OnWebKitInitialized;
|
||||||
|
begin
|
||||||
|
{$IFDEF DELPHI14_UP}
|
||||||
|
// Registering the extension. Read this document for more details :
|
||||||
|
// https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md
|
||||||
|
TCefRTTIExtension.Register('myextension', TTestExtension);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.GoBtnClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Chromium1.LoadURL(Edit1.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.Chromium1BeforeContextMenu(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
|
const params: ICefContextMenuParams; const model: ICefMenuModel);
|
||||||
|
begin
|
||||||
|
// Adding some custom context menu entries
|
||||||
|
model.AddSeparator;
|
||||||
|
model.AddItem(MINIBROWSER_CONTEXTMENU_SETJSEVENT, 'Set mouseover event');
|
||||||
|
model.AddItem(MINIBROWSER_CONTEXTMENU_JSVISITDOM, 'Visit DOM in JavaScript');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.Chromium1ContextMenuCommand(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
|
const params: ICefContextMenuParams; commandId: Integer;
|
||||||
|
eventFlags: Cardinal; out Result: Boolean);
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
// Here is the code executed for each custom context menu entry
|
||||||
|
|
||||||
|
case commandId of
|
||||||
|
MINIBROWSER_CONTEXTMENU_SETJSEVENT :
|
||||||
|
if (browser <> nil) and (browser.MainFrame <> nil) then
|
||||||
|
browser.MainFrame.ExecuteJavaScript(
|
||||||
|
'document.body.addEventListener("mouseover", function(evt){'+
|
||||||
|
'function getpath(n){'+
|
||||||
|
'var ret = "<" + n.nodeName + ">";'+
|
||||||
|
'if (n.parentNode){return getpath(n.parentNode) + ret} else '+
|
||||||
|
'return ret'+
|
||||||
|
'};'+
|
||||||
|
'myextension.mouseover(getpath(evt.target))}'+ // This is the call from JavaScript to the extension with DELPHI code in uTestExtension.pas
|
||||||
|
')', 'about:blank', 0);
|
||||||
|
|
||||||
|
MINIBROWSER_CONTEXTMENU_JSVISITDOM :
|
||||||
|
if (browser <> nil) and (browser.MainFrame <> nil) then
|
||||||
|
browser.MainFrame.ExecuteJavaScript(
|
||||||
|
'var testhtml = document.body.innerHTML;' +
|
||||||
|
'myextension.sendresulttobrowser(testhtml, ' + quotedstr(CUSTOMNAME_MESSAGE_NAME) + ');', // This is the call from JavaScript to the extension with DELPHI code in uTestExtension.pas
|
||||||
|
'about:blank', 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.Chromium1ProcessMessageReceived(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; sourceProcess: TCefProcessId;
|
||||||
|
const message: ICefProcessMessage; out Result: Boolean);
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
if (message = nil) or (message.ArgumentList = nil) then exit;
|
||||||
|
|
||||||
|
// This function receives the messages with the JavaScript results
|
||||||
|
|
||||||
|
// Many of these events are received in different threads and the VCL
|
||||||
|
// doesn't like to create and destroy components in different threads.
|
||||||
|
|
||||||
|
// It's safer to store the results and send a message to the main thread to show them.
|
||||||
|
|
||||||
|
// The message names are defined in the extension or in JS code.
|
||||||
|
|
||||||
|
if (message.Name = MOUSEOVER_MESSAGE_NAME) then
|
||||||
|
begin
|
||||||
|
StatusBar1.Panels[0].Text := message.ArgumentList.GetString(0); // this doesn't create/destroy components
|
||||||
|
Result := True;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (message.Name = CUSTOMNAME_MESSAGE_NAME) then
|
||||||
|
begin
|
||||||
|
FText := message.ArgumentList.GetString(0);
|
||||||
|
PostMessage(Handle, MINIBROWSER_SHOWTEXTVIEWER, 0, 0);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
StatusBar1.Panels[0].Text := 'Initializing browser. Please wait...';
|
||||||
|
|
||||||
|
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
|
||||||
|
// If it's not initialized yet, we use a simple timer to create the browser later.
|
||||||
|
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then Timer1.Enabled := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.WMMove(var aMessage : TWMMove);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.WMMoving(var aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.ShowTextViewerMsg(var aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
// This form will show the HTML received from JavaScript
|
||||||
|
SimpleTextViewerFrm.Memo1.Lines.Text := FText;
|
||||||
|
SimpleTextViewerFrm.ShowModal;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.Timer1Timer(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Timer1.Enabled := False;
|
||||||
|
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) and not(Chromium1.Initialized) then
|
||||||
|
Timer1.Enabled := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJSRTTIExtensionFrm.BrowserCreatedMsg(var aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
StatusBar1.Panels[0].Text := '';
|
||||||
|
CEFWindowParent1.UpdateSize;
|
||||||
|
NavControlPnl.Enabled := True;
|
||||||
|
GoBtn.Click;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
29
demos/JavaScript/JSRTTIExtension/uSimpleTextViewer.dfm
Normal file
29
demos/JavaScript/JSRTTIExtension/uSimpleTextViewer.dfm
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
object SimpleTextViewerFrm: TSimpleTextViewerFrm
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
BorderIcons = [biSystemMenu]
|
||||||
|
BorderStyle = bsSingle
|
||||||
|
Caption = 'Simple text viewer'
|
||||||
|
ClientHeight = 572
|
||||||
|
ClientWidth = 694
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'Tahoma'
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 694
|
||||||
|
Height = 572
|
||||||
|
Align = alClient
|
||||||
|
ReadOnly = True
|
||||||
|
ScrollBars = ssBoth
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
31
demos/JavaScript/JSRTTIExtension/uSimpleTextViewer.pas
Normal file
31
demos/JavaScript/JSRTTIExtension/uSimpleTextViewer.pas
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
unit uSimpleTextViewer;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||||
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
|
||||||
|
{$ELSE}
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||||
|
Controls, Forms, Dialogs, StdCtrls;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
|
type
|
||||||
|
TSimpleTextViewerFrm = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
SimpleTextViewerFrm: TSimpleTextViewerFrm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
end.
|
86
demos/JavaScript/JSRTTIExtension/uTestExtension.pas
Normal file
86
demos/JavaScript/JSRTTIExtension/uTestExtension.pas
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2017 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
unit uTestExtension;
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
Winapi.Windows,
|
||||||
|
{$ELSE}
|
||||||
|
Windows,
|
||||||
|
{$ENDIF}
|
||||||
|
uCEFRenderProcessHandler, uCEFBrowserProcessHandler, uCEFInterfaces, uCEFProcessMessage,
|
||||||
|
uCEFv8Context, uCEFTypes, uCEFv8Handler;
|
||||||
|
|
||||||
|
type
|
||||||
|
TTestExtension = class
|
||||||
|
class procedure mouseover(const data: string);
|
||||||
|
class procedure sendresulttobrowser(const msgtext, msgname : string);
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
uCEFMiscFunctions, uCEFConstants, uJSRTTIExtension;
|
||||||
|
|
||||||
|
class procedure TTestExtension.mouseover(const data: string);
|
||||||
|
var
|
||||||
|
msg: ICefProcessMessage;
|
||||||
|
begin
|
||||||
|
msg := TCefProcessMessageRef.New(MOUSEOVER_MESSAGE_NAME);
|
||||||
|
msg.ArgumentList.SetString(0, data);
|
||||||
|
|
||||||
|
// Sending a message back to the browser. It'll be received in the TChromium.OnProcessMessageReceived event.
|
||||||
|
// TCefv8ContextRef.Current returns the v8 context for the frame that is currently executing Javascript.
|
||||||
|
TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
|
||||||
|
end;
|
||||||
|
|
||||||
|
class procedure TTestExtension.sendresulttobrowser(const msgtext, msgname : string);
|
||||||
|
var
|
||||||
|
msg: ICefProcessMessage;
|
||||||
|
begin
|
||||||
|
msg := TCefProcessMessageRef.New(msgname);
|
||||||
|
msg.ArgumentList.SetString(0, msgtext);
|
||||||
|
|
||||||
|
TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
14
demos/ResponseFilterBrowser/00-DeleteDCUs.bat
Normal file
14
demos/ResponseFilterBrowser/00-DeleteDCUs.bat
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
del /s /q *.dcu
|
||||||
|
del /s /q *.exe
|
||||||
|
del /s /q *.res
|
||||||
|
del /s /q *.log
|
||||||
|
del /s /q *.dsk
|
||||||
|
del /s /q *.identcache
|
||||||
|
del /s /q *.stat
|
||||||
|
del /s /q *.local
|
||||||
|
del /s /q *.~*
|
||||||
|
rmdir Win32\Debug
|
||||||
|
rmdir Win32\Release
|
||||||
|
rmdir Win32
|
||||||
|
rmdir __history
|
||||||
|
rmdir __recovery
|
72
demos/ResponseFilterBrowser/ResponseFilterBrowser.dpr
Normal file
72
demos/ResponseFilterBrowser/ResponseFilterBrowser.dpr
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2018 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
program ResponseFilterBrowser;
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
Vcl.Forms,
|
||||||
|
WinApi.Windows,
|
||||||
|
{$ELSE}
|
||||||
|
Forms,
|
||||||
|
Windows,
|
||||||
|
{$ENDIF }
|
||||||
|
uCEFApplication,
|
||||||
|
uResopnseFilterBrowser in 'uResopnseFilterBrowser.pas' {ResponseFilterBrowserFrm};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
// CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM.
|
||||||
|
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
|
||||||
|
|
||||||
|
begin
|
||||||
|
GlobalCEFApp := TCefApplication.Create;
|
||||||
|
|
||||||
|
if GlobalCEFApp.StartMainProcess then
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
{$IFDEF DELPHI11_UP}
|
||||||
|
Application.MainFormOnTaskbar := True;
|
||||||
|
{$ENDIF}
|
||||||
|
Application.CreateForm(TResponseFilterBrowserFrm, ResponseFilterBrowserFrm);
|
||||||
|
Application.Run;
|
||||||
|
end;
|
||||||
|
|
||||||
|
GlobalCEFApp.Free;
|
||||||
|
end.
|
597
demos/ResponseFilterBrowser/ResponseFilterBrowser.dproj
Normal file
597
demos/ResponseFilterBrowser/ResponseFilterBrowser.dproj
Normal file
@ -0,0 +1,597 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{55E00327-9D98-4DA3-A4E1-844942A01C6B}</ProjectGuid>
|
||||||
|
<ProjectVersion>18.2</ProjectVersion>
|
||||||
|
<FrameworkType>VCL</FrameworkType>
|
||||||
|
<MainSource>ResponseFilterBrowser.dpr</MainSource>
|
||||||
|
<Base>True</Base>
|
||||||
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
|
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||||
|
<TargetedPlatforms>1</TargetedPlatforms>
|
||||||
|
<AppType>Application</AppType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||||
|
<Base_Win32>true</Base_Win32>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||||
|
<Base_Win64>true</Base_Win64>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||||
|
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||||
|
<CfgParent>Cfg_1</CfgParent>
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
|
||||||
|
<Cfg_1_Win64>true</Cfg_1_Win64>
|
||||||
|
<CfgParent>Cfg_1</CfgParent>
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||||
|
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||||
|
<CfgParent>Cfg_2</CfgParent>
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
|
||||||
|
<Cfg_2_Win64>true</Cfg_2_Win64>
|
||||||
|
<CfgParent>Cfg_2</CfgParent>
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||||
|
<VerInfo_Locale>3082</VerInfo_Locale>
|
||||||
|
<SanitizedProjectName>ResponseFilterBrowser</SanitizedProjectName>
|
||||||
|
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
|
||||||
|
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
|
||||||
|
<DCC_E>false</DCC_E>
|
||||||
|
<DCC_N>false</DCC_N>
|
||||||
|
<DCC_S>false</DCC_S>
|
||||||
|
<DCC_F>false</DCC_F>
|
||||||
|
<DCC_K>false</DCC_K>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||||
|
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;frxe23;vclFireDAC;emsclientfiredac;DataSnapFireDAC;svnui;tethering;Componentes;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;Componentes_Int;CEF4Delphi;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;frxTee23;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;Componentes_UI;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Componentes_Misc;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;Componentes_RTF;DBXInformixDriver;bindcompvcl;frxDB23;Componentes_vCard;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;frx23;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
|
||||||
|
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||||
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
|
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
|
||||||
|
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||||
|
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||||
|
<DCC_ExeOutput>..\..\bin</DCC_ExeOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||||
|
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyProtocols230;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;CloudService;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;vcl;DBXSybaseASEDriver;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;bindcompvcl;TeeUI;IndyCore230;vclribbon;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;IndySystem230;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
|
||||||
|
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||||
|
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||||
|
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
|
||||||
|
<BT_BuildType>Debug</BT_BuildType>
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||||
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
|
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||||
|
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_DebugDCUs>true</DCC_DebugDCUs>
|
||||||
|
<DCC_Optimize>false</DCC_Optimize>
|
||||||
|
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||||
|
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||||
|
<DCC_RemoteDebug>true</DCC_RemoteDebug>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||||
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
|
<AppEnableHighDPI>true</AppEnableHighDPI>
|
||||||
|
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||||
|
<DCC_RemoteDebug>false</DCC_RemoteDebug>
|
||||||
|
<BT_BuildType>Debug</BT_BuildType>
|
||||||
|
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
|
||||||
|
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||||
|
<AppEnableHighDPI>true</AppEnableHighDPI>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||||
|
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||||
|
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DebugInformation>0</DCC_DebugInformation>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||||
|
<AppEnableHighDPI>true</AppEnableHighDPI>
|
||||||
|
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
|
||||||
|
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||||
|
<AppEnableHighDPI>true</AppEnableHighDPI>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<DelphiCompile Include="$(MainSource)">
|
||||||
|
<MainSource>MainSource</MainSource>
|
||||||
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="uResopnseFilterBrowser.pas">
|
||||||
|
<Form>ResponseFilterBrowserFrm</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<BuildConfiguration Include="Release">
|
||||||
|
<Key>Cfg_2</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Base">
|
||||||
|
<Key>Base</Key>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Debug">
|
||||||
|
<Key>Cfg_1</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
|
<Borland.ProjectType>Application</Borland.ProjectType>
|
||||||
|
<BorlandProject>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">ResponseFilterBrowser.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl250.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k250.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||||
|
<Excluded_Packages Name="$(BDSBIN)\dclofficexp250.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
|
||||||
|
</Excluded_Packages>
|
||||||
|
</Delphi.Personality>
|
||||||
|
<Deployment Version="3">
|
||||||
|
<DeployFile LocalName="Win32\Debug\SimpleBrowser.exe" Configuration="Debug" Class="ProjectOutput"/>
|
||||||
|
<DeployFile LocalName="..\..\bin\ResponseFilterBrowser.exe" Configuration="Debug" Class="ProjectOutput">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteName>ResponseFilterBrowser.exe</RemoteName>
|
||||||
|
<Overwrite>true</Overwrite>
|
||||||
|
</Platform>
|
||||||
|
</DeployFile>
|
||||||
|
<DeployClass Name="AdditionalDebugSymbols">
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidClassesDexFile">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>classes</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidGDBServer">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidLibnativeArmeabiFile">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidLibnativeMipsFile">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\mips</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidServiceOutput">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidSplashImageDef">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="AndroidSplashStyles">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\values</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_DefaultAppIcon">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon144">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon36">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon48">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon72">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_LauncherIcon96">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage426">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-small</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage470">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-normal</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage640">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-large</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="Android_SplashImage960">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>res\drawable-xlarge</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="DebugSymbols">
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="DependencyFramework">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.framework</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="DependencyModule">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
<Extensions>.dll;.bpl</Extensions>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Required="true" Name="DependencyPackage">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
<Extensions>.dylib</Extensions>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
<Extensions>.bpl</Extensions>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="File">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch1024">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch1536">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch2048">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPad_Launch768">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPhone_Launch320">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPhone_Launch640">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="iPhone_Launch640x1136">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectAndroidManifest">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSDeviceDebug">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSDeviceResourceRules">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSEntitlements">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSInfoPList">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectiOSResource">
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectOSXEntitlements">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>..\</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectOSXInfoPList">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectOSXResource">
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\Resources</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Required="true" Name="ProjectOutput">
|
||||||
|
<Platform Name="Android">
|
||||||
|
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSDevice64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="iOSSimulator">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Linux64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="OSX32">
|
||||||
|
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>0</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="ProjectUWPManifest">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win64">
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="UWP_DelphiLogo150">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win64">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<DeployClass Name="UWP_DelphiLogo44">
|
||||||
|
<Platform Name="Win32">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
<Platform Name="Win64">
|
||||||
|
<RemoteDir>Assets</RemoteDir>
|
||||||
|
<Operation>1</Operation>
|
||||||
|
</Platform>
|
||||||
|
</DeployClass>
|
||||||
|
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
|
||||||
|
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
|
||||||
|
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
|
||||||
|
</Deployment>
|
||||||
|
<Platforms>
|
||||||
|
<Platform value="Win32">True</Platform>
|
||||||
|
<Platform value="Win64">False</Platform>
|
||||||
|
</Platforms>
|
||||||
|
</BorlandProject>
|
||||||
|
<ProjectFileVersion>12</ProjectFileVersion>
|
||||||
|
</ProjectExtensions>
|
||||||
|
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||||
|
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
|
||||||
|
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
|
||||||
|
</Project>
|
384
demos/ResponseFilterBrowser/cef.inc
Normal file
384
demos/ResponseFilterBrowser/cef.inc
Normal file
@ -0,0 +1,384 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2017 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
// The complete list of compiler versions is here :
|
||||||
|
// http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions
|
||||||
|
|
||||||
|
{$DEFINE DELPHI_VERSION_UNKNOW}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$DEFINE CEF_MULTI_THREADED_MESSAGE_LOOP}
|
||||||
|
{$DEFINE SUPPORTS_INLINE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 5
|
||||||
|
{$IFDEF VER130}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 6
|
||||||
|
{$IFDEF VER140}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 7
|
||||||
|
{$IFDEF VER150}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 8
|
||||||
|
{$IFDEF VER160}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 2005
|
||||||
|
{$IFDEF VER170}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF VER180}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
// Delphi 2007
|
||||||
|
{$IFDEF VER185}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
// Delphi 2006
|
||||||
|
{$ELSE}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi 2009
|
||||||
|
{$IFDEF VER200}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
//Delphi 2010
|
||||||
|
{$IFDEF VER210}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE
|
||||||
|
{$IFDEF VER220}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE2
|
||||||
|
{$IFDEF VER230}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE3
|
||||||
|
{$IFDEF VER240}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE4
|
||||||
|
{$IFDEF VER250}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE5
|
||||||
|
{$IFDEF VER260}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE6
|
||||||
|
{$IFDEF VER270}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE7
|
||||||
|
{$IFDEF VER280}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Delphi XE8
|
||||||
|
{$IFDEF VER290}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$ENDIF VER290}
|
||||||
|
|
||||||
|
// Rad Studio 10 - Delphi Seattle
|
||||||
|
{$IFDEF VER300}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Rad Studio 10.1 - Delphi Berlin
|
||||||
|
{$IFDEF VER310}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$DEFINE DELPHI24_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// Rad Studio 10.2 - Delphi Tokyo
|
||||||
|
{$IFDEF VER320}
|
||||||
|
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$DEFINE DELPHI24_UP}
|
||||||
|
{$DEFINE DELPHI25_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
|
{$IFDEF DELPHI_VERSION_UNKNOW}
|
||||||
|
{$DEFINE DELPHI5_UP}
|
||||||
|
{$DEFINE DELPHI6_UP}
|
||||||
|
{$DEFINE DELPHI7_UP}
|
||||||
|
{$DEFINE DELPHI8_UP}
|
||||||
|
{$DEFINE DELPHI9_UP}
|
||||||
|
{$DEFINE DELPHI10_UP}
|
||||||
|
{$DEFINE DELPHI11_UP}
|
||||||
|
{$DEFINE DELPHI12_UP}
|
||||||
|
{$DEFINE DELPHI14_UP}
|
||||||
|
{$DEFINE DELPHI15_UP}
|
||||||
|
{$DEFINE DELPHI16_UP}
|
||||||
|
{$DEFINE DELPHI17_UP}
|
||||||
|
{$DEFINE DELPHI18_UP}
|
||||||
|
{$DEFINE DELPHI19_UP}
|
||||||
|
{$DEFINE DELPHI20_UP}
|
||||||
|
{$DEFINE DELPHI21_UP}
|
||||||
|
{$DEFINE DELPHI22_UP}
|
||||||
|
{$DEFINE DELPHI23_UP}
|
||||||
|
{$DEFINE DELPHI24_UP}
|
||||||
|
{$DEFINE DELPHI25_UP}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF DELPHI9_UP}
|
||||||
|
{$DEFINE SUPPORTS_INLINE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
98
demos/ResponseFilterBrowser/uResopnseFilterBrowser.dfm
Normal file
98
demos/ResponseFilterBrowser/uResopnseFilterBrowser.dfm
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
object ResponseFilterBrowserFrm: TResponseFilterBrowserFrm
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Caption = 'Initializing browser. Please wait...'
|
||||||
|
ClientHeight = 624
|
||||||
|
ClientWidth = 1038
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'Tahoma'
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
object Splitter1: TSplitter
|
||||||
|
Left = 0
|
||||||
|
Top = 532
|
||||||
|
Width = 1038
|
||||||
|
Height = 3
|
||||||
|
Cursor = crVSplit
|
||||||
|
Align = alBottom
|
||||||
|
ExplicitTop = 30
|
||||||
|
ExplicitWidth = 505
|
||||||
|
end
|
||||||
|
object AddressPnl: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1038
|
||||||
|
Height = 30
|
||||||
|
Align = alTop
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Enabled = False
|
||||||
|
Padding.Left = 5
|
||||||
|
Padding.Top = 5
|
||||||
|
Padding.Right = 5
|
||||||
|
Padding.Bottom = 5
|
||||||
|
ShowCaption = False
|
||||||
|
TabOrder = 0
|
||||||
|
object AddressEdt: TEdit
|
||||||
|
Left = 5
|
||||||
|
Top = 5
|
||||||
|
Width = 997
|
||||||
|
Height = 20
|
||||||
|
Margins.Right = 5
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'https://www.wikipedia.org'
|
||||||
|
ExplicitHeight = 21
|
||||||
|
end
|
||||||
|
object GoBtn: TButton
|
||||||
|
Left = 1002
|
||||||
|
Top = 5
|
||||||
|
Width = 31
|
||||||
|
Height = 20
|
||||||
|
Margins.Left = 5
|
||||||
|
Align = alRight
|
||||||
|
Caption = 'Go'
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = GoBtnClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CEFWindowParent1: TCEFWindowParent
|
||||||
|
Left = 0
|
||||||
|
Top = 30
|
||||||
|
Width = 1038
|
||||||
|
Height = 502
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 0
|
||||||
|
Top = 535
|
||||||
|
Width = 1038
|
||||||
|
Height = 89
|
||||||
|
Align = alBottom
|
||||||
|
ReadOnly = True
|
||||||
|
ScrollBars = ssBoth
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object Timer1: TTimer
|
||||||
|
Enabled = False
|
||||||
|
Interval = 300
|
||||||
|
OnTimer = Timer1Timer
|
||||||
|
Left = 56
|
||||||
|
Top = 88
|
||||||
|
end
|
||||||
|
object Chromium1: TChromium
|
||||||
|
OnAfterCreated = Chromium1AfterCreated
|
||||||
|
OnGetResourceResponseFilter = Chromium1GetResourceResponseFilter
|
||||||
|
Left = 56
|
||||||
|
Top = 160
|
||||||
|
end
|
||||||
|
end
|
262
demos/ResponseFilterBrowser/uResopnseFilterBrowser.pas
Normal file
262
demos/ResponseFilterBrowser/uResopnseFilterBrowser.pas
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
||||||
|
// browser in Delphi applications.
|
||||||
|
//
|
||||||
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||||
|
//
|
||||||
|
// For more information about CEF4Delphi visit :
|
||||||
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||||
|
//
|
||||||
|
// Copyright © 2018 Salvador Díaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ vvvv Original license and comments below vvvv *************
|
||||||
|
// ************************************************************************
|
||||||
|
(*
|
||||||
|
* Delphi Chromium Embedded 3
|
||||||
|
*
|
||||||
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||||
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||||
|
* the specific language governing rights and limitations under the License.
|
||||||
|
*
|
||||||
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||||
|
* Web site : http://www.progdigy.com
|
||||||
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||||
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||||
|
*
|
||||||
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||||
|
* this source code without explicit permission.
|
||||||
|
*
|
||||||
|
*)
|
||||||
|
|
||||||
|
unit uResopnseFilterBrowser;
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||||
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, System.SyncObjs,
|
||||||
|
{$ELSE}
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||||
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, SyncObjs,
|
||||||
|
{$ENDIF}
|
||||||
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, uCEFResponseFilter;
|
||||||
|
|
||||||
|
const
|
||||||
|
STREAM_COPY_COMPLETE = WM_APP + $B00;
|
||||||
|
|
||||||
|
type
|
||||||
|
TResponseFilterBrowserFrm = class(TForm)
|
||||||
|
AddressPnl: TPanel;
|
||||||
|
AddressEdt: TEdit;
|
||||||
|
GoBtn: TButton;
|
||||||
|
Timer1: TTimer;
|
||||||
|
Chromium1: TChromium;
|
||||||
|
CEFWindowParent1: TCEFWindowParent;
|
||||||
|
Splitter1: TSplitter;
|
||||||
|
Memo1: TMemo;
|
||||||
|
procedure GoBtnClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure Timer1Timer(Sender: TObject);
|
||||||
|
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
procedure Chromium1GetResourceResponseFilter(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
|
const request: ICefRequest; const response: ICefResponse;
|
||||||
|
out Result: ICefResponseFilter);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
protected
|
||||||
|
FFilter : ICefResponseFilter;
|
||||||
|
FStream : TMemoryStream;
|
||||||
|
FStreamCS : TCriticalSection;
|
||||||
|
FLoading : boolean;
|
||||||
|
|
||||||
|
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
|
||||||
|
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||||
|
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||||
|
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||||
|
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||||
|
procedure StreamCopyCompleteMsg(var aMessage : TMessage); message STREAM_COPY_COMPLETE;
|
||||||
|
|
||||||
|
procedure Filter_OnFilter(Sender: TObject; data_in: Pointer; data_in_size: NativeUInt; var data_in_read: NativeUInt; data_out: Pointer; data_out_size : NativeUInt; var data_out_written: NativeUInt; var aResult : TCefResponseFilterStatus);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
ResponseFilterBrowserFrm: TResponseFilterBrowserFrm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.Math,
|
||||||
|
{$ELSE}
|
||||||
|
Math,
|
||||||
|
{$ENDIF}
|
||||||
|
uCEFApplication;
|
||||||
|
|
||||||
|
// This demo uses a TCustomResponseFilter to read the contents from a JavaScript file in wikipedia.org into a TMemoryStream.
|
||||||
|
// The stream is shown in the TMemo when it's finished.
|
||||||
|
|
||||||
|
// For more information read the CEF3 code comments here :
|
||||||
|
// https://github.com/chromiumembedded/cef/blob/master/include/capi/cef_response_filter_capi.h
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.Filter_OnFilter(Sender: TObject;
|
||||||
|
data_in : Pointer;
|
||||||
|
data_in_size : NativeUInt;
|
||||||
|
var data_in_read : NativeUInt;
|
||||||
|
data_out : Pointer;
|
||||||
|
data_out_size : NativeUInt;
|
||||||
|
var data_out_written : NativeUInt;
|
||||||
|
var aResult : TCefResponseFilterStatus);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
// This event will be called repeatedly until the input buffer has been fully read.
|
||||||
|
FStreamCS.Acquire;
|
||||||
|
|
||||||
|
aResult := RESPONSE_FILTER_DONE;
|
||||||
|
|
||||||
|
if (data_in = nil) then
|
||||||
|
begin
|
||||||
|
data_in_read := 0;
|
||||||
|
data_out_written := 0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
data_in_read := data_in_size;
|
||||||
|
|
||||||
|
if (data_out <> nil) then
|
||||||
|
begin
|
||||||
|
data_out_written := min(data_in_read, data_out_size);
|
||||||
|
Move(data_in^, data_out^, data_out_written);
|
||||||
|
end;
|
||||||
|
|
||||||
|
FStream.WriteBuffer(data_in^, data_in_size);
|
||||||
|
PostMessage(Handle, STREAM_COPY_COMPLETE, 0, 0);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FStreamCS.Release;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FLoading := False;
|
||||||
|
FStream := TMemoryStream.Create;
|
||||||
|
FStreamCS := TCriticalSection.Create;
|
||||||
|
FFilter := TCustomResponseFilter.Create;
|
||||||
|
|
||||||
|
// This event will receive the data
|
||||||
|
TCustomResponseFilter(FFilter).OnFilter := Filter_OnFilter;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FFilter := nil;
|
||||||
|
FStream.Free;
|
||||||
|
FStreamCS.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
|
||||||
|
// If it's not initialized yet, we use a simple timer to create the browser later.
|
||||||
|
if not(Chromium1.CreateBrowser(CEFWindowParent1)) then Timer1.Enabled := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
// Now the browser is fully initialized we can send a message to the main form to load the initial web page.
|
||||||
|
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.Chromium1GetResourceResponseFilter(Sender : TObject;
|
||||||
|
const browser : ICefBrowser;
|
||||||
|
const frame : ICefFrame;
|
||||||
|
const request : ICefRequest;
|
||||||
|
const response : ICefResponse;
|
||||||
|
out Result : ICefResponseFilter);
|
||||||
|
begin
|
||||||
|
// All resources can be filtered but for this demo we will select a JS file in wikipedia.org called 'index-47f5f07682.js'
|
||||||
|
if (request <> nil) and
|
||||||
|
(pos('index', request.URL) > 0) and // the file contains the word 'index'
|
||||||
|
(pos('.js', request.URL) > 0) then // the file contains the extension '.js'
|
||||||
|
Result := FFilter
|
||||||
|
else
|
||||||
|
Result := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
Caption := 'Response Filter Browser';
|
||||||
|
AddressPnl.Enabled := True;
|
||||||
|
GoBtn.Click;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.StreamCopyCompleteMsg(var aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
FStreamCS.Acquire;
|
||||||
|
FStream.Seek(0, soBeginning);
|
||||||
|
Memo1.Lines.Clear;
|
||||||
|
Memo1.Lines.LoadFromStream(FStream);
|
||||||
|
FStream.Clear;
|
||||||
|
finally
|
||||||
|
FStreamCS.Release;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.GoBtnClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FLoading := True;
|
||||||
|
Chromium1.LoadURL(AddressEdt.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.Timer1Timer(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Timer1.Enabled := False;
|
||||||
|
if not(Chromium1.CreateBrowser(CEFWindowParent1)) and not(Chromium1.Initialized) then
|
||||||
|
Timer1.Enabled := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.WMMove(var aMessage : TWMMove);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.WMMoving(var aMessage : TMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.WMEnterMenuLoop(var aMessage: TMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TResponseFilterBrowserFrm.WMExitMenuLoop(var aMessage: TMessage);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
@ -56,14 +56,14 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
CEF_SUPPORTED_VERSION_MAJOR = 3;
|
CEF_SUPPORTED_VERSION_MAJOR = 3;
|
||||||
CEF_SUPPORTED_VERSION_MINOR = 3239;
|
CEF_SUPPORTED_VERSION_MINOR = 3282;
|
||||||
CEF_SUPPORTED_VERSION_RELEASE = 1723;
|
CEF_SUPPORTED_VERSION_RELEASE = 1731;
|
||||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||||
|
|
||||||
CEF_CHROMEELF_VERSION_MAJOR = 63;
|
CEF_CHROMEELF_VERSION_MAJOR = 64;
|
||||||
CEF_CHROMEELF_VERSION_MINOR = 0;
|
CEF_CHROMEELF_VERSION_MINOR = 0;
|
||||||
CEF_CHROMEELF_VERSION_RELEASE = 3239;
|
CEF_CHROMEELF_VERSION_RELEASE = 3282;
|
||||||
CEF_CHROMEELF_VERSION_BUILD = 109;
|
CEF_CHROMEELF_VERSION_BUILD = 119;
|
||||||
|
|
||||||
LIBCEF_DLL = 'libcef.dll';
|
LIBCEF_DLL = 'libcef.dll';
|
||||||
CHROMEELF_DLL = 'chrome_elf.dll';
|
CHROMEELF_DLL = 'chrome_elf.dll';
|
||||||
@ -523,9 +523,9 @@ end;
|
|||||||
procedure TCefApplication.RemoveAppReferences;
|
procedure TCefApplication.RemoveAppReferences;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
if (FResourceBundleHandler <> nil) then FResourceBundleHandler.InitializeVars;
|
if (FResourceBundleHandler <> nil) then FResourceBundleHandler.RemoveReferences;
|
||||||
if (FBrowserProcessHandler <> nil) then FBrowserProcessHandler.InitializeVars;
|
if (FBrowserProcessHandler <> nil) then FBrowserProcessHandler.RemoveReferences;
|
||||||
if (FRenderProcessHandler <> nil) then FRenderProcessHandler.InitializeVars;
|
if (FRenderProcessHandler <> nil) then FRenderProcessHandler.RemoveReferences;
|
||||||
except
|
except
|
||||||
on e : exception do
|
on e : exception do
|
||||||
if CustomExceptionHandler('TCefApplication.RemoveAppReferences', e) then raise;
|
if CustomExceptionHandler('TCefApplication.RemoveAppReferences', e) then raise;
|
||||||
|
@ -58,7 +58,7 @@ type
|
|||||||
function GetPrintHandler : ICefPrintHandler; virtual;
|
function GetPrintHandler : ICefPrintHandler; virtual;
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; abstract;
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; abstract;
|
||||||
|
|
||||||
procedure InitializeVars; virtual; abstract;
|
procedure RemoveReferences; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -76,7 +76,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
procedure RemoveReferences; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -171,12 +171,12 @@ end;
|
|||||||
|
|
||||||
destructor TCefCustomBrowserProcessHandler.Destroy;
|
destructor TCefCustomBrowserProcessHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.InitializeVars;
|
procedure TCefCustomBrowserProcessHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
FCefApp := nil;
|
||||||
end;
|
end;
|
||||||
|
@ -53,19 +53,13 @@ uses
|
|||||||
Windows, Messages, Classes, Controls, Graphics, Forms, ActiveX,
|
Windows, Messages, Classes, Controls, Graphics, Forms, ActiveX,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFMiscFunctions, uCEFClient,
|
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFMiscFunctions, uCEFClient,
|
||||||
uCEFPDFPrintCallback, uCEFStringVisitor, uCEFConstants, uCEFTask,
|
uCEFConstants, uCEFTask, uCEFDomVisitor, uCEFChromiumEvents,
|
||||||
uCEFDeleteCookiesCallback, uCEFDomVisitor, uCEFChromiumEvents,
|
uCEFChromiumOptions, uCEFChromiumFontOptions, uCEFPDFPrintOptions, uCEFDragAndDropMgr;
|
||||||
uCEFChromiumOptions, uCEFChromiumFontOptions, uCEFPDFPrintOptions,
|
|
||||||
uCEFDragAndDropMgr;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TChromium = class(TComponent, IChromiumEvents)
|
TChromium = class(TComponent, IChromiumEvents)
|
||||||
protected
|
protected
|
||||||
FCompHandle : HWND;
|
FCompHandle : HWND;
|
||||||
FVisitor : ICefStringVisitor;
|
|
||||||
FPDFPrintcb : ICefPdfPrintCallback;
|
|
||||||
FResolveHostcb : ICefResolveCallback;
|
|
||||||
FCookiDeletercb : ICefDeleteCookiesCallback;
|
|
||||||
FHandler : ICefClient;
|
FHandler : ICefClient;
|
||||||
FBrowser : ICefBrowser;
|
FBrowser : ICefBrowser;
|
||||||
FBrowserId : Integer;
|
FBrowserId : Integer;
|
||||||
@ -264,10 +258,6 @@ type
|
|||||||
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): ICefBrowser;
|
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): ICefBrowser;
|
||||||
|
|
||||||
procedure DestroyClientHandler;
|
procedure DestroyClientHandler;
|
||||||
procedure DestroyVisitor;
|
|
||||||
procedure DestroyPDFPrintcb;
|
|
||||||
procedure DestroyResolveHostcb;
|
|
||||||
procedure DestroyCookiDeletercb;
|
|
||||||
|
|
||||||
procedure ClearBrowserReference;
|
procedure ClearBrowserReference;
|
||||||
|
|
||||||
@ -351,7 +341,7 @@ type
|
|||||||
procedure doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); virtual;
|
procedure doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); virtual;
|
||||||
function doOnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; virtual;
|
function doOnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; virtual;
|
||||||
procedure doOnStatusMessage(const browser: ICefBrowser; const value: ustring); virtual;
|
procedure doOnStatusMessage(const browser: ICefBrowser; const value: ustring); virtual;
|
||||||
function doOnConsoleMessage(const browser: ICefBrowser; const aMessage, source: ustring; line: Integer): Boolean; virtual;
|
function doOnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const aMessage, source: ustring; line: Integer): Boolean; virtual;
|
||||||
function doOnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; virtual;
|
function doOnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; virtual;
|
||||||
|
|
||||||
// ICefDownloadHandler
|
// ICefDownloadHandler
|
||||||
@ -419,12 +409,6 @@ type
|
|||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
||||||
procedure doGetHTML(const aFrameName : ustring); overload;
|
|
||||||
procedure doGetHTML(const aFrame : ICefFrame); overload;
|
|
||||||
procedure doGetHTML(const aFrameIdentifier : int64); overload;
|
|
||||||
procedure doGetText(const aFrameName : ustring); overload;
|
|
||||||
procedure doGetText(const aFrame : ICefFrame); overload;
|
|
||||||
procedure doGetText(const aFrameIdentifier : int64); overload;
|
|
||||||
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
||||||
procedure doTextResultAvailable(const aText : string); virtual;
|
procedure doTextResultAvailable(const aText : string); virtual;
|
||||||
procedure doUpdatePreferences; virtual;
|
procedure doUpdatePreferences; virtual;
|
||||||
@ -445,6 +429,8 @@ type
|
|||||||
procedure InitializeDragAndDrop(const aDropTargetCtrl : TWinControl);
|
procedure InitializeDragAndDrop(const aDropTargetCtrl : TWinControl);
|
||||||
procedure ShutdownDragAndDrop;
|
procedure ShutdownDragAndDrop;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure LoadURL(const aURL : ustring);
|
procedure LoadURL(const aURL : ustring);
|
||||||
procedure LoadString(const aString : ustring; const aURL : ustring = '');
|
procedure LoadString(const aString : ustring; const aURL : ustring = '');
|
||||||
procedure LoadRequest(const aRequest: ICefRequest);
|
procedure LoadRequest(const aRequest: ICefRequest);
|
||||||
@ -695,8 +681,8 @@ uses
|
|||||||
SysUtils, Math,
|
SysUtils, Math,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
||||||
uCEFApplication, uCEFProcessMessage, uOLEDragAndDrop, uCEFRequestContext,
|
uCEFApplication, uCEFProcessMessage, uCEFRequestContext, uOLEDragAndDrop,
|
||||||
uCEFResolveCallback;
|
uCEFPDFPrintCallback, uCEFResolveCallback, uCEFDeleteCookiesCallback, uCEFStringVisitor;
|
||||||
|
|
||||||
constructor TChromium.Create(AOwner: TComponent);
|
constructor TChromium.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -711,10 +697,6 @@ begin
|
|||||||
FOptions := nil;
|
FOptions := nil;
|
||||||
FFontOptions := nil;
|
FFontOptions := nil;
|
||||||
FDefaultEncoding := '';
|
FDefaultEncoding := '';
|
||||||
FVisitor := nil;
|
|
||||||
FPDFPrintcb := nil;
|
|
||||||
FResolveHostcb := nil;
|
|
||||||
FCookiDeletercb := nil;
|
|
||||||
FPDFPrintOptions := nil;
|
FPDFPrintOptions := nil;
|
||||||
FUpdatePreferences := False;
|
FUpdatePreferences := False;
|
||||||
FCustomHeaderName := '';
|
FCustomHeaderName := '';
|
||||||
@ -787,10 +769,6 @@ end;
|
|||||||
procedure TChromium.BeforeDestruction;
|
procedure TChromium.BeforeDestruction;
|
||||||
begin
|
begin
|
||||||
DestroyClientHandler;
|
DestroyClientHandler;
|
||||||
DestroyVisitor;
|
|
||||||
DestroyPDFPrintcb;
|
|
||||||
DestroyResolveHostcb;
|
|
||||||
DestroyCookiDeletercb;
|
|
||||||
|
|
||||||
inherited BeforeDestruction;
|
inherited BeforeDestruction;
|
||||||
end;
|
end;
|
||||||
@ -806,7 +784,7 @@ begin
|
|||||||
try
|
try
|
||||||
if (FHandler <> nil) then
|
if (FHandler <> nil) then
|
||||||
begin
|
begin
|
||||||
FHandler.InitializeVars;
|
FHandler.RemoveReferences;
|
||||||
FHandler := nil;
|
FHandler := nil;
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
@ -815,62 +793,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.DestroyVisitor;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FVisitor <> nil) then
|
|
||||||
begin
|
|
||||||
FVisitor.InitializeVars;
|
|
||||||
FVisitor := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TChromium.DestroyVisitor', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.DestroyPDFPrintcb;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FPDFPrintcb <> nil) then
|
|
||||||
begin
|
|
||||||
FPDFPrintcb.InitializeVars;
|
|
||||||
FPDFPrintcb := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TChromium.DestroyPDFPrintcb', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.DestroyResolveHostcb;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FResolveHostcb <> nil) then
|
|
||||||
begin
|
|
||||||
FResolveHostcb.InitializeVars;
|
|
||||||
FResolveHostcb := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TChromium.DestroyResolveHostcb', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.DestroyCookiDeletercb;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FCookiDeletercb <> nil) then
|
|
||||||
begin
|
|
||||||
FCookiDeletercb.InitializeVars;
|
|
||||||
FCookiDeletercb := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TChromium.DestroyCookiDeletercb', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.AfterConstruction;
|
procedure TChromium.AfterConstruction;
|
||||||
begin
|
begin
|
||||||
inherited AfterConstruction;
|
inherited AfterConstruction;
|
||||||
@ -1290,12 +1212,13 @@ end;
|
|||||||
procedure TChromium.PrintToPDF(const aFilePath, aTitle, aURL : ustring);
|
procedure TChromium.PrintToPDF(const aFilePath, aTitle, aURL : ustring);
|
||||||
var
|
var
|
||||||
TempSettings : TCefPdfPrintSettings;
|
TempSettings : TCefPdfPrintSettings;
|
||||||
|
TempCallback : ICefPdfPrintCallback;
|
||||||
begin
|
begin
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
GetPrintPDFSettings(TempSettings, aTitle, aURL);
|
GetPrintPDFSettings(TempSettings, aTitle, aURL);
|
||||||
if (FPDFPrintcb = nil) then FPDFPrintcb := TCefCustomPDFPrintCallBack.Create(self);
|
TempCallback := TCefCustomPDFPrintCallBack.Create(self);
|
||||||
FBrowser.Host.PrintToPdf(aFilePath, @TempSettings, FPDFPrintcb);
|
FBrowser.Host.PrintToPdf(aFilePath, @TempSettings, TempCallback);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1925,103 +1848,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.doGetHTML(const aFrameName : ustring);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (length(aFrameName) > 0) then
|
|
||||||
TempFrame := FBrowser.GetFrame(aFrameName)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetSource(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.doGetHTML(const aFrame : ICefFrame);
|
|
||||||
begin
|
|
||||||
if Initialized and (aFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
aFrame.GetSource(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.doGetHTML(const aFrameIdentifier : int64);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (aFrameIdentifier <> 0) then
|
|
||||||
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetSource(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.doGetText(const aFrameName : ustring);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (length(aFrameName) > 0) then
|
|
||||||
TempFrame := FBrowser.GetFrame(aFrameName)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetText(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.doGetText(const aFrame : ICefFrame);
|
|
||||||
begin
|
|
||||||
if Initialized and (aFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
aFrame.GetText(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromium.doGetText(const aFrameIdentifier : int64);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (aFrameIdentifier <> 0) then
|
|
||||||
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetText(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TChromium.DeleteCookies : boolean;
|
function TChromium.DeleteCookies : boolean;
|
||||||
var
|
var
|
||||||
TempManager : ICefCookieManager;
|
TempManager : ICefCookieManager;
|
||||||
|
TempCallback : ICefDeleteCookiesCallback;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
@ -2031,9 +1861,8 @@ begin
|
|||||||
|
|
||||||
if (TempManager <> nil) then
|
if (TempManager <> nil) then
|
||||||
begin
|
begin
|
||||||
if (FCookiDeletercb = nil) then FCookiDeletercb := TCefCustomDeleteCookiesCallback.Create(self);
|
TempCallback := TCefCustomDeleteCookiesCallback.Create(self);
|
||||||
|
Result := TempManager.DeleteCookies('', '', TempCallback);
|
||||||
Result := TempManager.DeleteCookies('', '', FCookiDeletercb);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2041,74 +1870,104 @@ end;
|
|||||||
// Leave aFrameName empty to get the HTML source from the main frame
|
// Leave aFrameName empty to get the HTML source from the main frame
|
||||||
procedure TChromium.RetrieveHTML(const aFrameName : ustring);
|
procedure TChromium.RetrieveHTML(const aFrameName : ustring);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetHTMLTask.Create(self, aFrameName);
|
if (length(aFrameName) > 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrame(aFrameName)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetSource(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.RetrieveHTML(const aFrame : ICefFrame);
|
procedure TChromium.RetrieveHTML(const aFrame : ICefFrame);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
if Initialized and (aFrame <> nil) then
|
||||||
if Initialized then
|
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetHTMLTask.Create(self, aFrame);
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
CefPostTask(TID_UI, TempTask);
|
aFrame.GetSource(TempVisitor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.RetrieveHTML(const aFrameIdentifier : int64);
|
procedure TChromium.RetrieveHTML(const aFrameIdentifier : int64);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetHTMLTask.Create(self, aFrameIdentifier);
|
if (aFrameIdentifier <> 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetSource(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Leave aFrameName empty to get the HTML source from the main frame
|
// Leave aFrameName empty to get the HTML source from the main frame
|
||||||
procedure TChromium.RetrieveText(const aFrameName : ustring);
|
procedure TChromium.RetrieveText(const aFrameName : ustring);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetTextTask.Create(self, aFrameName);
|
if (length(aFrameName) > 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrame(aFrameName)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetText(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.RetrieveText(const aFrame : ICefFrame);
|
procedure TChromium.RetrieveText(const aFrame : ICefFrame);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
if Initialized and (aFrame <> nil) then
|
||||||
if Initialized then
|
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetTextTask.Create(self, aFrame);
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
CefPostTask(TID_UI, TempTask);
|
aFrame.GetText(TempVisitor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.RetrieveText(const aFrameIdentifier : int64);
|
procedure TChromium.RetrieveText(const aFrameIdentifier : int64);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetTextTask.Create(self, aFrameIdentifier);
|
if (aFrameIdentifier <> 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetText(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2159,12 +2018,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.ResolveHost(const aURL : ustring);
|
procedure TChromium.ResolveHost(const aURL : ustring);
|
||||||
|
var
|
||||||
|
TempCallback : ICefResolveCallback;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnResolvedHostAvailable event of this class
|
// Results will be received in the OnResolvedHostAvailable event of this class
|
||||||
if Initialized and (length(aURL) > 0) then
|
if Initialized and (length(aURL) > 0) then
|
||||||
begin
|
begin
|
||||||
if (FResolveHostcb = nil) then FResolveHostcb := TCefCustomResolveCallback.Create(self);
|
TempCallback := TCefCustomResolveCallback.Create(self);
|
||||||
FBrowser.Host.RequestContext.ResolveHost(aURL, FResolveHostcb);
|
FBrowser.Host.RequestContext.ResolveHost(aURL, TempCallback);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3030,13 +2891,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TChromium.doOnConsoleMessage(const browser : ICefBrowser;
|
function TChromium.doOnConsoleMessage(const browser : ICefBrowser;
|
||||||
|
level : TCefLogSeverity;
|
||||||
const aMessage : ustring;
|
const aMessage : ustring;
|
||||||
const source : ustring;
|
const source : ustring;
|
||||||
line : Integer): Boolean;
|
line : Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
if Assigned(FOnConsoleMessage) then FOnConsoleMessage(Self, browser, aMessage, source, line, Result);
|
if Assigned(FOnConsoleMessage) then FOnConsoleMessage(Self, browser, level, aMessage, source, line, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChromium.doOnAutoResize(const browser : ICefBrowser;
|
function TChromium.doOnAutoResize(const browser : ICefBrowser;
|
||||||
|
@ -86,7 +86,7 @@ type
|
|||||||
TOnFullScreenModeChange = procedure(Sender: TObject; const browser: ICefBrowser; fullscreen: Boolean) of object;
|
TOnFullScreenModeChange = procedure(Sender: TObject; const browser: ICefBrowser; fullscreen: Boolean) of object;
|
||||||
TOnTooltip = procedure(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean) of object;
|
TOnTooltip = procedure(Sender: TObject; const browser: ICefBrowser; var text: ustring; out Result: Boolean) of object;
|
||||||
TOnStatusMessage = procedure(Sender: TObject; const browser: ICefBrowser; const value: ustring) of object;
|
TOnStatusMessage = procedure(Sender: TObject; const browser: ICefBrowser; const value: ustring) of object;
|
||||||
TOnConsoleMessage = procedure(Sender: TObject; const browser: ICefBrowser; const message, source: ustring; line: Integer; out Result: Boolean) of object;
|
TOnConsoleMessage = procedure(Sender: TObject; const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer; out Result: Boolean) of object;
|
||||||
TOnAutoResize = procedure(Sender: TObject; const browser: ICefBrowser; const new_size: PCefSize; out Result: Boolean) of object;
|
TOnAutoResize = procedure(Sender: TObject; const browser: ICefBrowser; const new_size: PCefSize; out Result: Boolean) of object;
|
||||||
|
|
||||||
// ICefDownloadHandler
|
// ICefDownloadHandler
|
||||||
|
@ -73,7 +73,7 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler; virtual;
|
function GetRequestHandler: ICefRequestHandler; virtual;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
||||||
|
|
||||||
procedure InitializeVars; virtual;
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefClient;
|
class function UnWrap(data: Pointer): ICefClient;
|
||||||
@ -97,7 +97,7 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler; virtual;
|
function GetRequestHandler: ICefRequestHandler; virtual;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
||||||
|
|
||||||
procedure InitializeVars; virtual;
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -105,7 +105,7 @@ type
|
|||||||
|
|
||||||
TCustomClientHandler = class(TCefClientOwn)
|
TCustomClientHandler = class(TCefClientOwn)
|
||||||
protected
|
protected
|
||||||
FEvents : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
FLoadHandler : ICefLoadHandler;
|
FLoadHandler : ICefLoadHandler;
|
||||||
FFocusHandler : ICefFocusHandler;
|
FFocusHandler : ICefFocusHandler;
|
||||||
FContextMenuHandler : ICefContextMenuHandler;
|
FContextMenuHandler : ICefContextMenuHandler;
|
||||||
@ -121,6 +121,7 @@ type
|
|||||||
FDragHandler : ICefDragHandler;
|
FDragHandler : ICefDragHandler;
|
||||||
FFindHandler : ICefFindHandler;
|
FFindHandler : ICefFindHandler;
|
||||||
|
|
||||||
|
|
||||||
function GetContextMenuHandler: ICefContextMenuHandler; override;
|
function GetContextMenuHandler: ICefContextMenuHandler; override;
|
||||||
function GetDialogHandler: ICefDialogHandler; override;
|
function GetDialogHandler: ICefDialogHandler; override;
|
||||||
function GetDisplayHandler: ICefDisplayHandler; override;
|
function GetDisplayHandler: ICefDisplayHandler; override;
|
||||||
@ -137,14 +138,16 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler; override;
|
function GetRequestHandler: ICefRequestHandler; override;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; override;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; override;
|
||||||
|
|
||||||
|
procedure InitializeVars;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents;
|
constructor Create(const events: IChromiumEvents;
|
||||||
aCreateLoadHandler, aCreateFocusHandler, aCreateContextMenuHandler, aCreateDialogHandler,
|
aCreateLoadHandler, aCreateFocusHandler, aCreateContextMenuHandler, aCreateDialogHandler,
|
||||||
aCreateKeyboardHandler, aCreateDisplayHandler, aCreateDownloadHandler, aCreateGeolocationHandler,
|
aCreateKeyboardHandler, aCreateDisplayHandler, aCreateDownloadHandler, aCreateGeolocationHandler,
|
||||||
aCreateJsDialogHandler, aCreateLifeSpanHandler, aCreateRenderHandler, aCreateRequestHandler,
|
aCreateJsDialogHandler, aCreateLifeSpanHandler, aCreateRenderHandler, aCreateRequestHandler,
|
||||||
aCreateDragHandler, aCreateFindHandler : boolean); reintroduce; virtual;
|
aCreateDragHandler, aCreateFindHandler : boolean); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
procedure BeforeDestruction; override;
|
||||||
procedure InitializeVars; override;
|
procedure RemoveReferences; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -249,7 +252,7 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefClientRef.InitializeVars;
|
procedure TCefClientRef.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
@ -450,7 +453,7 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefClientOwn.InitializeVars;
|
procedure TCefClientOwn.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
@ -481,7 +484,7 @@ begin
|
|||||||
|
|
||||||
InitializeVars;
|
InitializeVars;
|
||||||
|
|
||||||
FEvents := events;
|
FEvents := Pointer(events);
|
||||||
|
|
||||||
if (FEvents <> nil) then
|
if (FEvents <> nil) then
|
||||||
begin
|
begin
|
||||||
@ -502,11 +505,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomClientHandler.Destroy;
|
procedure TCustomClientHandler.BeforeDestruction;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
InitializeVars;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited BeforeDestruction;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomClientHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
|
||||||
|
if (FLoadHandler <> nil) then FLoadHandler.RemoveReferences;
|
||||||
|
if (FFocusHandler <> nil) then FFocusHandler.RemoveReferences;
|
||||||
|
if (FContextMenuHandler <> nil) then FContextMenuHandler.RemoveReferences;
|
||||||
|
if (FDialogHandler <> nil) then FDialogHandler.RemoveReferences;
|
||||||
|
if (FKeyboardHandler <> nil) then FKeyboardHandler.RemoveReferences;
|
||||||
|
if (FDisplayHandler <> nil) then FDisplayHandler.RemoveReferences;
|
||||||
|
if (FDownloadHandler <> nil) then FDownloadHandler.RemoveReferences;
|
||||||
|
if (FGeolocationHandler <> nil) then FGeolocationHandler.RemoveReferences;
|
||||||
|
if (FJsDialogHandler <> nil) then FJsDialogHandler.RemoveReferences;
|
||||||
|
if (FLifeSpanHandler <> nil) then FLifeSpanHandler.RemoveReferences;
|
||||||
|
if (FRequestHandler <> nil) then FRequestHandler.RemoveReferences;
|
||||||
|
if (FRenderHandler <> nil) then FRenderHandler.RemoveReferences;
|
||||||
|
if (FDragHandler <> nil) then FDragHandler.RemoveReferences;
|
||||||
|
if (FFindHandler <> nil) then FFindHandler.RemoveReferences;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomClientHandler.InitializeVars;
|
procedure TCustomClientHandler.InitializeVars;
|
||||||
@ -598,12 +621,14 @@ begin
|
|||||||
Result := FRequestHandler;
|
Result := FRequestHandler;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomClientHandler.OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean;
|
function TCustomClientHandler.OnProcessMessageReceived(const browser : ICefBrowser;
|
||||||
|
sourceProcess : TCefProcessId;
|
||||||
|
const message : ICefProcessMessage): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvents.doOnProcessMessageReceived(browser, sourceProcess, message)
|
Result := IChromiumEvents(FEvents).doOnProcessMessageReceived(browser, sourceProcess, message)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := inherited OnProcessMessageReceived(browser, sourceProcess, message);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -312,6 +312,15 @@ const
|
|||||||
JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 shl 1;
|
JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 shl 1;
|
||||||
JSON_WRITER_PRETTY_PRINT = 1 shl 2;
|
JSON_WRITER_PRETTY_PRINT = 1 shl 2;
|
||||||
|
|
||||||
|
// /include/internal/cef_types.h (cef_log_severity_t)
|
||||||
|
LOGSEVERITY_DEFAULT = 0;
|
||||||
|
LOGSEVERITY_VERBOSE = 1;
|
||||||
|
LOGSEVERITY_DEBUG = LOGSEVERITY_VERBOSE;
|
||||||
|
LOGSEVERITY_INFO = 2;
|
||||||
|
LOGSEVERITY_WARNING = 3;
|
||||||
|
LOGSEVERITY_ERROR = 4;
|
||||||
|
LOGSEVERITY_DISABLE = 99;
|
||||||
|
|
||||||
|
|
||||||
//******************************************************
|
//******************************************************
|
||||||
//****************** OTHER CONSTANTS *******************
|
//****************** OTHER CONSTANTS *******************
|
||||||
@ -332,7 +341,7 @@ const
|
|||||||
CEF_CONTENT_SETTING_SESSION_ONLY = 4;
|
CEF_CONTENT_SETTING_SESSION_ONLY = 4;
|
||||||
CEF_CONTENT_SETTING_NUM_SETTINGS = 5;
|
CEF_CONTENT_SETTING_NUM_SETTINGS = 5;
|
||||||
|
|
||||||
// Used in the severity parameter of cef_log
|
// Used in the severity parameter in the 'cef_log' function, also known as 'CefLog' in CEF4Delphi.
|
||||||
CEF_LOG_SEVERITY_INFO = 0;
|
CEF_LOG_SEVERITY_INFO = 0;
|
||||||
CEF_LOG_SEVERITY_WARNING = 1;
|
CEF_LOG_SEVERITY_WARNING = 1;
|
||||||
CEF_LOG_SEVERITY_ERROR = 2;
|
CEF_LOG_SEVERITY_ERROR = 2;
|
||||||
|
@ -57,27 +57,36 @@ type
|
|||||||
function OnContextMenuCommand(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags): Boolean; virtual;
|
function OnContextMenuCommand(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags): Boolean; virtual;
|
||||||
procedure OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame); virtual;
|
procedure OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomContextMenuHandler = class(TCefContextMenuHandlerOwn)
|
TCustomContextMenuHandler = class(TCefContextMenuHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnBeforeContextMenu(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel); override;
|
procedure OnBeforeContextMenu(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel); override;
|
||||||
function RunContextMenu(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel; const callback: ICefRunContextMenuCallback): Boolean; override;
|
function RunContextMenu(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel; const callback: ICefRunContextMenuCallback): Boolean; override;
|
||||||
function OnContextMenuCommand(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags): Boolean; override;
|
function OnContextMenuCommand(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags): Boolean; override;
|
||||||
procedure OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame); override;
|
procedure OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame, uCEFContextMenuParams,
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame, uCEFContextMenuParams,
|
||||||
uCEFMenuModel, uCEFRunContextMenuCallback;
|
uCEFMenuModel, uCEFRunContextMenuCallback;
|
||||||
|
|
||||||
@ -119,66 +128,80 @@ end;
|
|||||||
constructor TCefContextMenuHandlerOwn.Create;
|
constructor TCefContextMenuHandlerOwn.Create;
|
||||||
begin
|
begin
|
||||||
inherited CreateData(SizeOf(TCefContextMenuHandler));
|
inherited CreateData(SizeOf(TCefContextMenuHandler));
|
||||||
|
|
||||||
with PCefContextMenuHandler(FData)^ do
|
with PCefContextMenuHandler(FData)^ do
|
||||||
begin
|
begin
|
||||||
on_before_context_menu := cef_context_menu_handler_on_before_context_menu;
|
on_before_context_menu := cef_context_menu_handler_on_before_context_menu;
|
||||||
run_context_menu := cef_context_menu_handler_run_context_menu;
|
run_context_menu := cef_context_menu_handler_run_context_menu;
|
||||||
on_context_menu_command := cef_context_menu_handler_on_context_menu_command;
|
on_context_menu_command := cef_context_menu_handler_on_context_menu_command;
|
||||||
on_context_menu_dismissed := cef_context_menu_handler_on_context_menu_dismissed;
|
on_context_menu_dismissed := cef_context_menu_handler_on_context_menu_dismissed;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefContextMenuHandlerOwn.OnBeforeContextMenu(
|
procedure TCefContextMenuHandlerOwn.OnBeforeContextMenu(const browser : ICefBrowser;
|
||||||
const browser: ICefBrowser; const frame: ICefFrame;
|
const frame : ICefFrame;
|
||||||
const params: ICefContextMenuParams; const model: ICefMenuModel);
|
const params : ICefContextMenuParams;
|
||||||
|
const model : ICefMenuModel);
|
||||||
begin
|
begin
|
||||||
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefContextMenuHandlerOwn.OnContextMenuCommand(
|
function TCefContextMenuHandlerOwn.OnContextMenuCommand(const browser : ICefBrowser;
|
||||||
const browser: ICefBrowser; const frame: ICefFrame;
|
const frame : ICefFrame;
|
||||||
const params: ICefContextMenuParams; commandId: Integer;
|
const params : ICefContextMenuParams;
|
||||||
eventFlags: TCefEventFlags): Boolean;
|
commandId : Integer;
|
||||||
|
eventFlags : TCefEventFlags): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefContextMenuHandlerOwn.OnContextMenuDismissed(
|
procedure TCefContextMenuHandlerOwn.OnContextMenuDismissed(const browser : ICefBrowser;
|
||||||
const browser: ICefBrowser; const frame: ICefFrame);
|
const frame : ICefFrame);
|
||||||
begin
|
begin
|
||||||
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefContextMenuHandlerOwn.RunContextMenu(const browser: ICefBrowser;
|
function TCefContextMenuHandlerOwn.RunContextMenu(const browser : ICefBrowser;
|
||||||
const frame: ICefFrame; const params: ICefContextMenuParams;
|
const frame : ICefFrame;
|
||||||
const model: ICefMenuModel;
|
const params : ICefContextMenuParams;
|
||||||
const callback: ICefRunContextMenuCallback): Boolean;
|
const model : ICefMenuModel;
|
||||||
|
const callback : ICefRunContextMenuCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefContextMenuHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomContextMenuHandler
|
// TCustomContextMenuHandler
|
||||||
|
|
||||||
constructor TCustomContextMenuHandler.Create(const events: IChromiumEvents);
|
constructor TCustomContextMenuHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomContextMenuHandler.Destroy;
|
destructor TCustomContextMenuHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomContextMenuHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomContextMenuHandler.OnBeforeContextMenu(const browser : ICefBrowser;
|
procedure TCustomContextMenuHandler.OnBeforeContextMenu(const browser : ICefBrowser;
|
||||||
const frame : ICefFrame;
|
const frame : ICefFrame;
|
||||||
const params : ICefContextMenuParams;
|
const params : ICefContextMenuParams;
|
||||||
const model : ICefMenuModel);
|
const model : ICefMenuModel);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnBeforeContextMenu(browser, frame, params, model);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnBeforeContextMenu(browser, frame, params, model);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomContextMenuHandler.RunContextMenu(const browser : ICefBrowser;
|
function TCustomContextMenuHandler.RunContextMenu(const browser : ICefBrowser;
|
||||||
@ -187,8 +210,8 @@ function TCustomContextMenuHandler.RunContextMenu(const browser : ICefBrowser;
|
|||||||
const model : ICefMenuModel;
|
const model : ICefMenuModel;
|
||||||
const callback : ICefRunContextMenuCallback): Boolean;
|
const callback : ICefRunContextMenuCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doRunContextMenu(browser, frame, params, model, callback)
|
Result := IChromiumEvents(FEvents).doRunContextMenu(browser, frame, params, model, callback)
|
||||||
else
|
else
|
||||||
Result := inherited RunContextMenu(browser, frame, params, model, callback);
|
Result := inherited RunContextMenu(browser, frame, params, model, callback);
|
||||||
end;
|
end;
|
||||||
@ -199,15 +222,16 @@ function TCustomContextMenuHandler.OnContextMenuCommand(const browser : ICefB
|
|||||||
commandId : Integer;
|
commandId : Integer;
|
||||||
eventFlags : TCefEventFlags): Boolean;
|
eventFlags : TCefEventFlags): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnContextMenuCommand(browser, frame, params, commandId, eventFlags)
|
Result := IChromiumEvents(FEvents).doOnContextMenuCommand(browser, frame, params, commandId, eventFlags)
|
||||||
else
|
else
|
||||||
Result := inherited OnContextMenuCommand(browser, frame, params, commandId, eventFlags);
|
Result := inherited OnContextMenuCommand(browser, frame, params, commandId, eventFlags);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomContextMenuHandler.OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame);
|
procedure TCustomContextMenuHandler.OnContextMenuDismissed(const browser : ICefBrowser;
|
||||||
|
const frame : ICefFrame);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnContextMenuDismissed(browser, frame);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnContextMenuDismissed(browser, frame);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -53,7 +53,6 @@ type
|
|||||||
TCefDeleteCookiesCallbackOwn = class(TCefBaseRefCountedOwn, ICefDeleteCookiesCallback)
|
TCefDeleteCookiesCallbackOwn = class(TCefBaseRefCountedOwn, ICefDeleteCookiesCallback)
|
||||||
protected
|
protected
|
||||||
procedure OnComplete(numDeleted: Integer); virtual; abstract;
|
procedure OnComplete(numDeleted: Integer); virtual; abstract;
|
||||||
procedure InitializeVars; virtual; abstract;
|
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -68,24 +67,27 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const callback: TCefDeleteCookiesCallbackProc); reintroduce;
|
constructor Create(const callback: TCefDeleteCookiesCallbackProc); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefCustomDeleteCookiesCallback = class(TCefDeleteCookiesCallbackOwn)
|
TCefCustomDeleteCookiesCallback = class(TCefDeleteCookiesCallbackOwn)
|
||||||
protected
|
protected
|
||||||
FChromiumBrowser : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnComplete(numDeleted: Integer); override;
|
procedure OnComplete(numDeleted: Integer); override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents); reintroduce;
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions;
|
uCEFMiscFunctions, uCEFLibFunctions;
|
||||||
|
|
||||||
procedure cef_delete_cookie_callback_on_complete(self: PCefDeleteCookiesCallback; num_deleted: Integer); stdcall;
|
procedure cef_delete_cookie_callback_on_complete(self: PCefDeleteCookiesCallback; num_deleted: Integer); stdcall;
|
||||||
@ -118,40 +120,39 @@ end;
|
|||||||
|
|
||||||
destructor TCefFastDeleteCookiesCallback.Destroy;
|
destructor TCefFastDeleteCookiesCallback.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
FCallback := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefFastDeleteCookiesCallback.InitializeVars;
|
|
||||||
begin
|
|
||||||
FCallback := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// TCefCustomDeleteCookiesCallback
|
// TCefCustomDeleteCookiesCallback
|
||||||
|
|
||||||
constructor TCefCustomDeleteCookiesCallback.Create(const aChromiumBrowser : IChromiumEvents);
|
constructor TCefCustomDeleteCookiesCallback.Create(const aEvents : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
FEvents := Pointer(aEvents);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefCustomDeleteCookiesCallback.Destroy;
|
destructor TCefCustomDeleteCookiesCallback.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
FEvents := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomDeleteCookiesCallback.InitializeVars;
|
|
||||||
begin
|
|
||||||
FChromiumBrowser := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefCustomDeleteCookiesCallback.OnComplete(numDeleted: Integer);
|
procedure TCefCustomDeleteCookiesCallback.OnComplete(numDeleted: Integer);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) then FChromiumBrowser.doCookiesDeleted(numDeleted);
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doCookiesDeleted(numDeleted);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefCustomDeleteCookiesCallback.OnComplete', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -57,7 +57,9 @@ uses
|
|||||||
type
|
type
|
||||||
TCefDialogHandlerOwn = class(TCefBaseRefCountedOwn, ICefDialogHandler)
|
TCefDialogHandlerOwn = class(TCefBaseRefCountedOwn, ICefDialogHandler)
|
||||||
protected
|
protected
|
||||||
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; virtual;
|
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -65,18 +67,25 @@ type
|
|||||||
|
|
||||||
TCustomDialogHandler = class(TCefDialogHandlerOwn)
|
TCustomDialogHandler = class(TCefDialogHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title: ustring; const defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; override;
|
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title: ustring; const defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFileDialogCallback;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFileDialogCallback;
|
||||||
|
|
||||||
function cef_dialog_handler_on_file_dialog(self: PCefDialogHandler; browser: PCefBrowser;
|
function cef_dialog_handler_on_file_dialog(self: PCefDialogHandler; browser: PCefBrowser;
|
||||||
@ -119,22 +128,32 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefDialogHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomDialogHandler
|
// TCustomDialogHandler
|
||||||
|
|
||||||
constructor TCustomDialogHandler.Create(const events: IChromiumEvents);
|
constructor TCustomDialogHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomDialogHandler.Destroy;
|
destructor TCustomDialogHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomDialogHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomDialogHandler.OnFileDialog(const browser : ICefBrowser;
|
function TCustomDialogHandler.OnFileDialog(const browser : ICefBrowser;
|
||||||
mode : TCefFileDialogMode;
|
mode : TCefFileDialogMode;
|
||||||
const title : ustring;
|
const title : ustring;
|
||||||
@ -143,10 +162,12 @@ function TCustomDialogHandler.OnFileDialog(const browser : ICefBrow
|
|||||||
selectedAcceptFilter : Integer;
|
selectedAcceptFilter : Integer;
|
||||||
const callback : ICefFileDialogCallback): Boolean;
|
const callback : ICefFileDialogCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback)
|
Result := IChromiumEvents(FEvents).doOnFileDialog(browser, mode, title, defaultFilePath,
|
||||||
|
acceptFilters, selectedAcceptFilter, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback);
|
Result := inherited OnFileDialog(browser, mode, title, defaultFilePath,
|
||||||
|
acceptFilters, selectedAcceptFilter, callback);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -63,16 +63,18 @@ type
|
|||||||
procedure OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); virtual;
|
procedure OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); virtual;
|
||||||
function OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; virtual;
|
function OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; virtual;
|
||||||
procedure OnStatusMessage(const browser: ICefBrowser; const value: ustring); virtual;
|
procedure OnStatusMessage(const browser: ICefBrowser; const value: ustring); virtual;
|
||||||
function OnConsoleMessage(const browser: ICefBrowser; const message, source: ustring; line: Integer): Boolean; virtual;
|
function OnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer): Boolean; virtual;
|
||||||
function OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; virtual;
|
function OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomDisplayHandler = class(TCefDisplayHandlerOwn)
|
TCustomDisplayHandler = class(TCefDisplayHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnAddressChange(const browser: ICefBrowser; const frame: ICefFrame; const url: ustring); override;
|
procedure OnAddressChange(const browser: ICefBrowser; const frame: ICefFrame; const url: ustring); override;
|
||||||
procedure OnTitleChange(const browser: ICefBrowser; const title: ustring); override;
|
procedure OnTitleChange(const browser: ICefBrowser; const title: ustring); override;
|
||||||
@ -80,22 +82,31 @@ type
|
|||||||
procedure OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); override;
|
procedure OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); override;
|
||||||
function OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; override;
|
function OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; override;
|
||||||
procedure OnStatusMessage(const browser: ICefBrowser; const value: ustring); override;
|
procedure OnStatusMessage(const browser: ICefBrowser; const value: ustring); override;
|
||||||
function OnConsoleMessage(const browser: ICefBrowser; const message, source: ustring; line: Integer): Boolean; override;
|
function OnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer): Boolean; override;
|
||||||
function OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; override;
|
function OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame;
|
||||||
|
|
||||||
|
|
||||||
procedure cef_display_handler_on_address_change(self: PCefDisplayHandler;
|
procedure cef_display_handler_on_address_change(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; frame: PCefFrame; const url: PCefString); stdcall;
|
browser: PCefBrowser;
|
||||||
|
frame: PCefFrame;
|
||||||
|
const url: PCefString); stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
||||||
OnAddressChange(
|
OnAddressChange(
|
||||||
@ -105,14 +116,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cef_display_handler_on_title_change(self: PCefDisplayHandler;
|
procedure cef_display_handler_on_title_change(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; const title: PCefString); stdcall;
|
browser: PCefBrowser;
|
||||||
|
const title: PCefString); stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
||||||
OnTitleChange(TCefBrowserRef.UnWrap(browser), CefString(title));
|
OnTitleChange(TCefBrowserRef.UnWrap(browser), CefString(title));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cef_display_handler_on_favicon_urlchange(self: PCefDisplayHandler;
|
procedure cef_display_handler_on_favicon_urlchange(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; icon_urls: TCefStringList); stdcall;
|
browser: PCefBrowser;
|
||||||
|
icon_urls: TCefStringList); stdcall;
|
||||||
var
|
var
|
||||||
list: TStringList;
|
list: TStringList;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -134,14 +147,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cef_display_handler_on_fullscreen_mode_change(self: PCefDisplayHandler;
|
procedure cef_display_handler_on_fullscreen_mode_change(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; fullscreen: Integer); stdcall;
|
browser: PCefBrowser;
|
||||||
|
fullscreen: Integer); stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
||||||
OnFullScreenModeChange(TCefBrowserRef.UnWrap(browser), fullscreen <> 0);
|
OnFullScreenModeChange(TCefBrowserRef.UnWrap(browser), fullscreen <> 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_display_handler_on_tooltip(self: PCefDisplayHandler;
|
function cef_display_handler_on_tooltip(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; text: PCefString): Integer; stdcall;
|
browser: PCefBrowser;
|
||||||
|
text: PCefString): Integer; stdcall;
|
||||||
var
|
var
|
||||||
t: ustring;
|
t: ustring;
|
||||||
begin
|
begin
|
||||||
@ -153,22 +168,27 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cef_display_handler_on_status_message(self: PCefDisplayHandler;
|
procedure cef_display_handler_on_status_message(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; const value: PCefString); stdcall;
|
browser: PCefBrowser;
|
||||||
|
const value: PCefString); stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
||||||
OnStatusMessage(TCefBrowserRef.UnWrap(browser), CefString(value));
|
OnStatusMessage(TCefBrowserRef.UnWrap(browser), CefString(value));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_display_handler_on_console_message(self: PCefDisplayHandler;
|
function cef_display_handler_on_console_message(self: PCefDisplayHandler;
|
||||||
browser: PCefBrowser; const message: PCefString;
|
browser: PCefBrowser;
|
||||||
const source: PCefString; line: Integer): Integer; stdcall;
|
level: TCefLogSeverity;
|
||||||
|
const message: PCefString;
|
||||||
|
const source: PCefString;
|
||||||
|
line: Integer): Integer; stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
with TCefDisplayHandlerOwn(CefGetObject(self)) do
|
||||||
Result := Ord(OnConsoleMessage(TCefBrowserRef.UnWrap(browser),
|
Result := Ord(OnConsoleMessage(TCefBrowserRef.UnWrap(browser), level, CefString(message), CefString(source), line));
|
||||||
CefString(message), CefString(source), line));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_display_handler_on_auto_resize(self: PCefDisplayHandler; browser: PCefBrowser; const new_size: PCefSize): Integer; stdcall;
|
function cef_display_handler_on_auto_resize(self: PCefDisplayHandler;
|
||||||
|
browser: PCefBrowser;
|
||||||
|
const new_size: PCefSize): Integer; stdcall;
|
||||||
begin
|
begin
|
||||||
Result := Ord(TCefDisplayHandlerOwn(CefGetObject(self)).OnAutoResize(TCefBrowserRef.UnWrap(browser), new_size));
|
Result := Ord(TCefDisplayHandlerOwn(CefGetObject(self)).OnAutoResize(TCefBrowserRef.UnWrap(browser), new_size));
|
||||||
end;
|
end;
|
||||||
@ -196,7 +216,7 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefDisplayHandlerOwn.OnConsoleMessage(const browser: ICefBrowser; const message, source: ustring; line: Integer): Boolean;
|
function TCefDisplayHandlerOwn.OnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
@ -232,72 +252,83 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefDisplayHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomDisplayHandler
|
// TCustomDisplayHandler
|
||||||
|
|
||||||
constructor TCustomDisplayHandler.Create(const events: IChromiumEvents);
|
constructor TCustomDisplayHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomDisplayHandler.Destroy;
|
destructor TCustomDisplayHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomDisplayHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomDisplayHandler.OnAddressChange(const browser : ICefBrowser;
|
procedure TCustomDisplayHandler.OnAddressChange(const browser : ICefBrowser;
|
||||||
const frame : ICefFrame;
|
const frame : ICefFrame;
|
||||||
const url : ustring);
|
const url : ustring);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnAddressChange(browser, frame, url);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnAddressChange(browser, frame, url);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomDisplayHandler.OnConsoleMessage(const browser : ICefBrowser;
|
function TCustomDisplayHandler.OnConsoleMessage(const browser : ICefBrowser;
|
||||||
|
level : TCefLogSeverity;
|
||||||
const message : ustring;
|
const message : ustring;
|
||||||
const source : ustring;
|
const source : ustring;
|
||||||
line : Integer): Boolean;
|
line : Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnConsoleMessage(browser, message, source, line)
|
Result := IChromiumEvents(FEvents).doOnConsoleMessage(browser, level, message, source, line)
|
||||||
else
|
else
|
||||||
Result := inherited OnConsoleMessage(browser, message, source, line);
|
Result := inherited OnConsoleMessage(browser, level, message, source, line);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomDisplayHandler.OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean;
|
function TCustomDisplayHandler.OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnAutoResize(browser, new_size)
|
Result := IChromiumEvents(FEvents).doOnAutoResize(browser, new_size)
|
||||||
else
|
else
|
||||||
Result := inherited OnAutoResize(browser, new_size);
|
Result := inherited OnAutoResize(browser, new_size);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDisplayHandler.OnFaviconUrlChange(const browser: ICefBrowser; iconUrls: TStrings);
|
procedure TCustomDisplayHandler.OnFaviconUrlChange(const browser: ICefBrowser; iconUrls: TStrings);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnFaviconUrlChange(browser, iconUrls);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnFaviconUrlChange(browser, iconUrls);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDisplayHandler.OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
procedure TCustomDisplayHandler.OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnFullScreenModeChange(browser, fullscreen);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnFullScreenModeChange(browser, fullscreen);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDisplayHandler.OnStatusMessage(const browser: ICefBrowser; const value: ustring);
|
procedure TCustomDisplayHandler.OnStatusMessage(const browser: ICefBrowser; const value: ustring);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnStatusMessage(browser, value);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnStatusMessage(browser, value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDisplayHandler.OnTitleChange(const browser: ICefBrowser; const title: ustring);
|
procedure TCustomDisplayHandler.OnTitleChange(const browser: ICefBrowser; const title: ustring);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnTitleChange(browser, title);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnTitleChange(browser, title);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomDisplayHandler.OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean;
|
function TCustomDisplayHandler.OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnTooltip(browser, text)
|
Result := IChromiumEvents(FEvents).doOnTooltip(browser, text)
|
||||||
else
|
else
|
||||||
Result := inherited OnTooltip(browser, text);
|
Result := inherited OnTooltip(browser, text);
|
||||||
end;
|
end;
|
||||||
|
@ -55,19 +55,23 @@ type
|
|||||||
procedure OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); virtual;
|
procedure OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); virtual;
|
||||||
procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); virtual;
|
procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomDownloadHandler = class(TCefDownloadHandlerOwn)
|
TCustomDownloadHandler = class(TCefDownloadHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); override;
|
procedure OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); override;
|
||||||
procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); override;
|
procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -99,11 +103,12 @@ end;
|
|||||||
constructor TCefDownloadHandlerOwn.Create;
|
constructor TCefDownloadHandlerOwn.Create;
|
||||||
begin
|
begin
|
||||||
inherited CreateData(SizeOf(TCefDownloadHandler));
|
inherited CreateData(SizeOf(TCefDownloadHandler));
|
||||||
|
|
||||||
with PCefDownloadHandler(FData)^ do
|
with PCefDownloadHandler(FData)^ do
|
||||||
begin
|
begin
|
||||||
on_before_download := cef_download_handler_on_before_download;
|
on_before_download := cef_download_handler_on_before_download;
|
||||||
on_download_updated := cef_download_handler_on_download_updated;
|
on_download_updated := cef_download_handler_on_download_updated;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefDownloadHandlerOwn.OnBeforeDownload(const browser: ICefBrowser;
|
procedure TCefDownloadHandlerOwn.OnBeforeDownload(const browser: ICefBrowser;
|
||||||
@ -120,36 +125,45 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefDownloadHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomDownloadHandler
|
// TCustomDownloadHandler
|
||||||
|
|
||||||
constructor TCustomDownloadHandler.Create(const events: IChromiumEvents);
|
constructor TCustomDownloadHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomDownloadHandler.Destroy;
|
destructor TCustomDownloadHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDownloadHandler.OnBeforeDownload(const browser: ICefBrowser;
|
procedure TCustomDownloadHandler.RemoveReferences;
|
||||||
const downloadItem: ICefDownloadItem; const suggestedName: ustring;
|
|
||||||
const callback: ICefBeforeDownloadCallback);
|
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
FEvents := nil;
|
||||||
FEvent.doOnBeforeDownload(browser, downloadItem, suggestedName, callback);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDownloadHandler.OnDownloadUpdated(const browser: ICefBrowser;
|
procedure TCustomDownloadHandler.OnBeforeDownload(const browser : ICefBrowser;
|
||||||
const downloadItem: ICefDownloadItem;
|
const downloadItem : ICefDownloadItem;
|
||||||
const callback: ICefDownloadItemCallback);
|
const suggestedName : ustring;
|
||||||
|
const callback : ICefBeforeDownloadCallback);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnBeforeDownload(browser, downloadItem, suggestedName, callback);
|
||||||
FEvent.doOnDownloadUpdated(browser, downloadItem, callback);
|
end;
|
||||||
|
|
||||||
|
procedure TCustomDownloadHandler.OnDownloadUpdated(const browser : ICefBrowser;
|
||||||
|
const downloadItem : ICefDownloadItem;
|
||||||
|
const callback : ICefDownloadItemCallback);
|
||||||
|
begin
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnDownloadUpdated(browser, downloadItem, callback);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -52,28 +52,37 @@ uses
|
|||||||
type
|
type
|
||||||
TCefDragHandlerOwn = class(TCefBaseRefCountedOwn, ICefDragHandler)
|
TCefDragHandlerOwn = class(TCefBaseRefCountedOwn, ICefDragHandler)
|
||||||
protected
|
protected
|
||||||
function OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean; virtual;
|
function OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean; virtual;
|
||||||
procedure OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray); virtual;
|
procedure OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomDragHandler = class(TCefDragHandlerOwn)
|
TCustomDragHandler = class(TCefDragHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean; override;
|
function OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean; override;
|
||||||
procedure OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray); override;
|
procedure OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDragData;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDragData;
|
||||||
|
|
||||||
function cef_drag_handler_on_drag_enter(self: PCefDragHandler; browser: PCefBrowser;
|
function cef_drag_handler_on_drag_enter(self: PCefDragHandler; browser: PCefBrowser;
|
||||||
@ -113,34 +122,47 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefDragHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomDragHandler
|
// TCustomDragHandler
|
||||||
|
|
||||||
constructor TCustomDragHandler.Create(const events: IChromiumEvents);
|
constructor TCustomDragHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomDragHandler.Destroy;
|
destructor TCustomDragHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomDragHandler.OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean;
|
procedure TCustomDragHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
FEvents := nil;
|
||||||
Result := FEvent.doOnDragEnter(browser, dragData, mask)
|
end;
|
||||||
|
|
||||||
|
function TCustomDragHandler.OnDragEnter(const browser : ICefBrowser;
|
||||||
|
const dragData : ICefDragData;
|
||||||
|
mask : TCefDragOperations): Boolean;
|
||||||
|
begin
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
Result := IChromiumEvents(FEvents).doOnDragEnter(browser, dragData, mask)
|
||||||
else
|
else
|
||||||
Result := inherited OnDragEnter(browser, dragData, mask);
|
Result := inherited OnDragEnter(browser, dragData, mask);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDragHandler.OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray);
|
procedure TCustomDragHandler.OnDraggableRegionsChanged(const browser : ICefBrowser;
|
||||||
|
regionsCount : NativeUInt;
|
||||||
|
regions : PCefDraggableRegionArray);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnDraggableRegionsChanged(browser, regionsCount, regions);
|
||||||
FEvent.doOnDraggableRegionsChanged(browser, regionsCount, regions);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -54,24 +54,33 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean); virtual; abstract;
|
procedure OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean); virtual; abstract;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomFindHandler = class(TCefFindHandlerOwn)
|
TCustomFindHandler = class(TCefFindHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean); override;
|
procedure OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
||||||
|
|
||||||
procedure cef_find_handler_on_find_result(self: PCefFindHandler; browser: PCefBrowser; identifier, count: Integer; const selection_rect: PCefRect; active_match_ordinal, final_update: Integer); stdcall;
|
procedure cef_find_handler_on_find_result(self: PCefFindHandler; browser: PCefBrowser; identifier, count: Integer; const selection_rect: PCefRect; active_match_ordinal, final_update: Integer); stdcall;
|
||||||
@ -87,26 +96,40 @@ begin
|
|||||||
with PCefFindHandler(FData)^ do on_find_result := cef_find_handler_on_find_result;
|
with PCefFindHandler(FData)^ do on_find_result := cef_find_handler_on_find_result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefFindHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomFindHandler
|
// TCustomFindHandler
|
||||||
|
|
||||||
constructor TCustomFindHandler.Create(const events: IChromiumEvents);
|
constructor TCustomFindHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomFindHandler.Destroy;
|
destructor TCustomFindHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomFindHandler.OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean);
|
procedure TCustomFindHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
FEvents := nil;
|
||||||
FEvent.doOnFindResult(browser, identifier, count, selectionRect, activeMatchOrdinal, finalUpdate);
|
end;
|
||||||
|
|
||||||
|
procedure TCustomFindHandler.OnFindResult(const browser : ICefBrowser;
|
||||||
|
identifier : Integer;
|
||||||
|
count : Integer;
|
||||||
|
const selectionRect : PCefRect;
|
||||||
|
activeMatchOrdinal : Integer;
|
||||||
|
finalUpdate : Boolean);
|
||||||
|
begin
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnFindResult(browser, identifier, count, selectionRect, activeMatchOrdinal, finalUpdate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -53,29 +53,38 @@ type
|
|||||||
TCefFocusHandlerOwn = class(TCefBaseRefCountedOwn, ICefFocusHandler)
|
TCefFocusHandlerOwn = class(TCefBaseRefCountedOwn, ICefFocusHandler)
|
||||||
protected
|
protected
|
||||||
procedure OnTakeFocus(const browser: ICefBrowser; next: Boolean); virtual;
|
procedure OnTakeFocus(const browser: ICefBrowser; next: Boolean); virtual;
|
||||||
function OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean; virtual;
|
function OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean; virtual;
|
||||||
procedure OnGotFocus(const browser: ICefBrowser); virtual;
|
procedure OnGotFocus(const browser: ICefBrowser); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomFocusHandler = class(TCefFocusHandlerOwn)
|
TCustomFocusHandler = class(TCefFocusHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnTakeFocus(const browser: ICefBrowser; next: Boolean); override;
|
procedure OnTakeFocus(const browser: ICefBrowser; next: Boolean); override;
|
||||||
function OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean; override;
|
function OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean; override;
|
||||||
procedure OnGotFocus(const browser: ICefBrowser); override;
|
procedure OnGotFocus(const browser: ICefBrowser); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events : Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
||||||
|
|
||||||
procedure cef_focus_handler_on_take_focus(self: PCefFocusHandler; browser: PCefBrowser; next: Integer); stdcall;
|
procedure cef_focus_handler_on_take_focus(self: PCefFocusHandler; browser: PCefBrowser; next: Integer); stdcall;
|
||||||
@ -99,12 +108,13 @@ end;
|
|||||||
constructor TCefFocusHandlerOwn.Create;
|
constructor TCefFocusHandlerOwn.Create;
|
||||||
begin
|
begin
|
||||||
inherited CreateData(SizeOf(TCefFocusHandler));
|
inherited CreateData(SizeOf(TCefFocusHandler));
|
||||||
|
|
||||||
with PCefFocusHandler(FData)^ do
|
with PCefFocusHandler(FData)^ do
|
||||||
begin
|
begin
|
||||||
on_take_focus := cef_focus_handler_on_take_focus;
|
on_take_focus := cef_focus_handler_on_take_focus;
|
||||||
on_set_focus := cef_focus_handler_on_set_focus;
|
on_set_focus := cef_focus_handler_on_set_focus;
|
||||||
on_got_focus := cef_focus_handler_on_got_focus;
|
on_got_focus := cef_focus_handler_on_got_focus;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFocusHandlerOwn.OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean;
|
function TCefFocusHandlerOwn.OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean;
|
||||||
@ -122,41 +132,49 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefFocusHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomFocusHandler
|
// TCustomFocusHandler
|
||||||
|
|
||||||
constructor TCustomFocusHandler.Create(const events: IChromiumEvents);
|
constructor TCustomFocusHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomFocusHandler.Destroy;
|
destructor TCustomFocusHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomFocusHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomFocusHandler.OnGotFocus(const browser: ICefBrowser);
|
procedure TCustomFocusHandler.OnGotFocus(const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnGotFocus(browser);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnGotFocus(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomFocusHandler.OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean;
|
function TCustomFocusHandler.OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnSetFocus(browser, source)
|
Result := IChromiumEvents(FEvents).doOnSetFocus(browser, source)
|
||||||
else
|
else
|
||||||
Result := inherited OnSetFocus(browser, source);
|
Result := inherited OnSetFocus(browser, source);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomFocusHandler.OnTakeFocus(const browser: ICefBrowser; next: Boolean);
|
procedure TCustomFocusHandler.OnTakeFocus(const browser: ICefBrowser; next: Boolean);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnTakeFocus(browser, next);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnTakeFocus(browser, next);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -52,28 +52,37 @@ uses
|
|||||||
type
|
type
|
||||||
TCefGeolocationHandlerOwn = class(TCefBaseRefCountedOwn, ICefGeolocationHandler)
|
TCefGeolocationHandlerOwn = class(TCefBaseRefCountedOwn, ICefGeolocationHandler)
|
||||||
protected
|
protected
|
||||||
function OnRequestGeolocationPermission(const browser: ICefBrowser; const requestingUrl: ustring; requestId: Integer; const callback: ICefGeolocationCallback): Boolean; virtual;
|
function OnRequestGeolocationPermission(const browser: ICefBrowser; const requestingUrl: ustring; requestId: Integer; const callback: ICefGeolocationCallback): Boolean; virtual;
|
||||||
procedure OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer); virtual;
|
procedure OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomGeolocationHandler = class(TCefGeolocationHandlerOwn)
|
TCustomGeolocationHandler = class(TCefGeolocationHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnRequestGeolocationPermission(const browser: ICefBrowser; const requestingUrl: ustring; requestId: Integer; const callback: ICefGeolocationCallback): Boolean; override;
|
function OnRequestGeolocationPermission(const browser: ICefBrowser; const requestingUrl: ustring; requestId: Integer; const callback: ICefGeolocationCallback): Boolean; override;
|
||||||
procedure OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer); override;
|
procedure OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFGeolocationCallback;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFGeolocationCallback;
|
||||||
|
|
||||||
function cef_geolocation_handler_on_request_geolocation_permission(self: PCefGeolocationHandler;
|
function cef_geolocation_handler_on_request_geolocation_permission(self: PCefGeolocationHandler;
|
||||||
@ -118,26 +127,35 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefGeolocationHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomGeolocationHandler
|
// TCustomGeolocationHandler
|
||||||
|
|
||||||
constructor TCustomGeolocationHandler.Create(const events: IChromiumEvents);
|
constructor TCustomGeolocationHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomGeolocationHandler.Destroy;
|
destructor TCustomGeolocationHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomGeolocationHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomGeolocationHandler.OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer);
|
procedure TCustomGeolocationHandler.OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnCancelGeolocationPermission(browser, requestId);
|
||||||
FEvent.doOnCancelGeolocationPermission(browser, requestId);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomGeolocationHandler.OnRequestGeolocationPermission(const browser : ICefBrowser;
|
function TCustomGeolocationHandler.OnRequestGeolocationPermission(const browser : ICefBrowser;
|
||||||
@ -145,8 +163,8 @@ function TCustomGeolocationHandler.OnRequestGeolocationPermission(const browser
|
|||||||
requestId : Integer;
|
requestId : Integer;
|
||||||
const callback : ICefGeolocationCallback): Boolean;
|
const callback : ICefGeolocationCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnRequestGeolocationPermission(browser, requestingUrl, requestId, callback)
|
Result := IChromiumEvents(FEvents).doOnRequestGeolocationPermission(browser, requestingUrl, requestId, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnRequestGeolocationPermission(browser, requestingUrl, requestId, callback);
|
Result := inherited OnRequestGeolocationPermission(browser, requestingUrl, requestId, callback);
|
||||||
end;
|
end;
|
||||||
|
@ -166,7 +166,6 @@ type
|
|||||||
ICefPdfPrintCallback = interface(ICefBaseRefCounted)
|
ICefPdfPrintCallback = interface(ICefBaseRefCounted)
|
||||||
['{F1CC58E9-2C30-4932-91AE-467C8D8EFB8E}']
|
['{F1CC58E9-2C30-4932-91AE-467C8D8EFB8E}']
|
||||||
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean);
|
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean);
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TOnDownloadImageFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
|
TOnDownloadImageFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
|
||||||
@ -384,7 +383,6 @@ type
|
|||||||
ICefStringVisitor = interface(ICefBaseRefCounted)
|
ICefStringVisitor = interface(ICefBaseRefCounted)
|
||||||
['{63ED4D6C-2FC8-4537-964B-B84C008F6158}']
|
['{63ED4D6C-2FC8-4537-964B-B84C008F6158}']
|
||||||
procedure Visit(const str: ustring);
|
procedure Visit(const str: ustring);
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefFrame = interface(ICefBaseRefCounted)
|
ICefFrame = interface(ICefBaseRefCounted)
|
||||||
@ -530,6 +528,8 @@ type
|
|||||||
['{3137F90A-5DC5-43C1-858D-A269F28EF4F1}']
|
['{3137F90A-5DC5-43C1-858D-A269F28EF4F1}']
|
||||||
procedure OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback);
|
procedure OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback);
|
||||||
procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback);
|
procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefV8Exception = interface(ICefBaseRefCounted)
|
ICefV8Exception = interface(ICefBaseRefCounted)
|
||||||
@ -862,7 +862,7 @@ type
|
|||||||
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
||||||
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
||||||
|
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefBrowserProcessHandler = interface(ICefBaseRefCounted)
|
ICefBrowserProcessHandler = interface(ICefBaseRefCounted)
|
||||||
@ -873,7 +873,7 @@ type
|
|||||||
function GetPrintHandler : ICefPrintHandler;
|
function GetPrintHandler : ICefPrintHandler;
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64);
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64);
|
||||||
|
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRenderProcessHandler = interface(ICefBaseRefCounted)
|
ICefRenderProcessHandler = interface(ICefBaseRefCounted)
|
||||||
@ -890,7 +890,7 @@ type
|
|||||||
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode);
|
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode);
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean;
|
||||||
|
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefApp = interface(ICefBaseRefCounted)
|
ICefApp = interface(ICefBaseRefCounted)
|
||||||
@ -920,7 +920,6 @@ type
|
|||||||
ICefDeleteCookiesCallback = interface(ICefBaseRefCounted)
|
ICefDeleteCookiesCallback = interface(ICefBaseRefCounted)
|
||||||
['{758B79A1-B9E8-4F0D-94A0-DCE5AFADE33D}']
|
['{758B79A1-B9E8-4F0D-94A0-DCE5AFADE33D}']
|
||||||
procedure OnComplete(numDeleted: Integer);
|
procedure OnComplete(numDeleted: Integer);
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefCookieManager = Interface(ICefBaseRefCounted)
|
ICefCookieManager = Interface(ICefBaseRefCounted)
|
||||||
@ -1208,6 +1207,8 @@ type
|
|||||||
procedure OnAfterCreated(const browser: ICefBrowser);
|
procedure OnAfterCreated(const browser: ICefBrowser);
|
||||||
procedure OnBeforeClose(const browser: ICefBrowser);
|
procedure OnBeforeClose(const browser: ICefBrowser);
|
||||||
function DoClose(const browser: ICefBrowser): Boolean;
|
function DoClose(const browser: ICefBrowser): Boolean;
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1253,6 +1254,8 @@ type
|
|||||||
procedure OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType);
|
procedure OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType);
|
||||||
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
||||||
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
|
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRequestCallback = interface(ICefBaseRefCounted)
|
ICefRequestCallback = interface(ICefBaseRefCounted)
|
||||||
@ -1264,7 +1267,7 @@ type
|
|||||||
ICefResponseFilter = interface(ICefBaseRefCounted)
|
ICefResponseFilter = interface(ICefBaseRefCounted)
|
||||||
['{5013BC3C-F1AE-407A-A571-A4C6B1D6831E}']
|
['{5013BC3C-F1AE-407A-A571-A4C6B1D6831E}']
|
||||||
function InitFilter: Boolean;
|
function InitFilter: Boolean;
|
||||||
function Filter(dataIn: Pointer; dataInSize : NativeUInt; dataInRead: PNativeUInt; dataOut: Pointer; dataOutSize : NativeUInt; dataOutWritten: PNativeUInt): TCefResponseFilterStatus;
|
function Filter(data_in: Pointer; data_in_size: NativeUInt; var data_in_read: NativeUInt; data_out: Pointer; data_out_size : NativeUInt; var data_out_written: NativeUInt): TCefResponseFilterStatus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRequestHandler = interface(ICefBaseRefCounted)
|
ICefRequestHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1285,6 +1288,8 @@ type
|
|||||||
procedure OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring);
|
procedure OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring);
|
||||||
procedure OnRenderViewReady(const browser: ICefBrowser);
|
procedure OnRenderViewReady(const browser: ICefBrowser);
|
||||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefDisplayHandler = interface(ICefBaseRefCounted)
|
ICefDisplayHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1295,8 +1300,10 @@ type
|
|||||||
procedure OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
procedure OnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
||||||
function OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean;
|
function OnTooltip(const browser: ICefBrowser; var text: ustring): Boolean;
|
||||||
procedure OnStatusMessage(const browser: ICefBrowser; const value: ustring);
|
procedure OnStatusMessage(const browser: ICefBrowser; const value: ustring);
|
||||||
function OnConsoleMessage(const browser: ICefBrowser; const message, source: ustring; line: Integer): Boolean;
|
function OnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer): Boolean;
|
||||||
function OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean;
|
function OnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean;
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefFocusHandler = interface(ICefBaseRefCounted)
|
ICefFocusHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1304,12 +1311,16 @@ type
|
|||||||
procedure OnTakeFocus(const browser: ICefBrowser; next: Boolean);
|
procedure OnTakeFocus(const browser: ICefBrowser; next: Boolean);
|
||||||
function OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean;
|
function OnSetFocus(const browser: ICefBrowser; source: TCefFocusSource): Boolean;
|
||||||
procedure OnGotFocus(const browser: ICefBrowser);
|
procedure OnGotFocus(const browser: ICefBrowser);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefKeyboardHandler = interface(ICefBaseRefCounted)
|
ICefKeyboardHandler = interface(ICefBaseRefCounted)
|
||||||
['{0512F4EC-ED88-44C9-90D3-5C6D03D3B146}']
|
['{0512F4EC-ED88-44C9-90D3-5C6D03D3B146}']
|
||||||
function OnPreKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean): Boolean;
|
function OnPreKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean): Boolean;
|
||||||
function OnKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle): Boolean;
|
function OnKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle): Boolean;
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefJsDialogHandler = interface(ICefBaseRefCounted)
|
ICefJsDialogHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1318,6 +1329,8 @@ type
|
|||||||
function OnBeforeUnloadDialog(const browser: ICefBrowser; const messageText: ustring; isReload: Boolean; const callback: ICefJsDialogCallback): Boolean;
|
function OnBeforeUnloadDialog(const browser: ICefBrowser; const messageText: ustring; isReload: Boolean; const callback: ICefJsDialogCallback): Boolean;
|
||||||
procedure OnResetDialogState(const browser: ICefBrowser);
|
procedure OnResetDialogState(const browser: ICefBrowser);
|
||||||
procedure OnDialogClosed(const browser: ICefBrowser);
|
procedure OnDialogClosed(const browser: ICefBrowser);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRunContextMenuCallback = interface(ICefBaseRefCounted)
|
ICefRunContextMenuCallback = interface(ICefBaseRefCounted)
|
||||||
@ -1332,6 +1345,8 @@ type
|
|||||||
function RunContextMenu(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel; const callback: ICefRunContextMenuCallback): Boolean;
|
function RunContextMenu(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel; const callback: ICefRunContextMenuCallback): Boolean;
|
||||||
function OnContextMenuCommand(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags): Boolean;
|
function OnContextMenuCommand(const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags): Boolean;
|
||||||
procedure OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame);
|
procedure OnContextMenuDismissed(const browser: ICefBrowser; const frame: ICefFrame);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefAccessibilityHandler = interface(ICefBaseRefCounted)
|
ICefAccessibilityHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1343,6 +1358,8 @@ type
|
|||||||
ICefDialogHandler = interface(ICefBaseRefCounted)
|
ICefDialogHandler = interface(ICefBaseRefCounted)
|
||||||
['{7763F4B2-8BE1-4E80-AC43-8B825850DC67}']
|
['{7763F4B2-8BE1-4E80-AC43-8B825850DC67}']
|
||||||
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean;
|
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean;
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefGeolocationCallback = interface(ICefBaseRefCounted)
|
ICefGeolocationCallback = interface(ICefBaseRefCounted)
|
||||||
@ -1354,6 +1371,8 @@ type
|
|||||||
['{1178EE62-BAE7-4E44-932B-EAAC7A18191C}']
|
['{1178EE62-BAE7-4E44-932B-EAAC7A18191C}']
|
||||||
function OnRequestGeolocationPermission(const browser: ICefBrowser; const requestingUrl: ustring; requestId: Integer; const callback: ICefGeolocationCallback): Boolean;
|
function OnRequestGeolocationPermission(const browser: ICefBrowser; const requestingUrl: ustring; requestId: Integer; const callback: ICefGeolocationCallback): Boolean;
|
||||||
procedure OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer);
|
procedure OnCancelGeolocationPermission(const browser: ICefBrowser; requestId: Integer);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRenderHandler = interface(ICefBaseRefCounted)
|
ICefRenderHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1371,6 +1390,8 @@ type
|
|||||||
procedure OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation);
|
procedure OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation);
|
||||||
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double);
|
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double);
|
||||||
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect);
|
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefClient = interface(ICefBaseRefCounted)
|
ICefClient = interface(ICefBaseRefCounted)
|
||||||
@ -1388,7 +1409,7 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler;
|
function GetRequestHandler: ICefRequestHandler;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean;
|
||||||
|
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefUrlRequest = interface(ICefBaseRefCounted)
|
ICefUrlRequest = interface(ICefBaseRefCounted)
|
||||||
@ -1481,11 +1502,15 @@ type
|
|||||||
['{59A89579-5B18-489F-A25C-5CC25FF831FC}']
|
['{59A89579-5B18-489F-A25C-5CC25FF831FC}']
|
||||||
function OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean;
|
function OnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean;
|
||||||
procedure OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray);
|
procedure OnDraggableRegionsChanged(const browser: ICefBrowser; regionsCount: NativeUInt; regions: PCefDraggableRegionArray);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefFindHandler = interface(ICefBaseRefCounted)
|
ICefFindHandler = interface(ICefBaseRefCounted)
|
||||||
['{F20DF234-BD43-42B3-A80B-D354A9E5B787}']
|
['{F20DF234-BD43-42B3-A80B-D354A9E5B787}']
|
||||||
procedure OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean);
|
procedure OnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean);
|
||||||
|
|
||||||
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRequestContextHandler = interface(ICefBaseRefCounted)
|
ICefRequestContextHandler = interface(ICefBaseRefCounted)
|
||||||
@ -1499,7 +1524,6 @@ type
|
|||||||
ICefResolveCallback = interface(ICefBaseRefCounted)
|
ICefResolveCallback = interface(ICefBaseRefCounted)
|
||||||
['{0C0EA252-7968-4163-A1BE-A1453576DD06}']
|
['{0C0EA252-7968-4163-A1BE-A1453576DD06}']
|
||||||
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
||||||
procedure InitializeVars; // custom procedure to clear all references
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRequestContext = interface(ICefBaseRefCounted)
|
ICefRequestContext = interface(ICefBaseRefCounted)
|
||||||
@ -1744,7 +1768,7 @@ type
|
|||||||
procedure doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
procedure doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
||||||
function doOnTooltip(const browser: ICefBrowser; var text: ustring): Boolean;
|
function doOnTooltip(const browser: ICefBrowser; var text: ustring): Boolean;
|
||||||
procedure doOnStatusMessage(const browser: ICefBrowser; const value: ustring);
|
procedure doOnStatusMessage(const browser: ICefBrowser; const value: ustring);
|
||||||
function doOnConsoleMessage(const browser: ICefBrowser; const message, source: ustring; line: Integer): Boolean;
|
function doOnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer): Boolean;
|
||||||
function doOnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean;
|
function doOnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean;
|
||||||
|
|
||||||
// ICefDownloadHandler
|
// ICefDownloadHandler
|
||||||
@ -1812,12 +1836,6 @@ type
|
|||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
procedure doCookiesDeleted(numDeleted : integer);
|
procedure doCookiesDeleted(numDeleted : integer);
|
||||||
procedure doGetHTML(const aFrameName : ustring); overload;
|
|
||||||
procedure doGetHTML(const aFrame : ICefFrame); overload;
|
|
||||||
procedure doGetHTML(const aFrameIdentifier : int64); overload;
|
|
||||||
procedure doGetText(const aFrameName : ustring); overload;
|
|
||||||
procedure doGetText(const aFrame : ICefFrame); overload;
|
|
||||||
procedure doGetText(const aFrameIdentifier : int64); overload;
|
|
||||||
procedure doPdfPrintFinished(aResultOK : boolean);
|
procedure doPdfPrintFinished(aResultOK : boolean);
|
||||||
procedure doTextResultAvailable(const aText : string);
|
procedure doTextResultAvailable(const aText : string);
|
||||||
procedure doUpdatePreferences;
|
procedure doUpdatePreferences;
|
||||||
|
@ -57,27 +57,36 @@ type
|
|||||||
procedure OnResetDialogState(const browser: ICefBrowser); virtual;
|
procedure OnResetDialogState(const browser: ICefBrowser); virtual;
|
||||||
procedure OnDialogClosed(const browser: ICefBrowser); virtual;
|
procedure OnDialogClosed(const browser: ICefBrowser); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomJsDialogHandler = class(TCefJsDialogHandlerOwn)
|
TCustomJsDialogHandler = class(TCefJsDialogHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnJsdialog(const browser: ICefBrowser; const originUrl: ustring; dialogType: TCefJsDialogType; const messageText, defaultPromptText: ustring; const callback: ICefJsDialogCallback; out suppressMessage: Boolean): Boolean; override;
|
function OnJsdialog(const browser: ICefBrowser; const originUrl: ustring; dialogType: TCefJsDialogType; const messageText, defaultPromptText: ustring; const callback: ICefJsDialogCallback; out suppressMessage: Boolean): Boolean; override;
|
||||||
function OnBeforeUnloadDialog(const browser: ICefBrowser; const messageText: ustring; isReload: Boolean; const callback: ICefJsDialogCallback): Boolean; override;
|
function OnBeforeUnloadDialog(const browser: ICefBrowser; const messageText: ustring; isReload: Boolean; const callback: ICefJsDialogCallback): Boolean; override;
|
||||||
procedure OnResetDialogState(const browser: ICefBrowser); override;
|
procedure OnResetDialogState(const browser: ICefBrowser); override;
|
||||||
procedure OnDialogClosed(const browser: ICefBrowser); override;
|
procedure OnDialogClosed(const browser: ICefBrowser); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFJsDialogCallback;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFJsDialogCallback;
|
||||||
|
|
||||||
function cef_jsdialog_handler_on_jsdialog(self : PCefJsDialogHandler;
|
function cef_jsdialog_handler_on_jsdialog(self : PCefJsDialogHandler;
|
||||||
@ -168,36 +177,46 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefJsDialogHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomJsDialogHandler
|
// TCustomJsDialogHandler
|
||||||
|
|
||||||
constructor TCustomJsDialogHandler.Create(const events: IChromiumEvents);
|
constructor TCustomJsDialogHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomJsDialogHandler.Destroy;
|
destructor TCustomJsDialogHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomJsDialogHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomJsDialogHandler.OnBeforeUnloadDialog(const browser : ICefBrowser;
|
function TCustomJsDialogHandler.OnBeforeUnloadDialog(const browser : ICefBrowser;
|
||||||
const messageText : ustring;
|
const messageText : ustring;
|
||||||
isReload : Boolean;
|
isReload : Boolean;
|
||||||
const callback : ICefJsDialogCallback): Boolean;
|
const callback : ICefJsDialogCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnBeforeUnloadDialog(browser, messageText, isReload, callback)
|
Result := IChromiumEvents(FEvents).doOnBeforeUnloadDialog(browser, messageText, isReload, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnBeforeUnloadDialog(browser, messageText, isReload, callback);
|
Result := inherited OnBeforeUnloadDialog(browser, messageText, isReload, callback);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomJsDialogHandler.OnDialogClosed(const browser: ICefBrowser);
|
procedure TCustomJsDialogHandler.OnDialogClosed(const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnDialogClosed(browser);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnDialogClosed(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomJsDialogHandler.OnJsdialog(const browser : ICefBrowser;
|
function TCustomJsDialogHandler.OnJsdialog(const browser : ICefBrowser;
|
||||||
@ -210,15 +229,15 @@ function TCustomJsDialogHandler.OnJsdialog(const browser : ICefBrowser
|
|||||||
begin
|
begin
|
||||||
suppressMessage := False;
|
suppressMessage := False;
|
||||||
|
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnJsdialog(browser, originUrl, dialogType, messageText, defaultPromptText, callback, suppressMessage)
|
Result := IChromiumEvents(FEvents).doOnJsdialog(browser, originUrl, dialogType, messageText, defaultPromptText, callback, suppressMessage)
|
||||||
else
|
else
|
||||||
Result := inherited OnJsdialog(browser, originUrl, dialogType, messageText, defaultPromptText, callback, suppressMessage);
|
Result := inherited OnJsdialog(browser, originUrl, dialogType, messageText, defaultPromptText, callback, suppressMessage);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomJsDialogHandler.OnResetDialogState(const browser: ICefBrowser);
|
procedure TCustomJsDialogHandler.OnResetDialogState(const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnResetDialogState(browser);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnResetDialogState(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -55,25 +55,34 @@ type
|
|||||||
function OnPreKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean): Boolean; virtual;
|
function OnPreKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean): Boolean; virtual;
|
||||||
function OnKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle): Boolean; virtual;
|
function OnKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomKeyboardHandler = class(TCefKeyboardHandlerOwn)
|
TCustomKeyboardHandler = class(TCefKeyboardHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnPreKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean): Boolean; override;
|
function OnPreKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean): Boolean; override;
|
||||||
function OnKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle): Boolean; override;
|
function OnKeyEvent(const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle): Boolean; override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
||||||
|
|
||||||
function cef_keyboard_handler_on_pre_key_event(self: PCefKeyboardHandler;
|
function cef_keyboard_handler_on_pre_key_event(self: PCefKeyboardHandler;
|
||||||
@ -116,28 +125,38 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefKeyboardHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomKeyboardHandler
|
// TCustomKeyboardHandler
|
||||||
|
|
||||||
constructor TCustomKeyboardHandler.Create(const events: IChromiumEvents);
|
constructor TCustomKeyboardHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomKeyboardHandler.Destroy;
|
destructor TCustomKeyboardHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomKeyboardHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomKeyboardHandler.OnKeyEvent(const browser : ICefBrowser;
|
function TCustomKeyboardHandler.OnKeyEvent(const browser : ICefBrowser;
|
||||||
const event : PCefKeyEvent;
|
const event : PCefKeyEvent;
|
||||||
osEvent : TCefEventHandle): Boolean;
|
osEvent : TCefEventHandle): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnKeyEvent(browser, event, osEvent)
|
Result := IChromiumEvents(FEvents).doOnKeyEvent(browser, event, osEvent)
|
||||||
else
|
else
|
||||||
Result := inherited OnKeyEvent(browser, event, osEvent);
|
Result := inherited OnKeyEvent(browser, event, osEvent);
|
||||||
end;
|
end;
|
||||||
@ -147,8 +166,8 @@ function TCustomKeyboardHandler.OnPreKeyEvent(const browser : ICefBro
|
|||||||
osEvent : TCefEventHandle;
|
osEvent : TCefEventHandle;
|
||||||
out isKeyboardShortcut : Boolean): Boolean;
|
out isKeyboardShortcut : Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnPreKeyEvent(browser, event, osEvent, isKeyboardShortcut)
|
Result := IChromiumEvents(FEvents).doOnPreKeyEvent(browser, event, osEvent, isKeyboardShortcut)
|
||||||
else
|
else
|
||||||
Result := inherited OnPreKeyEvent(browser, event, osEvent, isKeyboardShortcut);
|
Result := inherited OnPreKeyEvent(browser, event, osEvent, isKeyboardShortcut);
|
||||||
end;
|
end;
|
||||||
|
@ -57,27 +57,36 @@ type
|
|||||||
procedure OnBeforeClose(const browser: ICefBrowser); virtual;
|
procedure OnBeforeClose(const browser: ICefBrowser); virtual;
|
||||||
function DoClose(const browser: ICefBrowser): Boolean; virtual;
|
function DoClose(const browser: ICefBrowser): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomLifeSpanHandler = class(TCefLifeSpanHandlerOwn)
|
TCustomLifeSpanHandler = class(TCefLifeSpanHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnBeforePopup(const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; var popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var noJavascriptAccess: Boolean): Boolean; override;
|
function OnBeforePopup(const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; var popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var noJavascriptAccess: Boolean): Boolean; override;
|
||||||
procedure OnAfterCreated(const browser: ICefBrowser); override;
|
procedure OnAfterCreated(const browser: ICefBrowser); override;
|
||||||
procedure OnBeforeClose(const browser: ICefBrowser); override;
|
procedure OnBeforeClose(const browser: ICefBrowser); override;
|
||||||
function DoClose(const browser: ICefBrowser): Boolean; override;
|
function DoClose(const browser: ICefBrowser): Boolean; override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFClient, uCEFBrowser, uCEFFrame;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFClient, uCEFBrowser, uCEFFrame;
|
||||||
|
|
||||||
function cef_life_span_handler_on_before_popup( self : PCefLifeSpanHandler;
|
function cef_life_span_handler_on_before_popup( self : PCefLifeSpanHandler;
|
||||||
@ -186,38 +195,48 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefLifeSpanHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomLifeSpanHandler
|
// TCustomLifeSpanHandler
|
||||||
|
|
||||||
constructor TCustomLifeSpanHandler.Create(const events: IChromiumEvents);
|
constructor TCustomLifeSpanHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomLifeSpanHandler.Destroy;
|
destructor TCustomLifeSpanHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomLifeSpanHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomLifeSpanHandler.DoClose(const browser: ICefBrowser): Boolean;
|
function TCustomLifeSpanHandler.DoClose(const browser: ICefBrowser): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnClose(browser)
|
Result := IChromiumEvents(FEvents).doOnClose(browser)
|
||||||
else
|
else
|
||||||
Result := inherited DoClose(browser);
|
Result := inherited DoClose(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLifeSpanHandler.OnAfterCreated(const browser: ICefBrowser);
|
procedure TCustomLifeSpanHandler.OnAfterCreated(const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnAfterCreated(browser);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnAfterCreated(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLifeSpanHandler.OnBeforeClose(const browser: ICefBrowser);
|
procedure TCustomLifeSpanHandler.OnBeforeClose(const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnBeforeClose(browser);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnBeforeClose(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomLifeSpanHandler.OnBeforePopup(const browser : ICefBrowser;
|
function TCustomLifeSpanHandler.OnBeforePopup(const browser : ICefBrowser;
|
||||||
@ -232,10 +251,10 @@ function TCustomLifeSpanHandler.OnBeforePopup(const browser : ICefBro
|
|||||||
var settings : TCefBrowserSettings;
|
var settings : TCefBrowserSettings;
|
||||||
var noJavascriptAccess : Boolean): Boolean;
|
var noJavascriptAccess : Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnBeforePopup(browser, frame, targetUrl, targetFrameName,
|
Result := IChromiumEvents(FEvents).doOnBeforePopup(browser, frame, targetUrl, targetFrameName,
|
||||||
targetDisposition, userGesture, popupFeatures,
|
targetDisposition, userGesture, popupFeatures,
|
||||||
windowInfo, client, settings, noJavascriptAccess)
|
windowInfo, client, settings, noJavascriptAccess)
|
||||||
else
|
else
|
||||||
Result := inherited OnBeforePopup(browser, frame, targetUrl, targetFrameName,
|
Result := inherited OnBeforePopup(browser, frame, targetUrl, targetFrameName,
|
||||||
targetDisposition, userGesture, popupFeatures,
|
targetDisposition, userGesture, popupFeatures,
|
||||||
|
@ -57,27 +57,36 @@ type
|
|||||||
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); virtual;
|
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); virtual;
|
||||||
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring); virtual;
|
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomLoadHandler = class(TCefLoadHandlerOwn)
|
TCustomLoadHandler = class(TCefLoadHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnLoadingStateChange(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean); override;
|
procedure OnLoadingStateChange(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean); override;
|
||||||
procedure OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType); override;
|
procedure OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType); override;
|
||||||
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); override;
|
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); override;
|
||||||
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring); override;
|
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame;
|
||||||
|
|
||||||
procedure cef_load_handler_on_loading_state_change(self: PCefLoadHandler; browser: PCefBrowser; isLoading, canGoBack, canGoForward: Integer); stdcall;
|
procedure cef_load_handler_on_loading_state_change(self: PCefLoadHandler; browser: PCefBrowser; isLoading, canGoBack, canGoForward: Integer); stdcall;
|
||||||
@ -137,40 +146,61 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefLoadHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomLoadHandler
|
// TCustomLoadHandler
|
||||||
|
|
||||||
constructor TCustomLoadHandler.Create(const events: IChromiumEvents);
|
constructor TCustomLoadHandler.Create(const events : Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomLoadHandler.Destroy;
|
destructor TCustomLoadHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLoadHandler.OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
procedure TCustomLoadHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnLoadEnd(browser, frame, httpStatusCode);
|
FEvents := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLoadHandler.OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
|
procedure TCustomLoadHandler.OnLoadEnd(const browser : ICefBrowser;
|
||||||
|
const frame : ICefFrame;
|
||||||
|
httpStatusCode : Integer);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnLoadError(browser, frame, errorCode, errorText, failedUrl);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnLoadEnd(browser, frame, httpStatusCode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLoadHandler.OnLoadingStateChange(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
|
procedure TCustomLoadHandler.OnLoadError(const browser : ICefBrowser;
|
||||||
|
const frame : ICefFrame;
|
||||||
|
errorCode : Integer;
|
||||||
|
const errorText : ustring;
|
||||||
|
const failedUrl : ustring);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnLoadingStateChange(browser, isLoading, canGoBack, canGoForward);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnLoadError(browser, frame, errorCode, errorText, failedUrl);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLoadHandler.OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType);
|
procedure TCustomLoadHandler.OnLoadingStateChange(const browser : ICefBrowser;
|
||||||
|
isLoading : Boolean;
|
||||||
|
canGoBack : Boolean;
|
||||||
|
canGoForward : Boolean);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnLoadStart(browser, frame, transitionType);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnLoadingStateChange(browser, isLoading, canGoBack, canGoForward);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomLoadHandler.OnLoadStart(const browser : ICefBrowser;
|
||||||
|
const frame : ICefFrame;
|
||||||
|
transitionType : TCefTransitionType);
|
||||||
|
begin
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnLoadStart(browser, frame, transitionType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -54,8 +54,6 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean); virtual; abstract;
|
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean); virtual; abstract;
|
||||||
|
|
||||||
procedure InitializeVars; virtual; abstract;
|
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -69,24 +67,27 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const proc: TOnPdfPrintFinishedProc); reintroduce;
|
constructor Create(const proc: TOnPdfPrintFinishedProc); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefCustomPDFPrintCallBack = class(TCefPdfPrintCallbackOwn)
|
TCefCustomPDFPrintCallBack = class(TCefPdfPrintCallbackOwn)
|
||||||
protected
|
protected
|
||||||
FChromiumBrowser : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnPdfPrintFinished(const path: ustring; aResultOK : Boolean); override;
|
procedure OnPdfPrintFinished(const path: ustring; aResultOK : Boolean); override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents); reintroduce;
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions;
|
uCEFMiscFunctions, uCEFLibFunctions;
|
||||||
|
|
||||||
procedure cef_pdf_print_callback_on_pdf_print_finished(self: PCefPdfPrintCallback; const path: PCefString; ok: Integer); stdcall;
|
procedure cef_pdf_print_callback_on_pdf_print_finished(self: PCefPdfPrintCallback; const path: PCefString; ok: Integer); stdcall;
|
||||||
@ -116,40 +117,39 @@ end;
|
|||||||
|
|
||||||
destructor TCefFastPdfPrintCallback.Destroy;
|
destructor TCefFastPdfPrintCallback.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
FProc := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefFastPdfPrintCallback.InitializeVars;
|
|
||||||
begin
|
|
||||||
FProc := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// TCefCustomPDFPrintCallBack
|
// TCefCustomPDFPrintCallBack
|
||||||
|
|
||||||
constructor TCefCustomPDFPrintCallBack.Create(const aChromiumBrowser : IChromiumEvents);
|
constructor TCefCustomPDFPrintCallBack.Create(const aEvents : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
FEvents := Pointer(aEvents);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefCustomPDFPrintCallBack.Destroy;
|
destructor TCefCustomPDFPrintCallBack.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
FEvents := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomPDFPrintCallBack.InitializeVars;
|
|
||||||
begin
|
|
||||||
FChromiumBrowser := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefCustomPDFPrintCallBack.OnPdfPrintFinished(const path: ustring; aResultOK : Boolean);
|
procedure TCefCustomPDFPrintCallBack.OnPdfPrintFinished(const path: ustring; aResultOK : Boolean);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) then FChromiumBrowser.doPdfPrintFinished(aResultOK);
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doPdfPrintFinished(aResultOK);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefCustomPDFPrintCallBack.OnPdfPrintFinished', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -66,13 +66,15 @@ type
|
|||||||
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double); virtual;
|
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double); virtual;
|
||||||
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); virtual;
|
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomRenderHandler = class(TCefRenderHandlerOwn)
|
TCustomRenderHandler = class(TCefRenderHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler); override;
|
procedure GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler); override;
|
||||||
function GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean; override;
|
function GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean; override;
|
||||||
@ -88,14 +90,21 @@ type
|
|||||||
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double); override;
|
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double); override;
|
||||||
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); override;
|
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDragData;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDragData;
|
||||||
|
|
||||||
|
|
||||||
@ -308,55 +317,65 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefRenderHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomRenderHandler
|
// TCustomRenderHandler
|
||||||
|
|
||||||
constructor TCustomRenderHandler.Create(const events: IChromiumEvents);
|
constructor TCustomRenderHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomRenderHandler.Destroy;
|
destructor TCustomRenderHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRenderHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler);
|
procedure TCustomRenderHandler.GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnGetAccessibilityHandler(aAccessibilityHandler);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnGetAccessibilityHandler(aAccessibilityHandler);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRenderHandler.GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean;
|
function TCustomRenderHandler.GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetRootScreenRect(browser, rect)
|
Result := IChromiumEvents(FEvents).doOnGetRootScreenRect(browser, rect)
|
||||||
else
|
else
|
||||||
Result := inherited GetRootScreenRect(browser, rect);
|
Result := inherited GetRootScreenRect(browser, rect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRenderHandler.GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean;
|
function TCustomRenderHandler.GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetScreenInfo(browser, screenInfo)
|
Result := IChromiumEvents(FEvents).doOnGetScreenInfo(browser, screenInfo)
|
||||||
else
|
else
|
||||||
Result := inherited GetScreenInfo(browser, screenInfo);
|
Result := inherited GetScreenInfo(browser, screenInfo);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRenderHandler.GetScreenPoint(const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer): Boolean;
|
function TCustomRenderHandler.GetScreenPoint(const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetScreenPoint(browser, viewX, viewY, screenX, screenY)
|
Result := IChromiumEvents(FEvents).doOnGetScreenPoint(browser, viewX, viewY, screenX, screenY)
|
||||||
else
|
else
|
||||||
Result := inherited GetScreenPoint(browser, viewX, viewY, screenX, screenY);
|
Result := inherited GetScreenPoint(browser, viewX, viewY, screenX, screenY);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRenderHandler.GetViewRect(const browser: ICefBrowser; var rect: TCefRect): Boolean;
|
function TCustomRenderHandler.GetViewRect(const browser: ICefBrowser; var rect: TCefRect): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetViewRect(browser, rect)
|
Result := IChromiumEvents(FEvents).doOnGetViewRect(browser, rect)
|
||||||
else
|
else
|
||||||
Result := inherited GetViewRect(browser, rect);
|
Result := inherited GetViewRect(browser, rect);
|
||||||
end;
|
end;
|
||||||
@ -366,8 +385,7 @@ procedure TCustomRenderHandler.OnCursorChange(const browser : ICefBrows
|
|||||||
cursorType : TCefCursorType;
|
cursorType : TCefCursorType;
|
||||||
const customCursorInfo : PCefCursorInfo);
|
const customCursorInfo : PCefCursorInfo);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnCursorChange(browser, cursor, cursorType, customCursorInfo);
|
||||||
FEvent.doOnCursorChange(browser, cursor, cursorType, customCursorInfo);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.OnPaint(const browser : ICefBrowser;
|
procedure TCustomRenderHandler.OnPaint(const browser : ICefBrowser;
|
||||||
@ -378,23 +396,22 @@ procedure TCustomRenderHandler.OnPaint(const browser : ICefBrowser;
|
|||||||
width : Integer;
|
width : Integer;
|
||||||
height : Integer);
|
height : Integer);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPaint(browser, kind, dirtyRectsCount, dirtyRects, buffer, width, height);
|
||||||
FEvent.doOnPaint(browser, kind, dirtyRectsCount, dirtyRects, buffer, width, height);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.OnPopupShow(const browser: ICefBrowser; show: Boolean);
|
procedure TCustomRenderHandler.OnPopupShow(const browser: ICefBrowser; show: Boolean);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnPopupShow(browser, show);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPopupShow(browser, show);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.OnPopupSize(const browser: ICefBrowser; const rect: PCefRect);
|
procedure TCustomRenderHandler.OnPopupSize(const browser: ICefBrowser; const rect: PCefRect);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnPopupSize(browser, rect);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPopupSize(browser, rect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double);
|
procedure TCustomRenderHandler.OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnScrollOffsetChanged(browser, x, y);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnScrollOffsetChanged(browser, x, y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.OnIMECompositionRangeChanged(const browser : ICefBrowser;
|
procedure TCustomRenderHandler.OnIMECompositionRangeChanged(const browser : ICefBrowser;
|
||||||
@ -402,8 +419,7 @@ procedure TCustomRenderHandler.OnIMECompositionRangeChanged(const browser
|
|||||||
character_boundsCount : NativeUInt;
|
character_boundsCount : NativeUInt;
|
||||||
const character_bounds : PCefRect);
|
const character_bounds : PCefRect);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnIMECompositionRangeChanged(browser, selected_range, character_boundsCount, character_bounds);
|
||||||
FEvent.doOnIMECompositionRangeChanged(browser, selected_range, character_boundsCount, character_bounds);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRenderHandler.OnStartDragging(const browser : ICefBrowser;
|
function TCustomRenderHandler.OnStartDragging(const browser : ICefBrowser;
|
||||||
@ -412,15 +428,15 @@ function TCustomRenderHandler.OnStartDragging(const browser : ICefBrowser;
|
|||||||
x : Integer;
|
x : Integer;
|
||||||
y : Integer): Boolean;
|
y : Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnStartDragging(browser, dragData, allowedOps, x, y)
|
Result := IChromiumEvents(FEvents).doOnStartDragging(browser, dragData, allowedOps, x, y)
|
||||||
else
|
else
|
||||||
Result := inherited OnStartDragging(browser, dragData, allowedOps, x, y);
|
Result := inherited OnStartDragging(browser, dragData, allowedOps, x, y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRenderHandler.OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation);
|
procedure TCustomRenderHandler.OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnUpdateDragCursor(browser, operation);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnUpdateDragCursor(browser, operation);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -70,7 +70,7 @@ type
|
|||||||
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode); virtual; abstract;
|
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode); virtual; abstract;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean; virtual;
|
||||||
|
|
||||||
procedure InitializeVars; virtual; abstract;
|
procedure RemoveReferences; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -94,7 +94,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
procedure RemoveReferences; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -317,12 +317,12 @@ end;
|
|||||||
|
|
||||||
destructor TCefCustomRenderProcessHandler.Destroy;
|
destructor TCefCustomRenderProcessHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomRenderProcessHandler.InitializeVars;
|
procedure TCefCustomRenderProcessHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
FCefApp := nil;
|
||||||
end;
|
end;
|
||||||
|
@ -70,13 +70,15 @@ type
|
|||||||
procedure OnRenderViewReady(const browser: ICefBrowser); virtual;
|
procedure OnRenderViewReady(const browser: ICefBrowser); virtual;
|
||||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); virtual;
|
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); virtual;
|
||||||
|
|
||||||
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCustomRequestHandler = class(TCefRequestHandlerOwn)
|
TCustomRequestHandler = class(TCefRequestHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FEvent: IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
function OnBeforeBrowse(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; isRedirect: Boolean): Boolean; override;
|
function OnBeforeBrowse(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; isRedirect: Boolean): Boolean; override;
|
||||||
function OnOpenUrlFromTab(const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean): Boolean; override;
|
function OnOpenUrlFromTab(const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean): Boolean; override;
|
||||||
@ -95,8 +97,10 @@ type
|
|||||||
procedure OnRenderViewReady(const browser: ICefBrowser); override;
|
procedure OnRenderViewReady(const browser: ICefBrowser); override;
|
||||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); override;
|
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); override;
|
||||||
|
|
||||||
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
constructor Create(const events: Pointer); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -312,25 +316,26 @@ end;
|
|||||||
constructor TCefRequestHandlerOwn.Create;
|
constructor TCefRequestHandlerOwn.Create;
|
||||||
begin
|
begin
|
||||||
inherited CreateData(SizeOf(TCefRequestHandler));
|
inherited CreateData(SizeOf(TCefRequestHandler));
|
||||||
|
|
||||||
with PCefRequestHandler(FData)^ do
|
with PCefRequestHandler(FData)^ do
|
||||||
begin
|
begin
|
||||||
on_before_browse := cef_request_handler_on_before_browse;
|
on_before_browse := cef_request_handler_on_before_browse;
|
||||||
on_open_urlfrom_tab := cef_request_handler_on_open_urlfrom_tab;
|
on_open_urlfrom_tab := cef_request_handler_on_open_urlfrom_tab;
|
||||||
on_before_resource_load := cef_request_handler_on_before_resource_load;
|
on_before_resource_load := cef_request_handler_on_before_resource_load;
|
||||||
get_resource_handler := cef_request_handler_get_resource_handler;
|
get_resource_handler := cef_request_handler_get_resource_handler;
|
||||||
on_resource_redirect := cef_request_handler_on_resource_redirect;
|
on_resource_redirect := cef_request_handler_on_resource_redirect;
|
||||||
on_resource_response := cef_request_handler_on_resource_response;
|
on_resource_response := cef_request_handler_on_resource_response;
|
||||||
get_resource_response_filter := cef_request_handler_get_resource_response_filter;
|
get_resource_response_filter := cef_request_handler_get_resource_response_filter;
|
||||||
on_resource_load_complete := cef_request_handler_on_resource_load_complete;
|
on_resource_load_complete := cef_request_handler_on_resource_load_complete;
|
||||||
get_auth_credentials := cef_request_handler_get_auth_credentials;
|
get_auth_credentials := cef_request_handler_get_auth_credentials;
|
||||||
on_quota_request := cef_request_handler_on_quota_request;
|
on_quota_request := cef_request_handler_on_quota_request;
|
||||||
on_protocol_execution := cef_request_handler_on_protocol_execution;
|
on_protocol_execution := cef_request_handler_on_protocol_execution;
|
||||||
on_certificate_error := cef_request_handler_on_certificate_error;
|
on_certificate_error := cef_request_handler_on_certificate_error;
|
||||||
on_select_client_certificate := cef_request_handler_on_select_client_certificate;
|
on_select_client_certificate := cef_request_handler_on_select_client_certificate;
|
||||||
on_plugin_crashed := cef_request_handler_on_plugin_crashed;
|
on_plugin_crashed := cef_request_handler_on_plugin_crashed;
|
||||||
on_render_view_ready := cef_request_handler_on_render_view_ready;
|
on_render_view_ready := cef_request_handler_on_render_view_ready;
|
||||||
on_render_process_terminated := cef_request_handler_on_render_process_terminated;
|
on_render_process_terminated := cef_request_handler_on_render_process_terminated;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefRequestHandlerOwn.GetAuthCredentials(const browser: ICefBrowser; const frame: ICefFrame;
|
function TCefRequestHandlerOwn.GetAuthCredentials(const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
@ -449,22 +454,32 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefRequestHandlerOwn.RemoveReferences;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCustomRequestHandler
|
// TCustomRequestHandler
|
||||||
|
|
||||||
constructor TCustomRequestHandler.Create(const events: IChromiumEvents);
|
constructor TCustomRequestHandler.Create(const events: Pointer);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FEvent := events;
|
FEvents := events;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomRequestHandler.Destroy;
|
destructor TCustomRequestHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FEvent := nil;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRequestHandler.RemoveReferences;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomRequestHandler.GetAuthCredentials(const browser : ICefBrowser;
|
function TCustomRequestHandler.GetAuthCredentials(const browser : ICefBrowser;
|
||||||
const frame : ICefFrame;
|
const frame : ICefFrame;
|
||||||
isProxy : Boolean;
|
isProxy : Boolean;
|
||||||
@ -474,8 +489,8 @@ function TCustomRequestHandler.GetAuthCredentials(const browser : ICefBrowser;
|
|||||||
const scheme : ustring;
|
const scheme : ustring;
|
||||||
const callback : ICefAuthCallback): Boolean;
|
const callback : ICefAuthCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetAuthCredentials(browser, frame, isProxy, host, port, realm, scheme, callback)
|
Result := IChromiumEvents(FEvents).doOnGetAuthCredentials(browser, frame, isProxy, host, port, realm, scheme, callback)
|
||||||
else
|
else
|
||||||
Result := inherited GetAuthCredentials(browser, frame, isProxy, host, port, realm, scheme, callback);
|
Result := inherited GetAuthCredentials(browser, frame, isProxy, host, port, realm, scheme, callback);
|
||||||
end;
|
end;
|
||||||
@ -484,8 +499,8 @@ function TCustomRequestHandler.GetResourceHandler(const browser : ICefBrowser;
|
|||||||
const frame : ICefFrame;
|
const frame : ICefFrame;
|
||||||
const request : ICefRequest): ICefResourceHandler;
|
const request : ICefRequest): ICefResourceHandler;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetResourceHandler(browser, frame, request)
|
Result := IChromiumEvents(FEvents).doOnGetResourceHandler(browser, frame, request)
|
||||||
else
|
else
|
||||||
Result := inherited GetResourceHandler(browser, frame, request);
|
Result := inherited GetResourceHandler(browser, frame, request);
|
||||||
end;
|
end;
|
||||||
@ -495,7 +510,10 @@ function TCustomRequestHandler.OnBeforeBrowse(const browser : ICefBrowser;
|
|||||||
const request : ICefRequest;
|
const request : ICefRequest;
|
||||||
isRedirect : Boolean): Boolean;
|
isRedirect : Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := FEvent.doOnBeforeBrowse(browser, frame, request, isRedirect);
|
if (FEvents <> nil) then
|
||||||
|
Result := IChromiumEvents(FEvents).doOnBeforeBrowse(browser, frame, request, isRedirect)
|
||||||
|
else
|
||||||
|
Result := inherited OnBeforeBrowse(browser, frame, request, isRedirect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRequestHandler.OnBeforeResourceLoad(const browser : ICefBrowser;
|
function TCustomRequestHandler.OnBeforeResourceLoad(const browser : ICefBrowser;
|
||||||
@ -503,8 +521,8 @@ function TCustomRequestHandler.OnBeforeResourceLoad(const browser : ICefBrowser
|
|||||||
const request : ICefRequest;
|
const request : ICefRequest;
|
||||||
const callback : ICefRequestCallback): TCefReturnValue;
|
const callback : ICefRequestCallback): TCefReturnValue;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnBeforeResourceLoad(browser, frame, request, callback)
|
Result := IChromiumEvents(FEvents).doOnBeforeResourceLoad(browser, frame, request, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnBeforeResourceLoad(browser, frame, request, callback);
|
Result := inherited OnBeforeResourceLoad(browser, frame, request, callback);
|
||||||
end;
|
end;
|
||||||
@ -515,8 +533,8 @@ function TCustomRequestHandler.OnCertificateError(const browser : ICefBrowser
|
|||||||
const sslInfo : ICefSslInfo;
|
const sslInfo : ICefSslInfo;
|
||||||
const callback : ICefRequestCallback): Boolean;
|
const callback : ICefRequestCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnCertificateError(browser, certError, requestUrl, sslInfo, callback)
|
Result := IChromiumEvents(FEvents).doOnCertificateError(browser, certError, requestUrl, sslInfo, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnCertificateError(browser, certError, requestUrl, sslInfo, callback);
|
Result := inherited OnCertificateError(browser, certError, requestUrl, sslInfo, callback);
|
||||||
end;
|
end;
|
||||||
@ -527,8 +545,8 @@ function TCustomRequestHandler.OnOpenUrlFromTab(const browser : ICefBr
|
|||||||
targetDisposition : TCefWindowOpenDisposition;
|
targetDisposition : TCefWindowOpenDisposition;
|
||||||
userGesture : Boolean): Boolean;
|
userGesture : Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnOpenUrlFromTab(browser, frame, targetUrl, targetDisposition, userGesture)
|
Result := IChromiumEvents(FEvents).doOnOpenUrlFromTab(browser, frame, targetUrl, targetDisposition, userGesture)
|
||||||
else
|
else
|
||||||
Result := inherited OnOpenUrlFromTab(browser, frame, targetUrl, targetDisposition, userGesture);
|
Result := inherited OnOpenUrlFromTab(browser, frame, targetUrl, targetDisposition, userGesture);
|
||||||
end;
|
end;
|
||||||
@ -541,22 +559,22 @@ function TCustomRequestHandler.OnSelectClientCertificate(const browser
|
|||||||
const certificates : TCefX509CertificateArray;
|
const certificates : TCefX509CertificateArray;
|
||||||
const callback : ICefSelectClientCertificateCallback): boolean;
|
const callback : ICefSelectClientCertificateCallback): boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnSelectClientCertificate(browser, isProxy, host, port, certificatesCount, certificates, callback)
|
Result := IChromiumEvents(FEvents).doOnSelectClientCertificate(browser, isProxy, host, port, certificatesCount, certificates, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnSelectClientCertificate(browser, isProxy, host, port, certificatesCount, certificates, callback);
|
Result := inherited OnSelectClientCertificate(browser, isProxy, host, port, certificatesCount, certificates, callback);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRequestHandler.OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring);
|
procedure TCustomRequestHandler.OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnPluginCrashed(browser, pluginPath);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPluginCrashed(browser, pluginPath);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRequestHandler.OnProtocolExecution(const browser : ICefBrowser;
|
procedure TCustomRequestHandler.OnProtocolExecution(const browser : ICefBrowser;
|
||||||
const url : ustring;
|
const url : ustring;
|
||||||
out allowOsExecution : Boolean);
|
out allowOsExecution : Boolean);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnProtocolExecution(browser, url, allowOsExecution);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnProtocolExecution(browser, url, allowOsExecution);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRequestHandler.OnQuotaRequest(const browser : ICefBrowser;
|
function TCustomRequestHandler.OnQuotaRequest(const browser : ICefBrowser;
|
||||||
@ -564,20 +582,20 @@ function TCustomRequestHandler.OnQuotaRequest(const browser : ICefBrowser;
|
|||||||
newSize : Int64;
|
newSize : Int64;
|
||||||
const callback : ICefRequestCallback): Boolean;
|
const callback : ICefRequestCallback): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnQuotaRequest(browser, originUrl, newSize, callback)
|
Result := IChromiumEvents(FEvents).doOnQuotaRequest(browser, originUrl, newSize, callback)
|
||||||
else
|
else
|
||||||
Result := inherited OnQuotaRequest(browser, originUrl, newSize, callback);
|
Result := inherited OnQuotaRequest(browser, originUrl, newSize, callback);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRequestHandler.OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
procedure TCustomRequestHandler.OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnRenderProcessTerminated(browser, status);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRenderProcessTerminated(browser, status);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRequestHandler.OnRenderViewReady(const browser: ICefBrowser);
|
procedure TCustomRequestHandler.OnRenderViewReady(const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnRenderViewReady(browser);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRenderViewReady(browser);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRequestHandler.OnResourceRedirect(const browser : ICefBrowser;
|
procedure TCustomRequestHandler.OnResourceRedirect(const browser : ICefBrowser;
|
||||||
@ -586,7 +604,7 @@ procedure TCustomRequestHandler.OnResourceRedirect(const browser : ICefBrowser;
|
|||||||
const response : ICefResponse;
|
const response : ICefResponse;
|
||||||
var newUrl : ustring);
|
var newUrl : ustring);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then FEvent.doOnResourceRedirect(browser, frame, request, response, newUrl);
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnResourceRedirect(browser, frame, request, response, newUrl);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomRequestHandler.OnResourceResponse(const browser : ICefBrowser;
|
function TCustomRequestHandler.OnResourceResponse(const browser : ICefBrowser;
|
||||||
@ -594,8 +612,8 @@ function TCustomRequestHandler.OnResourceResponse(const browser : ICefBrowser;
|
|||||||
const request : ICefRequest;
|
const request : ICefRequest;
|
||||||
const response : ICefResponse): Boolean;
|
const response : ICefResponse): Boolean;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnResourceResponse(browser, frame, request, response)
|
Result := IChromiumEvents(FEvents).doOnResourceResponse(browser, frame, request, response)
|
||||||
else
|
else
|
||||||
Result := inherited OnResourceResponse(browser, frame, request, response);
|
Result := inherited OnResourceResponse(browser, frame, request, response);
|
||||||
end;
|
end;
|
||||||
@ -605,8 +623,8 @@ function TCustomRequestHandler.GetResourceResponseFilter(const browser: ICefBrow
|
|||||||
const request: ICefRequest;
|
const request: ICefRequest;
|
||||||
const response: ICefResponse): ICefResponseFilter;
|
const response: ICefResponse): ICefResponseFilter;
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then
|
||||||
Result := FEvent.doOnGetResourceResponseFilter(browser, frame, request, response)
|
Result := IChromiumEvents(FEvents).doOnGetResourceResponseFilter(browser, frame, request, response)
|
||||||
else
|
else
|
||||||
Result := inherited GetResourceResponseFilter(browser, frame, request, response);
|
Result := inherited GetResourceResponseFilter(browser, frame, request, response);
|
||||||
end;
|
end;
|
||||||
@ -618,8 +636,7 @@ procedure TCustomRequestHandler.OnResourceLoadComplete(const browser
|
|||||||
status : TCefUrlRequestStatus;
|
status : TCefUrlRequestStatus;
|
||||||
receivedContentLength : Int64);
|
receivedContentLength : Int64);
|
||||||
begin
|
begin
|
||||||
if (FEvent <> nil) then
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnResourceLoadComplete(browser, frame, request, response, status, receivedContentLength);
|
||||||
FEvent.doOnResourceLoadComplete(browser, frame, request, response, status, receivedContentLength);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -58,7 +58,6 @@ type
|
|||||||
TCefResolveCallbackOwn = class(TCefBaseRefCountedOwn, ICefResolveCallback)
|
TCefResolveCallbackOwn = class(TCefBaseRefCountedOwn, ICefResolveCallback)
|
||||||
protected
|
protected
|
||||||
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings); virtual; abstract;
|
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings); virtual; abstract;
|
||||||
procedure InitializeVars; virtual; abstract;
|
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -66,13 +65,13 @@ type
|
|||||||
|
|
||||||
TCefCustomResolveCallback = class(TCefResolveCallbackOwn)
|
TCefCustomResolveCallback = class(TCefResolveCallbackOwn)
|
||||||
protected
|
protected
|
||||||
FChromiumBrowser : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings); override;
|
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings); override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents); reintroduce;
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -126,28 +125,32 @@ end;
|
|||||||
|
|
||||||
// TCefCustomResolveCallback
|
// TCefCustomResolveCallback
|
||||||
|
|
||||||
constructor TCefCustomResolveCallback.Create(const aChromiumBrowser : IChromiumEvents);
|
constructor TCefCustomResolveCallback.Create(const aEvents : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
FEvents := Pointer(aEvents);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefCustomResolveCallback.Destroy;
|
destructor TCefCustomResolveCallback.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
FEvents := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomResolveCallback.InitializeVars;
|
|
||||||
begin
|
|
||||||
FChromiumBrowser := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefCustomResolveCallback.OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
procedure TCefCustomResolveCallback.OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) then FChromiumBrowser.doResolvedHostAvailable(result, resolvedIps);
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doResolvedHostAvailable(result, resolvedIps);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefCustomResolveCallback.OnResolveCompleted', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -56,7 +56,7 @@ type
|
|||||||
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
||||||
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
||||||
|
|
||||||
procedure InitializeVars; virtual; abstract;
|
procedure RemoveReferences; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -73,7 +73,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
procedure RemoveReferences; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -157,12 +157,12 @@ end;
|
|||||||
|
|
||||||
destructor TCefCustomResourceBundleHandler.Destroy;
|
destructor TCefCustomResourceBundleHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
RemoveReferences;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomResourceBundleHandler.InitializeVars;
|
procedure TCefCustomResourceBundleHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
FCefApp := nil;
|
||||||
end;
|
end;
|
||||||
|
@ -50,12 +50,32 @@ uses
|
|||||||
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
|
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TOnFilterEvent = procedure(Sender: TObject; data_in: Pointer; data_in_size: NativeUInt; var data_in_read: NativeUInt; data_out: Pointer; data_out_size : NativeUInt; var data_out_written: NativeUInt; var aResult : TCefResponseFilterStatus) of object;
|
||||||
|
TOnInitFilterEvent = procedure(Sender: TObject; var aResult : boolean) of object;
|
||||||
|
|
||||||
|
|
||||||
TCefResponseFilterOwn = class(TCefBaseRefCountedOwn, ICefResponseFilter)
|
TCefResponseFilterOwn = class(TCefBaseRefCountedOwn, ICefResponseFilter)
|
||||||
protected
|
protected
|
||||||
function InitFilter: Boolean; virtual; abstract;
|
function InitFilter: Boolean; virtual; abstract;
|
||||||
function Filter(dataIn: Pointer; dataInSize : NativeUInt; dataInRead: PNativeUInt; dataOut: Pointer; dataOutSize : NativeUInt; dataOutWritten: PNativeUInt): TCefResponseFilterStatus; virtual; abstract;
|
function Filter(data_in: Pointer; data_in_size: NativeUInt; var data_in_read: NativeUInt; data_out: Pointer; data_out_size : NativeUInt; var data_out_written: NativeUInt): TCefResponseFilterStatus; virtual; abstract;
|
||||||
public
|
|
||||||
constructor Create; virtual;
|
public
|
||||||
|
constructor Create; virtual;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TCustomResponseFilter = class(TCefResponseFilterOwn)
|
||||||
|
protected
|
||||||
|
FOnFilter : TOnFilterEvent;
|
||||||
|
FOnInitFilter : TOnInitFilterEvent;
|
||||||
|
|
||||||
|
function InitFilter: Boolean; override;
|
||||||
|
function Filter(data_in: Pointer; data_in_size: NativeUInt; var data_in_read: NativeUInt; data_out: Pointer; data_out_size : NativeUInt; var data_out_written: NativeUInt): TCefResponseFilterStatus; override;
|
||||||
|
|
||||||
|
public
|
||||||
|
constructor Create; override;
|
||||||
|
|
||||||
|
property OnFilter : TOnFilterEvent read FOnFilter write FOnFilter;
|
||||||
|
property OnInitFilter : TOnInitFilterEvent read FOnInitFilter write FOnInitFilter;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -63,27 +83,70 @@ implementation
|
|||||||
uses
|
uses
|
||||||
uCEFMiscFunctions, uCEFLibFunctions;
|
uCEFMiscFunctions, uCEFLibFunctions;
|
||||||
|
|
||||||
|
// TCefResponseFilterOwn
|
||||||
|
|
||||||
function cef_response_filter_init_filter(self: PCefResponseFilter): Integer; stdcall;
|
function cef_response_filter_init_filter(self: PCefResponseFilter): Integer; stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefResponseFilterOwn(CefGetObject(self)) do
|
with TCefResponseFilterOwn(CefGetObject(self)) do Result := Ord(InitFilter());
|
||||||
Result := Ord(InitFilter());
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_response_filter_filter(self: PCefResponseFilter; data_in: Pointer; data_in_size : NativeUInt; var data_in_read: NativeUInt;
|
function cef_response_filter_filter(self: PCefResponseFilter;
|
||||||
data_out: Pointer; data_out_size: NativeUInt; var data_out_written: NativeUInt): TCefResponseFilterStatus; stdcall;
|
data_in: Pointer;
|
||||||
|
data_in_size : NativeUInt;
|
||||||
|
var data_in_read: NativeUInt;
|
||||||
|
data_out: Pointer;
|
||||||
|
data_out_size: NativeUInt;
|
||||||
|
var data_out_written: NativeUInt): TCefResponseFilterStatus; stdcall;
|
||||||
begin
|
begin
|
||||||
with TCefResponseFilterOwn(CefGetObject(self)) do
|
with TCefResponseFilterOwn(CefGetObject(self)) do
|
||||||
Result := Filter(data_in, data_in_size, @data_in_read, data_out, data_out_size, @data_out_written);
|
Result := Filter(data_in, data_in_size, data_in_read,
|
||||||
|
data_out, data_out_size, data_out_written);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TCefResponseFilterOwn.Create;
|
constructor TCefResponseFilterOwn.Create;
|
||||||
begin
|
begin
|
||||||
CreateData(SizeOf(TCefResponseFilter));
|
CreateData(SizeOf(TCefResponseFilter));
|
||||||
|
|
||||||
with PCefResponseFilter(FData)^ do
|
with PCefResponseFilter(FData)^ do
|
||||||
begin
|
begin
|
||||||
init_filter := cef_response_filter_init_filter;
|
init_filter := cef_response_filter_init_filter;
|
||||||
filter := cef_response_filter_filter;
|
filter := cef_response_filter_filter;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
// TCustomResponseFilter
|
||||||
|
|
||||||
|
|
||||||
|
constructor TCustomResponseFilter.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
|
||||||
|
FOnFilter := nil;
|
||||||
|
FOnInitFilter := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCustomResponseFilter.InitFilter: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
if assigned(FOnInitFilter) then FOnInitFilter(self, Result);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCustomResponseFilter.Filter( data_in : Pointer;
|
||||||
|
data_in_size : NativeUInt;
|
||||||
|
var data_in_read : NativeUInt;
|
||||||
|
data_out : Pointer;
|
||||||
|
data_out_size : NativeUInt;
|
||||||
|
var data_out_written : NativeUInt) : TCefResponseFilterStatus;
|
||||||
|
begin
|
||||||
|
Result := RESPONSE_FILTER_DONE;
|
||||||
|
|
||||||
|
if assigned(FOnFilter) then
|
||||||
|
FOnFilter(self,
|
||||||
|
data_in, data_in_size, data_in_read,
|
||||||
|
data_out, data_out_size, data_out_written,
|
||||||
|
Result);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -86,6 +86,11 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFServer, uCEFRequest, uCEFCallback;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFServer, uCEFRequest, uCEFCallback;
|
||||||
|
|
||||||
// **************************************************************
|
// **************************************************************
|
||||||
@ -248,42 +253,82 @@ end;
|
|||||||
|
|
||||||
procedure TCustomServerHandler.OnServerCreated(const server: ICefServer);
|
procedure TCustomServerHandler.OnServerCreated(const server: ICefServer);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnServerCreated(server);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnServerCreated(server);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnServerCreated', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnServerDestroyed(const server: ICefServer);
|
procedure TCustomServerHandler.OnServerDestroyed(const server: ICefServer);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnServerDestroyed(server);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnServerDestroyed(server);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnServerDestroyed', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnClientConnected(const server: ICefServer; connection_id: Integer);
|
procedure TCustomServerHandler.OnClientConnected(const server: ICefServer; connection_id: Integer);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnClientConnected(server, connection_id);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnClientConnected(server, connection_id);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnClientConnected', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnClientDisconnected(const server: ICefServer; connection_id: Integer);
|
procedure TCustomServerHandler.OnClientDisconnected(const server: ICefServer; connection_id: Integer);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnClientDisconnected(server, connection_id);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnClientDisconnected(server, connection_id);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnClientDisconnected', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnHttpRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest);
|
procedure TCustomServerHandler.OnHttpRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnHttpRequest(server, connection_id, client_address, request);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnHttpRequest(server, connection_id, client_address, request);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnHttpRequest', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnWebSocketRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest; const callback: ICefCallback);
|
procedure TCustomServerHandler.OnWebSocketRequest(const server: ICefServer; connection_id: Integer; const client_address: ustring; const request: ICefRequest; const callback: ICefCallback);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnWebSocketRequest(server, connection_id, client_address, request, callback);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnWebSocketRequest(server, connection_id, client_address, request, callback);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnWebSocketRequest', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnWebSocketConnected(const server: ICefServer; connection_id: Integer);
|
procedure TCustomServerHandler.OnWebSocketConnected(const server: ICefServer; connection_id: Integer);
|
||||||
begin
|
begin
|
||||||
|
try
|
||||||
if (FEvents <> nil) then FEvents.doOnWebSocketConnected(server, connection_id);
|
if (FEvents <> nil) then FEvents.doOnWebSocketConnected(server, connection_id);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnWebSocketConnected', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomServerHandler.OnWebSocketMessage(const server: ICefServer; connection_id: Integer; const data: Pointer; data_size: NativeUInt);
|
procedure TCustomServerHandler.OnWebSocketMessage(const server: ICefServer; connection_id: Integer; const data: Pointer; data_size: NativeUInt);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then FEvents.doOnWebSocketMessage(server, connection_id, data, data_size);
|
try
|
||||||
|
if (FEvents <> nil) then FEvents.doOnWebSocketMessage(server, connection_id, data, data_size);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomServerHandler.OnWebSocketMessage', e) then raise;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -53,7 +53,7 @@ type
|
|||||||
TCefStringVisitorOwn = class(TCefBaseRefCountedOwn, ICefStringVisitor)
|
TCefStringVisitorOwn = class(TCefBaseRefCountedOwn, ICefStringVisitor)
|
||||||
protected
|
protected
|
||||||
procedure Visit(const str: ustring); virtual;
|
procedure Visit(const str: ustring); virtual;
|
||||||
procedure InitializeVars; virtual;
|
procedure RemoveReferences; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -71,19 +71,23 @@ type
|
|||||||
|
|
||||||
TCustomCefStringVisitor = class(TCefStringVisitorOwn)
|
TCustomCefStringVisitor = class(TCefStringVisitorOwn)
|
||||||
protected
|
protected
|
||||||
FChromiumBrowser : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure Visit(const str: ustring); override;
|
procedure Visit(const str: ustring); override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents); reintroduce;
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure InitializeVars; override;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions;
|
uCEFMiscFunctions, uCEFLibFunctions;
|
||||||
|
|
||||||
procedure cef_string_visitor_visit(self: PCefStringVisitor; const str: PCefString); stdcall;
|
procedure cef_string_visitor_visit(self: PCefStringVisitor; const str: PCefString); stdcall;
|
||||||
@ -105,7 +109,7 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefStringVisitorOwn.InitializeVars;
|
procedure TCefStringVisitorOwn.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
@ -126,28 +130,32 @@ end;
|
|||||||
|
|
||||||
// TCustomCefStringVisitor
|
// TCustomCefStringVisitor
|
||||||
|
|
||||||
constructor TCustomCefStringVisitor.Create(const aChromiumBrowser : IChromiumEvents);
|
constructor TCustomCefStringVisitor.Create(const aEvents : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
FEvents := Pointer(aEvents);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomCefStringVisitor.Destroy;
|
destructor TCustomCefStringVisitor.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeVars;
|
FEvents := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomCefStringVisitor.InitializeVars;
|
|
||||||
begin
|
|
||||||
FChromiumBrowser := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomCefStringVisitor.Visit(const str: ustring);
|
procedure TCustomCefStringVisitor.Visit(const str: ustring);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) then FChromiumBrowser.doTextResultAvailable(str);
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doTextResultAvailable(str);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomCefStringVisitor.Visit', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -80,52 +80,36 @@ type
|
|||||||
constructor Create(const method: TCefFastTaskProc); reintroduce;
|
constructor Create(const method: TCefFastTaskProc); reintroduce;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefGetTextTask = class(TCefTaskOwn)
|
|
||||||
protected
|
|
||||||
FChromiumBrowser : IChromiumEvents;
|
|
||||||
FFrameName : ustring;
|
|
||||||
FFrame : ICefFrame;
|
|
||||||
FFrameIdentifier : int64;
|
|
||||||
|
|
||||||
procedure Execute; override;
|
|
||||||
|
|
||||||
public
|
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents; const aFrameName : ustring); reintroduce; overload;
|
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents; const aFrame : ICefFrame); reintroduce; overload;
|
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents; const aFrameIdentifier : int64); reintroduce; overload;
|
|
||||||
destructor Destroy; override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
TCefGetHTMLTask = class(TCefGetTextTask)
|
|
||||||
protected
|
|
||||||
procedure Execute; override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
TCefUpdatePrefsTask = class(TCefTaskOwn)
|
TCefUpdatePrefsTask = class(TCefTaskOwn)
|
||||||
protected
|
protected
|
||||||
FChromiumBrowser : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure Execute; override;
|
procedure Execute; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents); reintroduce;
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefSavePrefsTask = class(TCefTaskOwn)
|
TCefSavePrefsTask = class(TCefTaskOwn)
|
||||||
protected
|
protected
|
||||||
FChromiumBrowser : IChromiumEvents;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure Execute; override;
|
procedure Execute; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : IChromiumEvents); reintroduce;
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager;
|
||||||
|
|
||||||
procedure cef_task_execute(self: PCefTask); stdcall;
|
procedure cef_task_execute(self: PCefTask); stdcall;
|
||||||
@ -156,7 +140,7 @@ end;
|
|||||||
|
|
||||||
class function TCefTaskRef.UnWrap(data: Pointer): ICefTask;
|
class function TCefTaskRef.UnWrap(data: Pointer): ICefTask;
|
||||||
begin
|
begin
|
||||||
if data <> nil then
|
if (data <> nil) then
|
||||||
Result := Create(data) as ICefTask
|
Result := Create(data) as ICefTask
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
@ -188,122 +172,68 @@ begin
|
|||||||
CefPostDelayedTask(threadId, Create(method), Delay);
|
CefPostDelayedTask(threadId, Create(method), Delay);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefGetTextTask
|
|
||||||
|
|
||||||
|
|
||||||
constructor TCefGetTextTask.Create(const aChromiumBrowser : IChromiumEvents; const aFrameName : ustring);
|
|
||||||
begin
|
|
||||||
inherited Create;
|
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
|
||||||
FFrameName := aFrameName;
|
|
||||||
FFrame := nil;
|
|
||||||
FFrameIdentifier := 0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TCefGetTextTask.Create(const aChromiumBrowser : IChromiumEvents; const aFrame : ICefFrame);
|
|
||||||
begin
|
|
||||||
inherited Create;
|
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
|
||||||
FFrameName := '';
|
|
||||||
FFrame := aFrame;
|
|
||||||
FFrameIdentifier := 0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TCefGetTextTask.Create(const aChromiumBrowser : IChromiumEvents; const aFrameIdentifier : int64);
|
|
||||||
begin
|
|
||||||
inherited Create;
|
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
|
||||||
FFrameName := '';
|
|
||||||
FFrame := nil;
|
|
||||||
FFrameIdentifier := aFrameIdentifier;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TCefGetTextTask.Destroy;
|
|
||||||
begin
|
|
||||||
FChromiumBrowser := nil;
|
|
||||||
FFrame := nil;
|
|
||||||
|
|
||||||
inherited Destroy;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefGetTextTask.Execute;
|
|
||||||
begin
|
|
||||||
if (FChromiumBrowser <> nil) then
|
|
||||||
begin
|
|
||||||
if (FFrame <> nil) then
|
|
||||||
FChromiumBrowser.doGetText(FFrame)
|
|
||||||
else
|
|
||||||
if (FFrameIdentifier <> 0) then
|
|
||||||
FChromiumBrowser.doGetText(FFrameIdentifier)
|
|
||||||
else
|
|
||||||
FChromiumBrowser.doGetText(FFrameName);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
// TCefGetHTMLTask
|
|
||||||
|
|
||||||
procedure TCefGetHTMLTask.Execute;
|
|
||||||
begin
|
|
||||||
if (FChromiumBrowser <> nil) then
|
|
||||||
begin
|
|
||||||
if (FFrame <> nil) then
|
|
||||||
FChromiumBrowser.doGetHTML(FFrame)
|
|
||||||
else
|
|
||||||
if (FFrameIdentifier <> 0) then
|
|
||||||
FChromiumBrowser.doGetHTML(FFrameIdentifier)
|
|
||||||
else
|
|
||||||
FChromiumBrowser.doGetHTML(FFrameName);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
// TCefUpdatePrefsTask
|
// TCefUpdatePrefsTask
|
||||||
|
|
||||||
|
|
||||||
constructor TCefUpdatePrefsTask.Create(const aChromiumBrowser : IChromiumEvents);
|
constructor TCefUpdatePrefsTask.Create(const aEvents : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
FEvents := Pointer(aEvents);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefUpdatePrefsTask.Destroy;
|
destructor TCefUpdatePrefsTask.Destroy;
|
||||||
begin
|
begin
|
||||||
FChromiumBrowser := nil;
|
FEvents := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefUpdatePrefsTask.Execute;
|
procedure TCefUpdatePrefsTask.Execute;
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) then FChromiumBrowser.doUpdatePreferences;
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doUpdatePreferences;
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefUpdatePrefsTask.Execute', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
// TCefSavePrefsTask
|
// TCefSavePrefsTask
|
||||||
|
|
||||||
|
|
||||||
constructor TCefSavePrefsTask.Create(const aChromiumBrowser : IChromiumEvents);
|
constructor TCefSavePrefsTask.Create(const aEvents : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromiumBrowser := aChromiumBrowser;
|
FEvents := Pointer(aEvents);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefSavePrefsTask.Destroy;
|
destructor TCefSavePrefsTask.Destroy;
|
||||||
begin
|
begin
|
||||||
FChromiumBrowser := nil;
|
FEvents := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefSavePrefsTask.Execute;
|
procedure TCefSavePrefsTask.Execute;
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) then FChromiumBrowser.doSavePreferences;
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doSavePreferences;
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefSavePrefsTask.Execute', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -231,6 +231,7 @@ type
|
|||||||
TCefContextMenuEditStateFlags = Cardinal; // /include/internal/cef_types.h (cef_context_menu_edit_state_flags_t)
|
TCefContextMenuEditStateFlags = Cardinal; // /include/internal/cef_types.h (cef_context_menu_edit_state_flags_t)
|
||||||
TCefJsonWriterOptions = Cardinal; // /include/internal/cef_types.h (cef_json_writer_options_t)
|
TCefJsonWriterOptions = Cardinal; // /include/internal/cef_types.h (cef_json_writer_options_t)
|
||||||
TCefSSLContentStatus = Cardinal; // /include/internal/cef_types.h (cef_ssl_content_status_t)
|
TCefSSLContentStatus = Cardinal; // /include/internal/cef_types.h (cef_ssl_content_status_t)
|
||||||
|
TCefLogSeverity = Cardinal; // /include/internal/cef_types.h (cef_log_severity_t)
|
||||||
|
|
||||||
{$IFNDEF DELPHI12_UP}
|
{$IFNDEF DELPHI12_UP}
|
||||||
NativeUInt = Cardinal;
|
NativeUInt = Cardinal;
|
||||||
@ -403,16 +404,6 @@ type
|
|||||||
STATE_DISABLED
|
STATE_DISABLED
|
||||||
);
|
);
|
||||||
|
|
||||||
// /include/internal/cef_types.h (cef_log_severity_t)
|
|
||||||
TCefLogSeverity = (
|
|
||||||
LOGSEVERITY_DEFAULT,
|
|
||||||
LOGSEVERITY_VERBOSE,
|
|
||||||
LOGSEVERITY_INFO,
|
|
||||||
LOGSEVERITY_WARNING,
|
|
||||||
LOGSEVERITY_ERROR,
|
|
||||||
LOGSEVERITY_DISABLE = 99
|
|
||||||
);
|
|
||||||
|
|
||||||
// /include/internal/cef_types.h (cef_scale_factor_t)
|
// /include/internal/cef_types.h (cef_scale_factor_t)
|
||||||
TCefScaleFactor = (
|
TCefScaleFactor = (
|
||||||
SCALE_FACTOR_NONE = 0,
|
SCALE_FACTOR_NONE = 0,
|
||||||
@ -1088,7 +1079,7 @@ type
|
|||||||
on_fullscreen_mode_change: procedure(self: PCefDisplayHandler; browser: PCefBrowser; fullscreen: Integer); stdcall;
|
on_fullscreen_mode_change: procedure(self: PCefDisplayHandler; browser: PCefBrowser; fullscreen: Integer); stdcall;
|
||||||
on_tooltip: function(self: PCefDisplayHandler; browser: PCefBrowser; text: PCefString): Integer; stdcall;
|
on_tooltip: function(self: PCefDisplayHandler; browser: PCefBrowser; text: PCefString): Integer; stdcall;
|
||||||
on_status_message: procedure(self: PCefDisplayHandler; browser: PCefBrowser; const value: PCefString); stdcall;
|
on_status_message: procedure(self: PCefDisplayHandler; browser: PCefBrowser; const value: PCefString); stdcall;
|
||||||
on_console_message: function(self: PCefDisplayHandler; browser: PCefBrowser; const message: PCefString; const source: PCefString; line: Integer): Integer; stdcall;
|
on_console_message: function(self: PCefDisplayHandler; browser: PCefBrowser; level: TCefLogSeverity; const message: PCefString; const source: PCefString; line: Integer): Integer; stdcall;
|
||||||
on_auto_resize: function(self: PCefDisplayHandler; browser: PCefBrowser; const new_size: PCefSize): Integer; stdcall;
|
on_auto_resize: function(self: PCefDisplayHandler; browser: PCefBrowser; const new_size: PCefSize): Integer; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -718,10 +718,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TCefRTTIExtension.Register(const name: string; const value: TValue; SyncMainThread: Boolean);
|
class procedure TCefRTTIExtension.Register(const name: string; const value: TValue; SyncMainThread: Boolean);
|
||||||
|
var
|
||||||
|
TempCode : ustring;
|
||||||
|
TempHandler : ICefv8Handler;
|
||||||
begin
|
begin
|
||||||
CefRegisterExtension(name,
|
TempHandler := TCefRTTIExtension.Create(value, SyncMainThread);
|
||||||
format('__defineSetter__(''%s'', function(v){native function $s();$s(v)});__defineGetter__(''%0:s'', function(){native function $g();return $g()});', [name]),
|
TempCode := format('this.__defineSetter__(''%s'', function(v){native function $s();$s(v)});' +
|
||||||
TCefRTTIExtension.Create(value, SyncMainThread) as ICefv8Handler);
|
'this.__defineGetter__(''%0:s'', function(){native function $g();return $g()});',
|
||||||
|
[name]);
|
||||||
|
|
||||||
|
CefRegisterExtension(name, TempCode, TempHandler);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF CPUX64}
|
{$IFDEF CPUX64}
|
||||||
|
@ -50,17 +50,12 @@ uses
|
|||||||
System.Classes, System.Types,
|
System.Classes, System.Types,
|
||||||
FMX.Types, FMX.Platform, FMX.Controls, FMX.Forms,
|
FMX.Types, FMX.Platform, FMX.Controls, FMX.Forms,
|
||||||
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFMiscFunctions, uCEFClient,
|
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFMiscFunctions, uCEFClient,
|
||||||
uCEFPDFPrintCallback, uCEFStringVisitor, uCEFConstants, uCEFTask,
|
uCEFConstants, uCEFTask, uCEFChromiumEvents, uCEFChromiumOptions, uCEFChromiumFontOptions,
|
||||||
uCEFDeleteCookiesCallback, uCEFDomVisitor, uCEFChromiumEvents,
|
uCEFPDFPrintOptions;
|
||||||
uCEFChromiumOptions, uCEFChromiumFontOptions, uCEFPDFPrintOptions;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TFMXChromium = class(TComponent, IChromiumEvents)
|
TFMXChromium = class(TComponent, IChromiumEvents)
|
||||||
protected
|
protected
|
||||||
FVisitor : ICefStringVisitor;
|
|
||||||
FPDFPrintcb : ICefPdfPrintCallback;
|
|
||||||
FResolveHostcb : ICefResolveCallback;
|
|
||||||
FCookiDeletercb : ICefDeleteCookiesCallback;
|
|
||||||
FHandler : ICefClient;
|
FHandler : ICefClient;
|
||||||
FBrowser : ICefBrowser;
|
FBrowser : ICefBrowser;
|
||||||
FBrowserId : Integer;
|
FBrowserId : Integer;
|
||||||
@ -253,10 +248,6 @@ type
|
|||||||
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): ICefBrowser;
|
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): ICefBrowser;
|
||||||
|
|
||||||
procedure DestroyClientHandler;
|
procedure DestroyClientHandler;
|
||||||
procedure DestroyVisitor;
|
|
||||||
procedure DestroyPDFPrintcb;
|
|
||||||
procedure DestroyResolveHostcb;
|
|
||||||
procedure DestroyCookiDeletercb;
|
|
||||||
|
|
||||||
procedure ClearBrowserReference;
|
procedure ClearBrowserReference;
|
||||||
|
|
||||||
@ -330,7 +321,7 @@ type
|
|||||||
procedure doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); virtual;
|
procedure doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean); virtual;
|
||||||
function doOnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; virtual;
|
function doOnTooltip(const browser: ICefBrowser; var text: ustring): Boolean; virtual;
|
||||||
procedure doOnStatusMessage(const browser: ICefBrowser; const value: ustring); virtual;
|
procedure doOnStatusMessage(const browser: ICefBrowser; const value: ustring); virtual;
|
||||||
function doOnConsoleMessage(const browser: ICefBrowser; const aMessage, source: ustring; line: Integer): Boolean; virtual;
|
function doOnConsoleMessage(const browser: ICefBrowser; level: TCefLogSeverity; const aMessage, source: ustring; line: Integer): Boolean; virtual;
|
||||||
function doOnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; virtual;
|
function doOnAutoResize(const browser: ICefBrowser; const new_size: PCefSize): Boolean; virtual;
|
||||||
|
|
||||||
// ICefDownloadHandler
|
// ICefDownloadHandler
|
||||||
@ -398,12 +389,6 @@ type
|
|||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
||||||
procedure doGetHTML(const aFrameName : ustring); overload;
|
|
||||||
procedure doGetHTML(const aFrame : ICefFrame); overload;
|
|
||||||
procedure doGetHTML(const aFrameIdentifier : int64); overload;
|
|
||||||
procedure doGetText(const aFrameName : ustring); overload;
|
|
||||||
procedure doGetText(const aFrame : ICefFrame); overload;
|
|
||||||
procedure doGetText(const aFrameIdentifier : int64); overload;
|
|
||||||
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
||||||
procedure doTextResultAvailable(const aText : string); virtual;
|
procedure doTextResultAvailable(const aText : string); virtual;
|
||||||
procedure doUpdatePreferences; virtual;
|
procedure doUpdatePreferences; virtual;
|
||||||
@ -659,8 +644,8 @@ implementation
|
|||||||
uses
|
uses
|
||||||
System.SysUtils, System.Math,
|
System.SysUtils, System.Math,
|
||||||
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
||||||
uCEFApplication, uCEFProcessMessage, uOLEDragAndDrop, uCEFRequestContext,
|
uCEFApplication, uCEFProcessMessage, uCEFRequestContext,
|
||||||
uCEFResolveCallback;
|
uCEFPDFPrintCallback, uCEFResolveCallback, uCEFDeleteCookiesCallback, uCEFStringVisitor;
|
||||||
|
|
||||||
constructor TFMXChromium.Create(AOwner: TComponent);
|
constructor TFMXChromium.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -673,10 +658,6 @@ begin
|
|||||||
FOptions := nil;
|
FOptions := nil;
|
||||||
FFontOptions := nil;
|
FFontOptions := nil;
|
||||||
FDefaultEncoding := '';
|
FDefaultEncoding := '';
|
||||||
FVisitor := nil;
|
|
||||||
FPDFPrintcb := nil;
|
|
||||||
FResolveHostcb := nil;
|
|
||||||
FCookiDeletercb := nil;
|
|
||||||
FPDFPrintOptions := nil;
|
FPDFPrintOptions := nil;
|
||||||
FUpdatePreferences := False;
|
FUpdatePreferences := False;
|
||||||
FCustomHeaderName := '';
|
FCustomHeaderName := '';
|
||||||
@ -739,10 +720,6 @@ end;
|
|||||||
procedure TFMXChromium.BeforeDestruction;
|
procedure TFMXChromium.BeforeDestruction;
|
||||||
begin
|
begin
|
||||||
DestroyClientHandler;
|
DestroyClientHandler;
|
||||||
DestroyVisitor;
|
|
||||||
DestroyPDFPrintcb;
|
|
||||||
DestroyResolveHostcb;
|
|
||||||
DestroyCookiDeletercb;
|
|
||||||
|
|
||||||
inherited BeforeDestruction;
|
inherited BeforeDestruction;
|
||||||
end;
|
end;
|
||||||
@ -758,7 +735,7 @@ begin
|
|||||||
try
|
try
|
||||||
if (FHandler <> nil) then
|
if (FHandler <> nil) then
|
||||||
begin
|
begin
|
||||||
FHandler.InitializeVars;
|
FHandler.RemoveReferences;
|
||||||
FHandler := nil;
|
FHandler := nil;
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
@ -767,62 +744,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.DestroyVisitor;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FVisitor <> nil) then
|
|
||||||
begin
|
|
||||||
FVisitor.InitializeVars;
|
|
||||||
FVisitor := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TFMXChromium.DestroyVisitor', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.DestroyPDFPrintcb;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FPDFPrintcb <> nil) then
|
|
||||||
begin
|
|
||||||
FPDFPrintcb.InitializeVars;
|
|
||||||
FPDFPrintcb := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TFMXChromium.DestroyPDFPrintcb', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.DestroyResolveHostcb;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FResolveHostcb <> nil) then
|
|
||||||
begin
|
|
||||||
FResolveHostcb.InitializeVars;
|
|
||||||
FResolveHostcb := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TFMXChromium.DestroyResolveHostcb', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.DestroyCookiDeletercb;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FCookiDeletercb <> nil) then
|
|
||||||
begin
|
|
||||||
FCookiDeletercb.InitializeVars;
|
|
||||||
FCookiDeletercb := nil;
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TFMXChromium.DestroyCookiDeletercb', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.AfterConstruction;
|
procedure TFMXChromium.AfterConstruction;
|
||||||
begin
|
begin
|
||||||
inherited AfterConstruction;
|
inherited AfterConstruction;
|
||||||
@ -1104,12 +1025,13 @@ end;
|
|||||||
procedure TFMXChromium.PrintToPDF(const aFilePath, aTitle, aURL : ustring);
|
procedure TFMXChromium.PrintToPDF(const aFilePath, aTitle, aURL : ustring);
|
||||||
var
|
var
|
||||||
TempSettings : TCefPdfPrintSettings;
|
TempSettings : TCefPdfPrintSettings;
|
||||||
|
TempCallback : ICefPdfPrintCallback;
|
||||||
begin
|
begin
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
GetPrintPDFSettings(TempSettings, aTitle, aURL);
|
GetPrintPDFSettings(TempSettings, aTitle, aURL);
|
||||||
if (FPDFPrintcb = nil) then FPDFPrintcb := TCefCustomPDFPrintCallBack.Create(self);
|
TempCallback := TCefCustomPDFPrintCallBack.Create(self);
|
||||||
FBrowser.Host.PrintToPdf(aFilePath, @TempSettings, FPDFPrintcb);
|
FBrowser.Host.PrintToPdf(aFilePath, @TempSettings, TempCallback);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1739,103 +1661,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.doGetHTML(const aFrameName : ustring);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (length(aFrameName) > 0) then
|
|
||||||
TempFrame := FBrowser.GetFrame(aFrameName)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetSource(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.doGetHTML(const aFrame : ICefFrame);
|
|
||||||
begin
|
|
||||||
if Initialized and (aFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
aFrame.GetSource(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.doGetHTML(const aFrameIdentifier : int64);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (aFrameIdentifier <> 0) then
|
|
||||||
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetSource(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.doGetText(const aFrameName : ustring);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (length(aFrameName) > 0) then
|
|
||||||
TempFrame := FBrowser.GetFrame(aFrameName)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetText(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.doGetText(const aFrame : ICefFrame);
|
|
||||||
begin
|
|
||||||
if Initialized and (aFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
aFrame.GetText(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXChromium.doGetText(const aFrameIdentifier : int64);
|
|
||||||
var
|
|
||||||
TempFrame : ICefFrame;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
if (aFrameIdentifier <> 0) then
|
|
||||||
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
|
||||||
else
|
|
||||||
TempFrame := FBrowser.MainFrame;
|
|
||||||
|
|
||||||
if (TempFrame <> nil) then
|
|
||||||
begin
|
|
||||||
if (FVisitor = nil) then FVisitor := TCustomCefStringVisitor.Create(self);
|
|
||||||
TempFrame.GetText(FVisitor);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TFMXChromium.DeleteCookies : boolean;
|
function TFMXChromium.DeleteCookies : boolean;
|
||||||
var
|
var
|
||||||
TempManager : ICefCookieManager;
|
TempManager : ICefCookieManager;
|
||||||
|
TempCallback : ICefDeleteCookiesCallback;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
@ -1845,9 +1674,8 @@ begin
|
|||||||
|
|
||||||
if (TempManager <> nil) then
|
if (TempManager <> nil) then
|
||||||
begin
|
begin
|
||||||
if (FCookiDeletercb = nil) then FCookiDeletercb := TCefCustomDeleteCookiesCallback.Create(self);
|
TempCallback := TCefCustomDeleteCookiesCallback.Create(self);
|
||||||
|
Result := TempManager.DeleteCookies('', '', TempCallback);
|
||||||
Result := TempManager.DeleteCookies('', '', FCookiDeletercb);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1855,74 +1683,104 @@ end;
|
|||||||
// Leave aFrameName empty to get the HTML source from the main frame
|
// Leave aFrameName empty to get the HTML source from the main frame
|
||||||
procedure TFMXChromium.RetrieveHTML(const aFrameName : ustring);
|
procedure TFMXChromium.RetrieveHTML(const aFrameName : ustring);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetHTMLTask.Create(self, aFrameName);
|
if (length(aFrameName) > 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrame(aFrameName)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetSource(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.RetrieveHTML(const aFrame : ICefFrame);
|
procedure TFMXChromium.RetrieveHTML(const aFrame : ICefFrame);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
if Initialized and (aFrame <> nil) then
|
||||||
if Initialized then
|
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetHTMLTask.Create(self, aFrame);
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
CefPostTask(TID_UI, TempTask);
|
aFrame.GetSource(TempVisitor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.RetrieveHTML(const aFrameIdentifier : int64);
|
procedure TFMXChromium.RetrieveHTML(const aFrameIdentifier : int64);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetHTMLTask.Create(self, aFrameIdentifier);
|
if (aFrameIdentifier <> 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetSource(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Leave aFrameName empty to get the HTML source from the main frame
|
// Leave aFrameName empty to get the HTML source from the main frame
|
||||||
procedure TFMXChromium.RetrieveText(const aFrameName : ustring);
|
procedure TFMXChromium.RetrieveText(const aFrameName : ustring);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetTextTask.Create(self, aFrameName);
|
if (length(aFrameName) > 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrame(aFrameName)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetText(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.RetrieveText(const aFrame : ICefFrame);
|
procedure TFMXChromium.RetrieveText(const aFrame : ICefFrame);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
if Initialized and (aFrame <> nil) then
|
||||||
if Initialized then
|
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetTextTask.Create(self, aFrame);
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
CefPostTask(TID_UI, TempTask);
|
aFrame.GetText(TempVisitor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.RetrieveText(const aFrameIdentifier : int64);
|
procedure TFMXChromium.RetrieveText(const aFrameIdentifier : int64);
|
||||||
var
|
var
|
||||||
TempTask: ICefTask;
|
TempFrame : ICefFrame;
|
||||||
|
TempVisitor : ICefStringVisitor;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnTextResultAvailable event of this class
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
TempTask := TCefGetTextTask.Create(self, aFrameIdentifier);
|
if (aFrameIdentifier <> 0) then
|
||||||
CefPostTask(TID_UI, TempTask);
|
TempFrame := FBrowser.GetFrameByident(aFrameIdentifier)
|
||||||
|
else
|
||||||
|
TempFrame := FBrowser.MainFrame;
|
||||||
|
|
||||||
|
if (TempFrame <> nil) then
|
||||||
|
begin
|
||||||
|
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||||
|
TempFrame.GetText(TempVisitor);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1960,12 +1818,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXChromium.ResolveHost(const aURL : ustring);
|
procedure TFMXChromium.ResolveHost(const aURL : ustring);
|
||||||
|
var
|
||||||
|
TempCallback : ICefResolveCallback;
|
||||||
begin
|
begin
|
||||||
// Results will be received in the OnResolvedHostAvailable event of this class
|
// Results will be received in the OnResolvedHostAvailable event of this class
|
||||||
if Initialized and (length(aURL) > 0) then
|
if Initialized and (length(aURL) > 0) then
|
||||||
begin
|
begin
|
||||||
if (FResolveHostcb = nil) then FResolveHostcb := TCefCustomResolveCallback.Create(self);
|
TempCallback := TCefCustomResolveCallback.Create(self);
|
||||||
FBrowser.Host.RequestContext.ResolveHost(aURL, FResolveHostcb);
|
FBrowser.Host.RequestContext.ResolveHost(aURL, TempCallback);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2731,13 +2591,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TFMXChromium.doOnConsoleMessage(const browser : ICefBrowser;
|
function TFMXChromium.doOnConsoleMessage(const browser : ICefBrowser;
|
||||||
|
level : TCefLogSeverity;
|
||||||
const aMessage : ustring;
|
const aMessage : ustring;
|
||||||
const source : ustring;
|
const source : ustring;
|
||||||
line : Integer): Boolean;
|
line : Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
if Assigned(FOnConsoleMessage) then FOnConsoleMessage(Self, browser, aMessage, source, line, Result);
|
if Assigned(FOnConsoleMessage) then FOnConsoleMessage(Self, browser, level, aMessage, source, line, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFMXChromium.doOnAutoResize(const browser : ICefBrowser;
|
function TFMXChromium.doOnAutoResize(const browser : ICefBrowser;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user