1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +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:
Salvador Díaz Fau
2018-02-03 17:52:48 +01:00
parent fed1c04a3f
commit e29989623e
52 changed files with 4053 additions and 954 deletions

View File

@@ -57,7 +57,9 @@ uses
type
TCefDialogHandlerOwn = class(TCefBaseRefCountedOwn, ICefDialogHandler)
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
constructor Create; virtual;
@@ -65,18 +67,25 @@ type
TCustomDialogHandler = class(TCefDialogHandlerOwn)
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
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
constructor Create(const events: Pointer); reintroduce; virtual;
destructor Destroy; override;
end;
implementation
uses
{$IFDEF DELPHI16_UP}
System.SysUtils,
{$ELSE}
SysUtils,
{$ENDIF}
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFileDialogCallback;
function cef_dialog_handler_on_file_dialog(self: PCefDialogHandler; browser: PCefBrowser;
@@ -119,22 +128,32 @@ begin
Result := False;
end;
procedure TCefDialogHandlerOwn.RemoveReferences;
begin
//
end;
// TCustomDialogHandler
constructor TCustomDialogHandler.Create(const events: IChromiumEvents);
constructor TCustomDialogHandler.Create(const events: Pointer);
begin
inherited Create;
FEvent := events;
FEvents := events;
end;
destructor TCustomDialogHandler.Destroy;
begin
FEvent := nil;
RemoveReferences;
inherited Destroy;
end;
procedure TCustomDialogHandler.RemoveReferences;
begin
FEvents := nil;
end;
function TCustomDialogHandler.OnFileDialog(const browser : ICefBrowser;
mode : TCefFileDialogMode;
const title : ustring;
@@ -143,10 +162,12 @@ function TCustomDialogHandler.OnFileDialog(const browser : ICefBrow
selectedAcceptFilter : Integer;
const callback : ICefFileDialogCallback): Boolean;
begin
if (FEvent <> nil) then
Result := FEvent.doOnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback)
if (FEvents <> nil) then
Result := IChromiumEvents(FEvents).doOnFileDialog(browser, mode, title, defaultFilePath,
acceptFilters, selectedAcceptFilter, callback)
else
Result := inherited OnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback);
Result := inherited OnFileDialog(browser, mode, title, defaultFilePath,
acceptFilters, selectedAcceptFilter, callback);
end;
end.