1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Update to CEF 101.0.15

This commit is contained in:
salvadordf
2022-05-03 12:43:16 +02:00
parent 455a75c849
commit 3bca41ef4a
22 changed files with 414 additions and 39 deletions

View File

@@ -3,16 +3,16 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file. CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 100.0.24 which includes Chromium 100.0.4896.127. CEF4Delphi uses CEF 101.0.15 which includes Chromium 101.0.4951.54.
The CEF binaries used by CEF4Delphi are available for download at Spotify : The CEF binaries used by CEF4Delphi are available for download at Spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_windows32.tar.bz2) * [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_windows64.tar.bz2) * [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_linux32.tar.bz2) * [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_linux64.tar.bz2) * [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_linuxarm.tar.bz2) * [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_linuxarm64.tar.bz2) * [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_100.0.24%2Bg0783cf8%2Bchromium-100.0.4896.127_macosx64.tar.bz2) * [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.15%2Bgca159c5%2Bchromium-101.0.4951.54_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 11.1 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.0/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components. CEF4Delphi was developed and tested on Delphi 11.1 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.0/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

View File

@@ -285,6 +285,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnStatusMessage = Chromium1StatusMessage OnStatusMessage = Chromium1StatusMessage
OnLoadingProgressChange = Chromium1LoadingProgressChange OnLoadingProgressChange = Chromium1LoadingProgressChange
OnCursorChange = Chromium1CursorChange OnCursorChange = Chromium1CursorChange
OnCanDownload = Chromium1CanDownload
OnBeforeDownload = Chromium1BeforeDownload OnBeforeDownload = Chromium1BeforeDownload
OnDownloadUpdated = Chromium1DownloadUpdated OnDownloadUpdated = Chromium1DownloadUpdated
OnAfterCreated = Chromium1AfterCreated OnAfterCreated = Chromium1AfterCreated
@@ -398,6 +399,10 @@ object MiniBrowserFrm: TMiniBrowserFrm
Caption = 'User agent...' Caption = 'User agent...'
OnClick = Useragent1Click OnClick = Useragent1Click
end end
object Allowdownloads1: TMenuItem
Caption = 'Allow downloads'
OnClick = Allowdownloads1Click
end
object N5: TMenuItem object N5: TMenuItem
Caption = '-' Caption = '-'
end end

View File

@@ -145,6 +145,7 @@ type
ClearallstorageforcurrentURL1: TMenuItem; ClearallstorageforcurrentURL1: TMenuItem;
CEFinfo1: TMenuItem; CEFinfo1: TMenuItem;
SaveasMHTML1: TMenuItem; SaveasMHTML1: TMenuItem;
Allowdownloads1: TMenuItem;
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@@ -186,6 +187,7 @@ type
procedure Chromium1FileDialog(Sender: TObject; const browser: ICefBrowser; mode: Cardinal; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback; out Result: Boolean); procedure Chromium1FileDialog(Sender: TObject; const browser: ICefBrowser; mode: Cardinal; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback; out Result: Boolean);
procedure Chromium1SelectClientCertificate(Sender: TObject; const browser: ICefBrowser; isProxy: Boolean; const host: ustring; port: Integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback; var aResult: Boolean); procedure Chromium1SelectClientCertificate(Sender: TObject; const browser: ICefBrowser; isProxy: Boolean; const host: ustring; port: Integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback; var aResult: Boolean);
procedure Chromium1CursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult: Boolean); procedure Chromium1CursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult: Boolean);
procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser; const url, request_method: ustring; var aResult: Boolean);
procedure BackBtnClick(Sender: TObject); procedure BackBtnClick(Sender: TObject);
procedure ForwardBtnClick(Sender: TObject); procedure ForwardBtnClick(Sender: TObject);
@@ -217,6 +219,7 @@ type
procedure ClearallstorageforcurrentURL1Click(Sender: TObject); procedure ClearallstorageforcurrentURL1Click(Sender: TObject);
procedure CEFinfo1Click(Sender: TObject); procedure CEFinfo1Click(Sender: TObject);
procedure SaveasMHTML1Click(Sender: TObject); procedure SaveasMHTML1Click(Sender: TObject);
procedure Allowdownloads1Click(Sender: TObject);
protected protected
FPendingMsgID : integer; FPendingMsgID : integer;
@@ -225,6 +228,7 @@ type
FHasShutdownReason : boolean; FHasShutdownReason : boolean;
FSelectCertCallback : ICefSelectClientCertificateCallback; FSelectCertCallback : ICefSelectClientCertificateCallback;
FCertificates : TCefX509CertificateArray; FCertificates : TCefX509CertificateArray;
FAllowDownloads : boolean;
FResponse : TStringList; FResponse : TStringList;
FRequest : TStringList; FRequest : TStringList;
@@ -482,6 +486,13 @@ begin
InspectRequest(request); InspectRequest(request);
end; end;
procedure TMiniBrowserFrm.Chromium1CanDownload(Sender: TObject;
const browser: ICefBrowser; const url, request_method: ustring;
var aResult: Boolean);
begin
aResult := FAllowDownloads;
end;
procedure TMiniBrowserFrm.Chromium1CertificateError(Sender: TObject; procedure TMiniBrowserFrm.Chromium1CertificateError(Sender: TObject;
const browser: ICefBrowser; certError: Integer; const browser: ICefBrowser; certError: Integer;
const requestUrl: ustring; const sslInfo: ICefSslInfo; const requestUrl: ustring; const sslInfo: ICefSslInfo;
@@ -872,6 +883,11 @@ begin
end; end;
end; end;
procedure TMiniBrowserFrm.Allowdownloads1Click(Sender: TObject);
begin
FAllowDownloads := not(FAllowDownloads);
end;
procedure TMiniBrowserFrm.ApplicationEvents1Message(var Msg: tagMSG; procedure TMiniBrowserFrm.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean); var Handled: Boolean);
begin begin
@@ -1263,6 +1279,7 @@ begin
FSelectCertCallback := nil; FSelectCertCallback := nil;
FCertificates := nil; FCertificates := nil;
FPendingMsgID := 0; FPendingMsgID := 0;
FAllowDownloads := True;
// Windows may show this text message while shutting down the operating system // Windows may show this text message while shutting down the operating system
FShutdownReason := 'MiniBrowser closing...'; FShutdownReason := 'MiniBrowser closing...';
@@ -1584,6 +1601,8 @@ begin
DevTools1.Caption := 'Hide DevTools' DevTools1.Caption := 'Hide DevTools'
else else
DevTools1.Caption := 'Show DevTools'; DevTools1.Caption := 'Show DevTools';
Allowdownloads1.Checked := FAllowDownloads;
end; end;
procedure TMiniBrowserFrm.Preferences1Click(Sender: TObject); procedure TMiniBrowserFrm.Preferences1Click(Sender: TObject);

View File

@@ -258,6 +258,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnStatusMessage = Chromium1StatusMessage OnStatusMessage = Chromium1StatusMessage
OnLoadingProgressChange = Chromium1LoadingProgressChange OnLoadingProgressChange = Chromium1LoadingProgressChange
OnCursorChange = Chromium1CursorChange OnCursorChange = Chromium1CursorChange
OnCanDownload = Chromium1CanDownload
OnBeforeDownload = Chromium1BeforeDownload OnBeforeDownload = Chromium1BeforeDownload
OnDownloadUpdated = Chromium1DownloadUpdated OnDownloadUpdated = Chromium1DownloadUpdated
OnAfterCreated = Chromium1AfterCreated OnAfterCreated = Chromium1AfterCreated
@@ -349,6 +350,10 @@ object MiniBrowserFrm: TMiniBrowserFrm
Caption = 'Flush cookies' Caption = 'Flush cookies'
OnClick = MenuItem3Click OnClick = MenuItem3Click
end end
object Allowdownloads1: TMenuItem
Caption = 'Allow downloads'
OnClick = Allowdownloads1Click
end
object N5: TMenuItem object N5: TMenuItem
Caption = '-' Caption = '-'
end end

View File

@@ -94,6 +94,7 @@ type
MenuItem4: TMenuItem; MenuItem4: TMenuItem;
MenuItem5: TMenuItem; MenuItem5: TMenuItem;
MenuItem6: TMenuItem; MenuItem6: TMenuItem;
Allowdownloads1: TMenuItem;
NavControlPnl: TPanel; NavControlPnl: TPanel;
NavButtonPnl: TPanel; NavButtonPnl: TPanel;
StatusPnl: TPanel; StatusPnl: TPanel;
@@ -132,7 +133,10 @@ type
OpenfilewithaDAT1: TMenuItem; OpenfilewithaDAT1: TMenuItem;
N5: TMenuItem; N5: TMenuItem;
Memoryinfo1: TMenuItem; Memoryinfo1: TMenuItem;
procedure Allowdownloads1Click(Sender: TObject);
procedure CEFWindowParent1DragDrop(Sender, Source: TObject; X, Y: Integer); procedure CEFWindowParent1DragDrop(Sender, Source: TObject; X, Y: Integer);
procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser;
const url, request_method: ustring; var aResult: boolean);
procedure Chromium1CookiesFlushed(Sender: TObject); procedure Chromium1CookiesFlushed(Sender: TObject);
procedure Chromium1CursorChange(Sender: TObject; procedure Chromium1CursorChange(Sender: TObject;
const browser: ICefBrowser; cursor_: TCefCursorHandle; const browser: ICefBrowser; cursor_: TCefCursorHandle;
@@ -246,11 +250,12 @@ type
var aResult: Boolean); var aResult: Boolean);
protected protected
FResponse : TStringList; FResponse : TStringList;
FRequest : TStringList; FRequest : TStringList;
FNavigation : TStringList; FNavigation : TStringList;
FShutdownReason : string; FShutdownReason : string;
FHasShutdownReason : boolean; FHasShutdownReason : boolean;
FAllowDownloads : boolean;
// Variables to control when can we destroy the form safely // Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
@@ -323,7 +328,8 @@ begin
GlobalCEFApp.cache := 'cache'; GlobalCEFApp.cache := 'cache';
GlobalCEFApp.LogFile := 'debug.log'; GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO; GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
GlobalCEFApp.EnablePrintPreview := True; GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.EnableGPU := True;
end; end;
procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject); procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject);
@@ -1065,6 +1071,7 @@ begin
FRequest := TStringList.Create; FRequest := TStringList.Create;
FNavigation := TStringList.Create; FNavigation := TStringList.Create;
FPendingMsgID := 0; FPendingMsgID := 0;
FAllowDownloads := True;
// Windows may show this text message while shutting down the operating system // Windows may show this text message while shutting down the operating system
FShutdownReason := 'MiniBrowser closing...'; FShutdownReason := 'MiniBrowser closing...';
@@ -1183,6 +1190,18 @@ begin
end; end;
procedure TMiniBrowserFrm.Chromium1CanDownload(Sender: TObject;
const browser: ICefBrowser; const url, request_method: ustring;
var aResult: boolean);
begin
aResult := FAllowDownloads;
end;
procedure TMiniBrowserFrm.Allowdownloads1Click(Sender: TObject);
begin
FAllowDownloads := not(FAllowDownloads);
end;
procedure TMiniBrowserFrm.CookiesFlushedMsg(var aMessage : TMessage); procedure TMiniBrowserFrm.CookiesFlushedMsg(var aMessage : TMessage);
begin begin
showmessage('The cookies were flushed successfully'); showmessage('The cookies were flushed successfully');
@@ -1410,7 +1429,9 @@ begin
if DevTools.Visible then if DevTools.Visible then
DevTools1.Caption := 'Hide DevTools' DevTools1.Caption := 'Hide DevTools'
else else
DevTools1.Caption := 'Show DevTools'; DevTools1.Caption := 'Show DevTools';
Allowdownloads1.Checked := FAllowDownloads;
end; end;
procedure TMiniBrowserFrm.Preferences1Click(Sender: TObject); procedure TMiniBrowserFrm.Preferences1Click(Sender: TObject);

View File

@@ -222,7 +222,8 @@ contains
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas', uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas', uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
uCEFOverlayController in '..\source\uCEFOverlayController.pas', uCEFOverlayController in '..\source\uCEFOverlayController.pas',
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas'; uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas',
uCEFCommandHandler in '..\source\uCEFCommandHandler.pas';
end. end.

View File

@@ -222,7 +222,8 @@ contains
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas', uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
uCEFOverlayController in '..\source\uCEFOverlayController.pas', uCEFOverlayController in '..\source\uCEFOverlayController.pas',
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas', uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas',
uCEFArgCopy in '..\source\uCEFArgCopy.pas'; uCEFArgCopy in '..\source\uCEFArgCopy.pas',
uCEFCommandHandler in '..\source\uCEFCommandHandler.pas';
end. end.

View File

@@ -304,6 +304,7 @@
<DCCReference Include="..\source\uCEFOverlayController.pas"/> <DCCReference Include="..\source\uCEFOverlayController.pas"/>
<DCCReference Include="..\source\uCEFFileDialogInfo.pas"/> <DCCReference Include="..\source\uCEFFileDialogInfo.pas"/>
<DCCReference Include="..\source\uCEFArgCopy.pas"/> <DCCReference Include="..\source\uCEFArgCopy.pas"/>
<DCCReference Include="..\source\uCEFCommandHandler.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>

View File

@@ -21,8 +21,8 @@
</CompilerOptions> </CompilerOptions>
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/> <Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
<License Value="MPL 1.1"/> <License Value="MPL 1.1"/>
<Version Major="100" Release="24"/> <Version Major="101" Release="15"/>
<Files Count="201"> <Files Count="202">
<Item1> <Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/> <Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
<UnitName Value="uCEFAccessibilityHandler"/> <UnitName Value="uCEFAccessibilityHandler"/>
@@ -845,6 +845,10 @@
<Filename Value="..\source\uCEFArgCopy.pas"/> <Filename Value="..\source\uCEFArgCopy.pas"/>
<UnitName Value="uCEFArgCopy"/> <UnitName Value="uCEFArgCopy"/>
</Item201> </Item201>
<Item202>
<Filename Value="..\source\uCEFCommandHandler.pas"/>
<UnitName Value="uCEFCommandHandler"/>
</Item202>
</Files> </Files>
<CompatibilityMode Value="True"/> <CompatibilityMode Value="True"/>
<RequiredPkgs Count="5"> <RequiredPkgs Count="5">

View File

@@ -66,7 +66,7 @@ uses
uCEFWorkSchedulerQueueThread, uCEFLinkedWinControlBase, uCEFLazarusCocoa, uCEFWorkSchedulerQueueThread, uCEFLinkedWinControlBase, uCEFLazarusCocoa,
uCEFBrowserWindow, uCEFOsrBrowserWindow, uCEFTimerWorkScheduler, uCEFBrowserWindow, uCEFOsrBrowserWindow, uCEFTimerWorkScheduler,
uCEFFrameHandler, uCEFOverlayController, uCEFFileDialogInfo, uCEFArgCopy, uCEFFrameHandler, uCEFOverlayController, uCEFFileDialogInfo, uCEFArgCopy,
LazarusPackageIntf; uCEFCommandHandler, LazarusPackageIntf;
implementation implementation

View File

@@ -66,15 +66,15 @@ uses
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar; uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
const const
CEF_SUPPORTED_VERSION_MAJOR = 100; CEF_SUPPORTED_VERSION_MAJOR = 101;
CEF_SUPPORTED_VERSION_MINOR = 0; CEF_SUPPORTED_VERSION_MINOR = 0;
CEF_SUPPORTED_VERSION_RELEASE = 24; CEF_SUPPORTED_VERSION_RELEASE = 15;
CEF_SUPPORTED_VERSION_BUILD = 0; CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 100; CEF_CHROMEELF_VERSION_MAJOR = 101;
CEF_CHROMEELF_VERSION_MINOR = 0; CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 4896; CEF_CHROMEELF_VERSION_RELEASE = 4951;
CEF_CHROMEELF_VERSION_BUILD = 127; CEF_CHROMEELF_VERSION_BUILD = 54;
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
LIBCEF_DLL = 'libcef.dll'; LIBCEF_DLL = 'libcef.dll';
@@ -131,7 +131,6 @@ type
FAcceptLanguageList : ustring; FAcceptLanguageList : ustring;
FCookieableSchemesList : ustring; FCookieableSchemesList : ustring;
FCookieableSchemesExcludeDefaults : boolean; FCookieableSchemesExcludeDefaults : boolean;
FApplicationClientID : ustring;
// Fields used to set command line switches // Fields used to set command line switches
FSingleProcess : boolean; FSingleProcess : boolean;
@@ -446,7 +445,6 @@ type
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList; property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
property CookieableSchemesList : ustring read FCookieableSchemesList write FCookieableSchemesList; property CookieableSchemesList : ustring read FCookieableSchemesList write FCookieableSchemesList;
property CookieableSchemesExcludeDefaults : boolean read FCookieableSchemesExcludeDefaults write FCookieableSchemesExcludeDefaults; property CookieableSchemesExcludeDefaults : boolean read FCookieableSchemesExcludeDefaults write FCookieableSchemesExcludeDefaults;
property ApplicationClientID : ustring read FApplicationClientID write FApplicationClientID;
// Properties used to set command line switches // Properties used to set command line switches
property SingleProcess : Boolean read FSingleProcess write FSingleProcess; // --single-process property SingleProcess : Boolean read FSingleProcess write FSingleProcess; // --single-process
@@ -694,7 +692,6 @@ begin
FAcceptLanguageList := ''; FAcceptLanguageList := '';
FCookieableSchemesList := ''; FCookieableSchemesList := '';
FCookieableSchemesExcludeDefaults := False; FCookieableSchemesExcludeDefaults := False;
FApplicationClientID := '';
// Fields used to set command line switches // Fields used to set command line switches
FSingleProcess := False; FSingleProcess := False;
@@ -1426,7 +1423,6 @@ begin
aSettings.accept_language_list := CefString(FAcceptLanguageList); aSettings.accept_language_list := CefString(FAcceptLanguageList);
aSettings.cookieable_schemes_list := CefString(FCookieableSchemesList); aSettings.cookieable_schemes_list := CefString(FCookieableSchemesList);
aSettings.cookieable_schemes_exclude_defaults := Ord(FCookieableSchemesExcludeDefaults); aSettings.cookieable_schemes_exclude_defaults := Ord(FCookieableSchemesExcludeDefaults);
aSettings.application_client_id_for_file_scanning := CefString(FApplicationClientID);
end; end;
function TCefApplicationCore.InitializeLibrary(const aApp : ICefApp) : boolean; function TCefApplicationCore.InitializeLibrary(const aApp : ICefApp) : boolean;

View File

@@ -198,6 +198,7 @@ type
FOnCursorChange : TOnCursorChange; FOnCursorChange : TOnCursorChange;
// ICefDownloadHandler // ICefDownloadHandler
FOnCanDownload : TOnCanDownloadEvent;
FOnBeforeDownload : TOnBeforeDownload; FOnBeforeDownload : TOnBeforeDownload;
FOnDownloadUpdated : TOnDownloadUpdated; FOnDownloadUpdated : TOnDownloadUpdated;
@@ -316,6 +317,9 @@ type
FOnFrameDetached : TOnFrameDetached; FOnFrameDetached : TOnFrameDetached;
FOnMainFrameChanged : TOnMainFrameChanged; FOnMainFrameChanged : TOnMainFrameChanged;
// ICefCommandHandler
FOnChromeCommand : TOnChromeCommandEvent;
// Custom // Custom
FOnTextResultAvailable : TOnTextResultAvailableEvent; FOnTextResultAvailable : TOnTextResultAvailableEvent;
FOnPdfPrintFinished : TOnPdfPrintFinishedEvent; FOnPdfPrintFinished : TOnPdfPrintFinishedEvent;
@@ -534,6 +538,7 @@ type
procedure doOnCursorChange(const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean); virtual; procedure doOnCursorChange(const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean); virtual;
// ICefDownloadHandler // ICefDownloadHandler
function doOnCanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean;
procedure doOnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); virtual; procedure doOnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); virtual;
procedure doOnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); virtual; procedure doOnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); virtual;
@@ -649,6 +654,9 @@ type
procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame); procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame); procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame);
// ICefCommandHandler
function doOnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean;
// Custom // Custom
procedure GetSettings(var aSettings : TCefBrowserSettings); procedure GetSettings(var aSettings : TCefBrowserSettings);
procedure doCookiesDeleted(numDeleted : integer); virtual; procedure doCookiesDeleted(numDeleted : integer); virtual;
@@ -678,6 +686,7 @@ type
procedure doOnMediaSinkDeviceInfo(const ip_address: ustring; port: integer; const model_name: ustring); virtual; procedure doOnMediaSinkDeviceInfo(const ip_address: ustring; port: integer; const model_name: ustring); virtual;
procedure doBrowserNavigation(aTask : TCefBrowserNavigation); virtual; procedure doBrowserNavigation(aTask : TCefBrowserNavigation); virtual;
function MustCreateAudioHandler : boolean; virtual; function MustCreateAudioHandler : boolean; virtual;
function MustCreateCommandHandler : boolean; virtual;
function MustCreateDevToolsMessageObserver : boolean; virtual; function MustCreateDevToolsMessageObserver : boolean; virtual;
function MustCreateLoadHandler : boolean; virtual; function MustCreateLoadHandler : boolean; virtual;
function MustCreateFocusHandler : boolean; virtual; function MustCreateFocusHandler : boolean; virtual;
@@ -1016,6 +1025,7 @@ type
property OnCursorChange : TOnCursorChange read FOnCursorChange write FOnCursorChange; property OnCursorChange : TOnCursorChange read FOnCursorChange write FOnCursorChange;
// ICefDownloadHandler // ICefDownloadHandler
property OnCanDownload : TOnCanDownloadEvent read FOnCanDownload write FOnCanDownload;
property OnBeforeDownload : TOnBeforeDownload read FOnBeforeDownload write FOnBeforeDownload; property OnBeforeDownload : TOnBeforeDownload read FOnBeforeDownload write FOnBeforeDownload;
property OnDownloadUpdated : TOnDownloadUpdated read FOnDownloadUpdated write FOnDownloadUpdated; property OnDownloadUpdated : TOnDownloadUpdated read FOnDownloadUpdated write FOnDownloadUpdated;
@@ -1135,6 +1145,9 @@ type
property OnFrameAttached : TOnFrameAttached read FOnFrameAttached write FOnFrameAttached; property OnFrameAttached : TOnFrameAttached read FOnFrameAttached write FOnFrameAttached;
property OnFrameDetached : TOnFrameDetached read FOnFrameDetached write FOnFrameDetached; property OnFrameDetached : TOnFrameDetached read FOnFrameDetached write FOnFrameDetached;
property OnMainFrameChanged : TOnMainFrameChanged read FOnMainFrameChanged write FOnMainFrameChanged; property OnMainFrameChanged : TOnMainFrameChanged read FOnMainFrameChanged write FOnMainFrameChanged;
// ICefCommandHandler
property OnChromeCommand : TOnChromeCommandEvent read FOnChromeCommand write FOnChromeCommand;
end; end;
TBrowserInfo = class TBrowserInfo = class
@@ -1734,6 +1747,7 @@ begin
FOnCursorChange := nil; FOnCursorChange := nil;
// ICefDownloadHandler // ICefDownloadHandler
FOnCanDownload := nil;
FOnBeforeDownload := nil; FOnBeforeDownload := nil;
FOnDownloadUpdated := nil; FOnDownloadUpdated := nil;
@@ -1852,6 +1866,9 @@ begin
FOnFrameDetached := nil; FOnFrameDetached := nil;
FOnMainFrameChanged := nil; FOnMainFrameChanged := nil;
// ICefCommandHandler
FOnChromeCommand := nil;
// Custom // Custom
FOnTextResultAvailable := nil; FOnTextResultAvailable := nil;
FOnPdfPrintFinished := nil; FOnPdfPrintFinished := nil;
@@ -2387,6 +2404,7 @@ begin
aSettings.webgl := FOptions.Webgl; aSettings.webgl := FOptions.Webgl;
aSettings.background_color := FOptions.BackgroundColor; aSettings.background_color := FOptions.BackgroundColor;
aSettings.accept_language_list := CefString(FOptions.AcceptLanguageList); aSettings.accept_language_list := CefString(FOptions.AcceptLanguageList);
aSettings.chrome_status_bubble := FOptions.ChromeStatusBubble;
end; end;
end; end;
@@ -4724,7 +4742,8 @@ end;
function TChromiumCore.MustCreateDownloadHandler : boolean; function TChromiumCore.MustCreateDownloadHandler : boolean;
begin begin
Result := assigned(FOnBeforeDownload) or Result := assigned(FOnCanDownload) or
assigned(FOnBeforeDownload) or
assigned(FOnDownloadUpdated); assigned(FOnDownloadUpdated);
end; end;
@@ -4839,6 +4858,11 @@ begin
assigned(FOnMainFrameChanged); assigned(FOnMainFrameChanged);
end; end;
function TChromiumCore.MustCreateCommandHandler : boolean;
begin
Result := assigned(FOnChromeCommand);
end;
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
procedure TChromiumCore.PrefsAvailableMsg(aResultOK : boolean); procedure TChromiumCore.PrefsAvailableMsg(aResultOK : boolean);
begin begin
@@ -5285,6 +5309,16 @@ begin
FOnRunContextMenu(Self, browser, frame, params, model, callback, Result); FOnRunContextMenu(Self, browser, frame, params, model, callback, Result);
end; end;
function TChromiumCore.doOnCanDownload(const browser : ICefBrowser;
const url : ustring;
const request_method : ustring): boolean;
begin
Result := True;
if assigned(FOnCanDownload) then
FOnCanDownload(Self, browser, url, request_method, Result);
end;
procedure TChromiumCore.doOnBeforeDownload(const browser : ICefBrowser; procedure TChromiumCore.doOnBeforeDownload(const browser : ICefBrowser;
const downloadItem : ICefDownloadItem; const downloadItem : ICefDownloadItem;
const suggestedName : ustring; const suggestedName : ustring;
@@ -5795,6 +5829,14 @@ begin
FOnMainFrameChanged(self, browser, old_frame, new_frame); FOnMainFrameChanged(self, browser, old_frame, new_frame);
end; end;
function TChromiumCore.doOnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean;
begin
Result := False;
if assigned(FOnChromeCommand) then
FOnChromeCommand(self, browser, command_id, disposition, Result);
end;
procedure TChromiumCore.doOnFullScreenModeChange(const browser : ICefBrowser; procedure TChromiumCore.doOnFullScreenModeChange(const browser : ICefBrowser;
fullscreen : Boolean); fullscreen : Boolean);
begin begin

View File

@@ -94,6 +94,7 @@ type
TOnCursorChange = procedure(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean) of Object; TOnCursorChange = procedure(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean) of Object;
// ICefDownloadHandler // ICefDownloadHandler
TOnCanDownloadEvent = procedure(Sender: TObject; const browser: ICefBrowser; const url, request_method: ustring; var aResult: boolean) of object;
TOnBeforeDownload = procedure(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback) of object; TOnBeforeDownload = procedure(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback) of object;
TOnDownloadUpdated = procedure(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback) of object; TOnDownloadUpdated = procedure(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback) of object;
@@ -212,6 +213,9 @@ type
TOnFrameDetached = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame) of object; TOnFrameDetached = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame) of object;
TOnMainFrameChanged = procedure(Sender: TObject; const browser: ICefBrowser; const old_frame, new_frame: ICefFrame) of object; TOnMainFrameChanged = procedure(Sender: TObject; const browser: ICefBrowser; const old_frame, new_frame: ICefFrame) of object;
// ICefCommandHandler
TOnChromeCommandEvent = procedure(Sender: TObject; const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition; var aResult: boolean) of object;
// Custom // Custom
TOnTextResultAvailableEvent = procedure(Sender: TObject; const aText : ustring) of object; TOnTextResultAvailableEvent = procedure(Sender: TObject; const aText : ustring) of object;
TOnPdfPrintFinishedEvent = procedure(Sender: TObject; aResultOK : boolean) of object; TOnPdfPrintFinishedEvent = procedure(Sender: TObject; aResultOK : boolean) of object;

View File

@@ -73,6 +73,7 @@ type
FWebgl : TCefState; FWebgl : TCefState;
FBackgroundColor : TCefColor; FBackgroundColor : TCefColor;
FAcceptLanguageList : ustring; FAcceptLanguageList : ustring;
FChromeStatusBubble : TCefState;
public public
constructor Create; virtual; constructor Create; virtual;
@@ -92,6 +93,7 @@ type
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor default 0; property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor default 0;
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList; property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
property WindowlessFrameRate : Integer read FWindowlessFrameRate write FWindowlessFrameRate default CEF_OSR_FRAMERATE_DEFAULT; property WindowlessFrameRate : Integer read FWindowlessFrameRate write FWindowlessFrameRate default CEF_OSR_FRAMERATE_DEFAULT;
property ChromeStatusBubble : TCefState read FChromeStatusBubble write FChromeStatusBubble default STATE_DEFAULT;
end; end;
implementation implementation
@@ -111,6 +113,7 @@ begin
FDatabases := STATE_DEFAULT; FDatabases := STATE_DEFAULT;
FWebgl := STATE_DEFAULT; FWebgl := STATE_DEFAULT;
FBackgroundColor := 0; FBackgroundColor := 0;
FChromeStatusBubble := STATE_DEFAULT;
end; end;
end. end.

View File

@@ -55,6 +55,7 @@ type
TCefClientRef = class(TCefBaseRefCountedRef, ICefClient) TCefClientRef = class(TCefBaseRefCountedRef, ICefClient)
protected protected
procedure GetAudioHandler(var aHandler : ICefAudioHandler); virtual; procedure GetAudioHandler(var aHandler : ICefAudioHandler); virtual;
procedure GetCommandHandler(var aHandler : ICefCommandHandler); virtual;
procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); virtual; procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); virtual;
procedure GetDialogHandler(var aHandler : ICefDialogHandler); virtual; procedure GetDialogHandler(var aHandler : ICefDialogHandler); virtual;
procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); virtual; procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); virtual;
@@ -81,6 +82,7 @@ type
TCefClientOwn = class(TCefBaseRefCountedOwn, ICefClient) TCefClientOwn = class(TCefBaseRefCountedOwn, ICefClient)
protected protected
procedure GetAudioHandler(var aHandler : ICefAudioHandler); virtual; procedure GetAudioHandler(var aHandler : ICefAudioHandler); virtual;
procedure GetCommandHandler(var aHandler : ICefCommandHandler); virtual;
procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); virtual; procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); virtual;
procedure GetDialogHandler(var aHandler : ICefDialogHandler); virtual; procedure GetDialogHandler(var aHandler : ICefDialogHandler); virtual;
procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); virtual; procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); virtual;
@@ -108,6 +110,7 @@ type
protected protected
FEvents : Pointer; FEvents : Pointer;
FAudioHandler : ICefAudioHandler; FAudioHandler : ICefAudioHandler;
FCommandHandler : ICefCommandHandler;
FLoadHandler : ICefLoadHandler; FLoadHandler : ICefLoadHandler;
FFocusHandler : ICefFocusHandler; FFocusHandler : ICefFocusHandler;
FContextMenuHandler : ICefContextMenuHandler; FContextMenuHandler : ICefContextMenuHandler;
@@ -125,6 +128,7 @@ type
FFrameHandler : ICefFrameHandler; FFrameHandler : ICefFrameHandler;
procedure GetAudioHandler(var aHandler : ICefAudioHandler); override; procedure GetAudioHandler(var aHandler : ICefAudioHandler); override;
procedure GetCommandHandler(var aHandler : ICefCommandHandler); override;
procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); override; procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); override;
procedure GetDialogHandler(var aHandler : ICefDialogHandler); override; procedure GetDialogHandler(var aHandler : ICefDialogHandler); override;
procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); override; procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); override;
@@ -163,7 +167,7 @@ uses
uCEFDisplayHandler, uCEFDownloadHandler, uCEFJsDialogHandler, uCEFDisplayHandler, uCEFDownloadHandler, uCEFJsDialogHandler,
uCEFLifeSpanHandler, uCEFRequestHandler, uCEFRenderHandler, uCEFDragHandler, uCEFLifeSpanHandler, uCEFRequestHandler, uCEFRenderHandler, uCEFDragHandler,
uCEFFindHandler, uCEFConstants, uCEFApplicationCore, uCEFFrame, uCEFAudioHandler, uCEFFindHandler, uCEFConstants, uCEFApplicationCore, uCEFFrame, uCEFAudioHandler,
uCEFPrintHandler, uCEFFrameHandler; uCEFPrintHandler, uCEFFrameHandler, uCEFCommandHandler;
// ****************************************************** // ******************************************************
@@ -183,6 +187,11 @@ begin
aHandler := nil; aHandler := nil;
end; end;
procedure TCefClientRef.GetCommandHandler(var aHandler : ICefCommandHandler);
begin
aHandler := nil;
end;
procedure TCefClientRef.GetContextMenuHandler(var aHandler : ICefContextMenuHandler); procedure TCefClientRef.GetContextMenuHandler(var aHandler : ICefContextMenuHandler);
begin begin
aHandler := nil; aHandler := nil;
@@ -291,6 +300,23 @@ begin
end; end;
end; end;
function cef_client_own_get_command_handler(self: PCefClient): PCefCommandHandler; stdcall;
var
TempObject : TObject;
TempHandler : ICefCommandHandler;
begin
Result := nil;
TempObject := CefGetObject(self);
if (TempObject <> nil) and (TempObject is TCefClientOwn) then
try
TCefClientOwn(TempObject).GetCommandHandler(TempHandler);
if (TempHandler <> nil) then Result := TempHandler.Wrap;
finally
TempHandler := nil;
end;
end;
function cef_client_own_get_context_menu_handler(self: PCefClient): PCefContextMenuHandler; stdcall; function cef_client_own_get_context_menu_handler(self: PCefClient): PCefContextMenuHandler; stdcall;
var var
TempObject : TObject; TempObject : TObject;
@@ -572,6 +598,7 @@ begin
with PCefClient(FData)^ do with PCefClient(FData)^ do
begin begin
get_audio_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_audio_handler; get_audio_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_audio_handler;
get_command_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_command_handler;
get_context_menu_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_context_menu_handler; get_context_menu_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_context_menu_handler;
get_dialog_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_dialog_handler; get_dialog_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_dialog_handler;
get_display_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_display_handler; get_display_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_display_handler;
@@ -596,6 +623,11 @@ begin
aHandler := nil; aHandler := nil;
end; end;
procedure TCefClientOwn.GetCommandHandler(var aHandler : ICefCommandHandler);
begin
aHandler := nil;
end;
procedure TCefClientOwn.GetContextMenuHandler(var aHandler : ICefContextMenuHandler); procedure TCefClientOwn.GetContextMenuHandler(var aHandler : ICefContextMenuHandler);
begin begin
aHandler := nil; aHandler := nil;
@@ -707,6 +739,7 @@ begin
else else
begin begin
if events.MustCreateAudioHandler then FAudioHandler := TCustomAudioHandler.Create(events); if events.MustCreateAudioHandler then FAudioHandler := TCustomAudioHandler.Create(events);
if events.MustCreateCommandHandler then FCommandHandler := TCustomCommandHandler.Create(events);
if events.MustCreateLoadHandler then FLoadHandler := TCustomLoadHandler.Create(events); if events.MustCreateLoadHandler then FLoadHandler := TCustomLoadHandler.Create(events);
if events.MustCreateFocusHandler then FFocusHandler := TCustomFocusHandler.Create(events); if events.MustCreateFocusHandler then FFocusHandler := TCustomFocusHandler.Create(events);
if events.MustCreateContextMenuHandler then FContextMenuHandler := TCustomContextMenuHandler.Create(events); if events.MustCreateContextMenuHandler then FContextMenuHandler := TCustomContextMenuHandler.Create(events);
@@ -738,6 +771,7 @@ begin
FEvents := nil; FEvents := nil;
if (FAudioHandler <> nil) then FAudioHandler.RemoveReferences; if (FAudioHandler <> nil) then FAudioHandler.RemoveReferences;
if (FCommandHandler <> nil) then FCommandHandler.RemoveReferences;
if (FLoadHandler <> nil) then FLoadHandler.RemoveReferences; if (FLoadHandler <> nil) then FLoadHandler.RemoveReferences;
if (FFocusHandler <> nil) then FFocusHandler.RemoveReferences; if (FFocusHandler <> nil) then FFocusHandler.RemoveReferences;
if (FContextMenuHandler <> nil) then FContextMenuHandler.RemoveReferences; if (FContextMenuHandler <> nil) then FContextMenuHandler.RemoveReferences;
@@ -758,6 +792,7 @@ end;
procedure TCustomClientHandler.InitializeVars; procedure TCustomClientHandler.InitializeVars;
begin begin
FAudioHandler := nil; FAudioHandler := nil;
FCommandHandler := nil;
FLoadHandler := nil; FLoadHandler := nil;
FFocusHandler := nil; FFocusHandler := nil;
FContextMenuHandler := nil; FContextMenuHandler := nil;
@@ -784,6 +819,14 @@ begin
aHandler := nil; aHandler := nil;
end; end;
procedure TCustomClientHandler.GetCommandHandler(var aHandler : ICefCommandHandler);
begin
if (FCommandHandler <> nil) then
aHandler := FCommandHandler
else
aHandler := nil;
end;
procedure TCustomClientHandler.GetContextMenuHandler(var aHandler : ICefContextMenuHandler); procedure TCustomClientHandler.GetContextMenuHandler(var aHandler : ICefContextMenuHandler);
begin begin
if (FContextMenuHandler <> nil) then if (FContextMenuHandler <> nil) then

View File

@@ -0,0 +1,151 @@
// ************************************************************************
// ***************************** CEF4Delphi *******************************
// ************************************************************************
//
// CEF4Delphi is based on DCEF3 which uses CEF 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 � 2022 Salvador Diaz 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 uCEFCommandHandler;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}
{$I cef.inc}
interface
uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type
TCefCommandHandlerOwn = class(TCefBaseRefCountedOwn, ICefCommandHandler)
protected
function OnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean; virtual;
procedure RemoveReferences; virtual;
public
constructor Create; virtual;
end;
TCustomCommandHandler = class(TCefCommandHandlerOwn)
protected
FEvents : Pointer;
function OnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean; override;
procedure RemoveReferences; override;
public
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
implementation
uses
{$IFDEF DELPHI16_UP}
System.SysUtils,
{$ELSE}
SysUtils,
{$ENDIF}
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
function cef_command_handler_on_chrome_command(self : PCefCommandHandler;
browser : PCefBrowser;
command_id : integer;
disposition : TCefWindowOpenDisposition): Integer; stdcall;
var
TempObject : TObject;
begin
Result := Ord(False);
TempObject := CefGetObject(self);
if (TempObject <> nil) and (TempObject is TCefCommandHandlerOwn) then
Result := Ord(TCefCommandHandlerOwn(TempObject).OnChromeCommand(TCefBrowserRef.UnWrap(browser),
command_id,
disposition));
end;
constructor TCefCommandHandlerOwn.Create;
begin
inherited CreateData(SizeOf(TCefCommandHandler));
PCefCommandHandler(FData)^.on_chrome_command := {$IFDEF FPC}@{$ENDIF}cef_command_handler_on_chrome_command;
end;
function TCefCommandHandlerOwn.OnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean;
begin
Result := False;
end;
procedure TCefCommandHandlerOwn.RemoveReferences;
begin
//
end;
// TCustomCommandHandler
constructor TCustomCommandHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := Pointer(events);
end;
destructor TCustomCommandHandler.Destroy;
begin
RemoveReferences;
inherited Destroy;
end;
procedure TCustomCommandHandler.RemoveReferences;
begin
FEvents := nil;
end;
function TCustomCommandHandler.OnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean;
begin
if (FEvents <> nil) then
Result := IChromiumEvents(FEvents).doOnChromeCommand(browser, command_id, disposition)
else
Result := inherited OnChromeCommand(browser, command_id, disposition);
end;
end.

View File

@@ -381,14 +381,21 @@ const
// /include/internal/cef_types.h (cef_transition_type_t) // /include/internal/cef_types.h (cef_transition_type_t)
TT_LINK = 0; TT_LINK = 0;
TT_EXPLICIT = 1; TT_EXPLICIT = 1;
TT_AUTO_BOOKMARK = 2;
TT_AUTO_SUBFRAME = 3; TT_AUTO_SUBFRAME = 3;
TT_MANUAL_SUBFRAME = 4; TT_MANUAL_SUBFRAME = 4;
TT_GENERATED = 5;
TT_AUTO_TOPLEVEL = 6;
TT_FORM_SUBMIT = 7; TT_FORM_SUBMIT = 7;
TT_RELOAD = 8; TT_RELOAD = 8;
TT_KEYWORD = 9;
TT_KEYWORD_GENERATED = 10;
TT_SOURCE_MASK = $000000FF; TT_SOURCE_MASK = $000000FF;
TT_BLOCKED_FLAG = $00800000; TT_BLOCKED_FLAG = $00800000;
TT_FORWARD_BACK_FLAG = $01000000; TT_FORWARD_BACK_FLAG = $01000000;
TT_DIRECT_LOAD_FLAG = $02000000; TT_DIRECT_LOAD_FLAG = $02000000;
TT_HOME_PAGE_FLAG = $04000000;
TT_FROM_API_FLAG = $08000000;
TT_CHAIN_START_FLAG = $10000000; TT_CHAIN_START_FLAG = $10000000;
TT_CHAIN_END_FLAG = $20000000; TT_CHAIN_END_FLAG = $20000000;
TT_CLIENT_REDIRECT_FLAG = $40000000; TT_CLIENT_REDIRECT_FLAG = $40000000;
@@ -751,7 +758,8 @@ const
{$IFDEF CEF4DELHI_ALLOC_DEBUG} {$IFDEF CEF4DELHI_ALLOC_DEBUG}
CEF4DELPHI_ALLOC_PADDING = Pointer($44332211); // Some random value used as padding CEF4DELPHI_ALLOC_PADDING = Pointer($44332211); // Some random value used as padding
{$ENDIF} {$ENDIF}
implementation
implementation
end. end.

View File

@@ -54,6 +54,7 @@ uses
type type
TCefDownloadHandlerOwn = class(TCefBaseRefCountedOwn, ICefDownloadHandler) TCefDownloadHandlerOwn = class(TCefBaseRefCountedOwn, ICefDownloadHandler)
protected protected
function CanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean; virtual;
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;
@@ -67,6 +68,7 @@ type
protected protected
FEvents : Pointer; FEvents : Pointer;
function CanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean; override;
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;
@@ -83,6 +85,22 @@ uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDownLoadItem, uCEFBeforeDownloadCallback, uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDownLoadItem, uCEFBeforeDownloadCallback,
uCEFDownloadItemCallback; uCEFDownloadItemCallback;
function cef_download_handler_can_download( self : PCefDownloadHandler;
browser : PCefBrowser;
const url : PCefString;
const request_method : PCefString): integer; stdcall;
var
TempObject : TObject;
begin
Result := Ord(True);
TempObject := CefGetObject(self);
if (TempObject <> nil) and (TempObject is TCefDownloadHandlerOwn) then
Result := Ord(TCefDownloadHandlerOwn(TempObject).CanDownload(TCefBrowserRef.UnWrap(browser),
CefString(url),
CefString(request_method)));
end;
procedure cef_download_handler_on_before_download( self : PCefDownloadHandler; procedure cef_download_handler_on_before_download( self : PCefDownloadHandler;
browser : PCefBrowser; browser : PCefBrowser;
download_item : PCefDownloadItem; download_item : PCefDownloadItem;
@@ -121,11 +139,17 @@ begin
with PCefDownloadHandler(FData)^ do with PCefDownloadHandler(FData)^ do
begin begin
can_download := {$IFDEF FPC}@{$ENDIF}cef_download_handler_can_download;
on_before_download := {$IFDEF FPC}@{$ENDIF}cef_download_handler_on_before_download; on_before_download := {$IFDEF FPC}@{$ENDIF}cef_download_handler_on_before_download;
on_download_updated := {$IFDEF FPC}@{$ENDIF}cef_download_handler_on_download_updated; on_download_updated := {$IFDEF FPC}@{$ENDIF}cef_download_handler_on_download_updated;
end; end;
end; end;
function TCefDownloadHandlerOwn.CanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean;
begin
Result := True;
end;
procedure TCefDownloadHandlerOwn.OnBeforeDownload(const browser : ICefBrowser; procedure TCefDownloadHandlerOwn.OnBeforeDownload(const browser : ICefBrowser;
const downloadItem : ICefDownloadItem; const downloadItem : ICefDownloadItem;
const suggestedName : ustring; const suggestedName : ustring;
@@ -167,19 +191,31 @@ begin
FEvents := nil; FEvents := nil;
end; end;
function TCustomDownloadHandler.CanDownload(const browser : ICefBrowser;
const url : ustring;
const request_method : ustring): boolean;
begin
Result := True;
if (FEvents <> nil) then
Result := IChromiumEvents(FEvents).doOnCanDownload(browser, url, request_method);
end;
procedure TCustomDownloadHandler.OnBeforeDownload(const browser : ICefBrowser; procedure TCustomDownloadHandler.OnBeforeDownload(const browser : ICefBrowser;
const downloadItem : ICefDownloadItem; const downloadItem : ICefDownloadItem;
const suggestedName : ustring; const suggestedName : ustring;
const callback : ICefBeforeDownloadCallback); const callback : ICefBeforeDownloadCallback);
begin begin
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnBeforeDownload(browser, downloadItem, suggestedName, callback); if (FEvents <> nil) then
IChromiumEvents(FEvents).doOnBeforeDownload(browser, downloadItem, suggestedName, callback);
end; end;
procedure TCustomDownloadHandler.OnDownloadUpdated(const browser : ICefBrowser; procedure TCustomDownloadHandler.OnDownloadUpdated(const browser : ICefBrowser;
const downloadItem : ICefDownloadItem; const downloadItem : ICefDownloadItem;
const callback : ICefDownloadItemCallback); const callback : ICefDownloadItemCallback);
begin begin
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnDownloadUpdated(browser, downloadItem, callback); if (FEvents <> nil) then
IChromiumEvents(FEvents).doOnDownloadUpdated(browser, downloadItem, callback);
end; end;
end. end.

View File

@@ -81,6 +81,7 @@ type
procedure SetFragmentBaseUrl(const baseUrl: ustring); procedure SetFragmentBaseUrl(const baseUrl: ustring);
procedure ResetFileContents; procedure ResetFileContents;
procedure AddFile(const path, displayName: ustring); procedure AddFile(const path, displayName: ustring);
procedure ClearFilenames;
function GetImage : ICefImage; function GetImage : ICefImage;
function GetImageHotspot : TCefPoint; function GetImageHotspot : TCefPoint;
function HasImage : boolean; function HasImage : boolean;
@@ -103,6 +104,11 @@ begin
PCefDragData(FData)^.add_file(FData, @TempPath, @TempName); PCefDragData(FData)^.add_file(FData, @TempPath, @TempName);
end; end;
procedure TCefDragDataRef.ClearFilenames;
begin
PCefDragData(FData)^.clear_filenames(FData);
end;
function TCefDragDataRef.GetImage : ICefImage; function TCefDragDataRef.GetImage : ICefImage;
begin begin
Result := TCefImageRef.UnWrap(PCefDragData(FData)^.get_image(FData)); Result := TCefImageRef.UnWrap(PCefDragData(FData)^.get_image(FData));

View File

@@ -102,6 +102,7 @@ type
ICefRenderProcessHandler = interface; ICefRenderProcessHandler = interface;
ICefProcessMessage = interface; ICefProcessMessage = interface;
ICefLifeSpanHandler = interface; ICefLifeSpanHandler = interface;
ICefCommandHandler = interface;
ICefGetExtensionResourceCallback = interface; ICefGetExtensionResourceCallback = interface;
ICefExtensionHandler = interface; ICefExtensionHandler = interface;
ICefExtension = interface; ICefExtension = interface;
@@ -346,6 +347,7 @@ type
procedure doOnCursorChange(const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean); procedure doOnCursorChange(const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean);
// ICefDownloadHandler // ICefDownloadHandler
function doOnCanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean;
procedure doOnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback); procedure doOnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback);
procedure doOnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); procedure doOnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback);
@@ -461,6 +463,9 @@ type
procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame); procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame); procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame);
// ICefCommandHandler
function doOnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean;
// Custom // Custom
procedure doCookiesDeleted(numDeleted : integer); procedure doCookiesDeleted(numDeleted : integer);
procedure doPdfPrintFinished(aResultOK : boolean); procedure doPdfPrintFinished(aResultOK : boolean);
@@ -489,6 +494,7 @@ type
procedure doOnMediaSinkDeviceInfo(const ip_address: ustring; port: integer; const model_name: ustring); procedure doOnMediaSinkDeviceInfo(const ip_address: ustring; port: integer; const model_name: ustring);
procedure doBrowserNavigation(aTask : TCefBrowserNavigation); procedure doBrowserNavigation(aTask : TCefBrowserNavigation);
function MustCreateAudioHandler : boolean; function MustCreateAudioHandler : boolean;
function MustCreateCommandHandler : boolean;
function MustCreateLoadHandler : boolean; function MustCreateLoadHandler : boolean;
function MustCreateFocusHandler : boolean; function MustCreateFocusHandler : boolean;
function MustCreateContextMenuHandler : boolean; function MustCreateContextMenuHandler : boolean;
@@ -956,6 +962,7 @@ type
// /include/capi/cef_download_handler_capi.h (cef_download_handler_t) // /include/capi/cef_download_handler_capi.h (cef_download_handler_t)
ICefDownloadHandler = interface(ICefBaseRefCounted) ICefDownloadHandler = interface(ICefBaseRefCounted)
['{3137F90A-5DC5-43C1-858D-A269F28EF4F1}'] ['{3137F90A-5DC5-43C1-858D-A269F28EF4F1}']
function CanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean;
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);
@@ -1813,6 +1820,15 @@ type
procedure RemoveReferences; // custom procedure to clear all references procedure RemoveReferences; // custom procedure to clear all references
end; end;
// TCefCommandHandler
// /include/capi/cef_command_handler_capi.h (cef_command_handler_t)
ICefCommandHandler = interface(ICefBaseRefCounted)
['{7C931B93-53DC-4607-AABB-2CB4AEF7FB96}']
function OnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean;
procedure RemoveReferences; // custom procedure to clear all references
end;
// TCefGetExtensionResourceCallback // TCefGetExtensionResourceCallback
// /include/capi/cef_extension_handler_capi.h (cef_get_extension_resource_callback_t) // /include/capi/cef_extension_handler_capi.h (cef_get_extension_resource_callback_t)
ICefGetExtensionResourceCallback = interface(ICefBaseRefCounted) ICefGetExtensionResourceCallback = interface(ICefBaseRefCounted)
@@ -2067,6 +2083,7 @@ type
ICefClient = interface(ICefBaseRefCounted) ICefClient = interface(ICefBaseRefCounted)
['{1D502075-2FF0-4E13-A112-9E541CD811F4}'] ['{1D502075-2FF0-4E13-A112-9E541CD811F4}']
procedure GetAudioHandler(var aHandler : ICefAudioHandler); procedure GetAudioHandler(var aHandler : ICefAudioHandler);
procedure GetCommandHandler(var aHandler : ICefCommandHandler);
procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler);
procedure GetDialogHandler(var aHandler : ICefDialogHandler); procedure GetDialogHandler(var aHandler : ICefDialogHandler);
procedure GetDisplayHandler(var aHandler : ICefDisplayHandler); procedure GetDisplayHandler(var aHandler : ICefDisplayHandler);
@@ -2159,6 +2176,7 @@ type
procedure SetFragmentBaseUrl(const baseUrl: ustring); procedure SetFragmentBaseUrl(const baseUrl: ustring);
procedure ResetFileContents; procedure ResetFileContents;
procedure AddFile(const path, displayName: ustring); procedure AddFile(const path, displayName: ustring);
procedure ClearFilenames;
function GetImage : ICefImage; function GetImage : ICefImage;
function GetImageHotspot : TCefPoint; function GetImageHotspot : TCefPoint;
function HasImage : boolean; function HasImage : boolean;
@@ -2533,7 +2551,6 @@ type
procedure SetVisible(visible: boolean); procedure SetVisible(visible: boolean);
function IsVisible: boolean; function IsVisible: boolean;
function IsDrawn: boolean; function IsDrawn: boolean;
property ContentsView : ICefView read GetContentsView; property ContentsView : ICefView read GetContentsView;
property Window : ICefWindow read GetWindow; property Window : ICefWindow read GetWindow;
property DockingMode : TCefDockingMode read GetDockingMode; property DockingMode : TCefDockingMode read GetDockingMode;

View File

@@ -70,6 +70,7 @@ type
PCefBinaryValue = ^TCefBinaryValue; PCefBinaryValue = ^TCefBinaryValue;
PCefSchemeRegistrar = ^TCefSchemeRegistrar; PCefSchemeRegistrar = ^TCefSchemeRegistrar;
PCefCommandLine = ^TCefCommandLine; PCefCommandLine = ^TCefCommandLine;
PCefCommandHandler = ^TCefCommandHandler;
PCefBaseRefCounted = ^TCefBaseRefCounted; PCefBaseRefCounted = ^TCefBaseRefCounted;
PCefBaseScoped = ^TCefBaseScoped; PCefBaseScoped = ^TCefBaseScoped;
PCefWindowInfo = ^TCefWindowInfo; PCefWindowInfo = ^TCefWindowInfo;
@@ -751,7 +752,9 @@ type
WOD_NEW_WINDOW, WOD_NEW_WINDOW,
WOD_SAVE_TO_DISK, WOD_SAVE_TO_DISK,
WOD_OFF_THE_RECORD, WOD_OFF_THE_RECORD,
WOD_IGNORE_ACTION WOD_IGNORE_ACTION,
WOD_SWITCH_TO_TAB,
WOD_NEW_PICTURE_IN_PICTURE
); );
// /include/internal/cef_types.h (cef_text_input_mode_t) // /include/internal/cef_types.h (cef_text_input_mode_t)
@@ -1220,7 +1223,6 @@ type
accept_language_list : TCefString; accept_language_list : TCefString;
cookieable_schemes_list : TCefString; cookieable_schemes_list : TCefString;
cookieable_schemes_exclude_defaults : integer; cookieable_schemes_exclude_defaults : integer;
application_client_id_for_file_scanning : TCefString;
end; end;
// /include/internal/cef_types_win.h (cef_window_info_t) // /include/internal/cef_types_win.h (cef_window_info_t)
@@ -1323,6 +1325,7 @@ type
webgl : TCefState; webgl : TCefState;
background_color : TCefColor; background_color : TCefColor;
accept_language_list : TCefString; accept_language_list : TCefString;
chrome_status_bubble : TCefState;
end; end;
// /include/internal/cef_types.h (cef_screen_info_t) // /include/internal/cef_types.h (cef_screen_info_t)
@@ -1545,6 +1548,7 @@ type
// /include/capi/cef_download_handler_capi.h (cef_download_handler_t) // /include/capi/cef_download_handler_capi.h (cef_download_handler_t)
TCefDownloadHandler = record TCefDownloadHandler = record
base : TCefBaseRefCounted; base : TCefBaseRefCounted;
can_download : function(self: PCefDownloadHandler; browser: PCefBrowser; const url, request_method: PCefString): integer; stdcall;
on_before_download : procedure(self: PCefDownloadHandler; browser: PCefBrowser; download_item: PCefDownloadItem; const suggested_name: PCefString; callback: PCefBeforeDownloadCallback); stdcall; on_before_download : procedure(self: PCefDownloadHandler; browser: PCefBrowser; download_item: PCefDownloadItem; const suggested_name: PCefString; callback: PCefBeforeDownloadCallback); stdcall;
on_download_updated : procedure(self: PCefDownloadHandler; browser: PCefBrowser; download_item: PCefDownloadItem; callback: PCefDownloadItemCallback); stdcall; on_download_updated : procedure(self: PCefDownloadHandler; browser: PCefBrowser; download_item: PCefDownloadItem; callback: PCefDownloadItemCallback); stdcall;
end; end;
@@ -2270,6 +2274,7 @@ type
set_fragment_base_url : procedure(self: PCefDragData; const base_url: PCefString); stdcall; set_fragment_base_url : procedure(self: PCefDragData; const base_url: PCefString); stdcall;
reset_file_contents : procedure(self: PCefDragData); stdcall; reset_file_contents : procedure(self: PCefDragData); stdcall;
add_file : procedure(self: PCefDragData; const path, display_name: PCefString); stdcall; add_file : procedure(self: PCefDragData; const path, display_name: PCefString); stdcall;
clear_filenames : procedure(self: PCefDragData); stdcall;
get_image : function(self: PCefDragData): PCefImage; stdcall; get_image : function(self: PCefDragData): PCefImage; stdcall;
get_image_hotspot : function(self: PCefDragData): PCefPoint; stdcall; get_image_hotspot : function(self: PCefDragData): PCefPoint; stdcall;
has_image : function(self: PCefDragData): Integer; stdcall; has_image : function(self: PCefDragData): Integer; stdcall;
@@ -2300,6 +2305,12 @@ type
prepend_wrapper : procedure(self: PCefCommandLine; const wrapper: PCefString); stdcall; prepend_wrapper : procedure(self: PCefCommandLine; const wrapper: PCefString); stdcall;
end; end;
// /include/capi/cef_command_handler_capi.h (cef_command_handler_t)
TCefCommandHandler = record
base : TCefBaseRefCounted;
on_chrome_command : function(self: PCefCommandHandler; browser: PCefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): Integer; stdcall;
end;
// /include/capi/cef_scheme_capi.h (cef_scheme_registrar_t) // /include/capi/cef_scheme_capi.h (cef_scheme_registrar_t)
TCefSchemeRegistrar = record TCefSchemeRegistrar = record
base : TCefBaseScoped; base : TCefBaseScoped;
@@ -2823,6 +2834,7 @@ type
TCefClient = record TCefClient = record
base : TCefBaseRefCounted; base : TCefBaseRefCounted;
get_audio_handler : function(self: PCefClient): PCefAudioHandler; stdcall; get_audio_handler : function(self: PCefClient): PCefAudioHandler; stdcall;
get_command_handler : function(self: PCefClient): PCefCommandHandler; stdcall;
get_context_menu_handler : function(self: PCefClient): PCefContextMenuHandler; stdcall; get_context_menu_handler : function(self: PCefClient): PCefContextMenuHandler; stdcall;
get_dialog_handler : function(self: PCefClient): PCefDialogHandler; stdcall; get_dialog_handler : function(self: PCefClient): PCefDialogHandler; stdcall;
get_display_handler : function(self: PCefClient): PCefDisplayHandler; stdcall; get_display_handler : function(self: PCefClient): PCefDisplayHandler; stdcall;

View File

@@ -2,9 +2,9 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 392, "InternalVersion" : 393,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "100.0.24.0" "Version" : "101.0.15.0"
} }
], ],
"UpdatePackageData" : { "UpdatePackageData" : {