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,27 +57,36 @@ type
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 RemoveReferences; virtual;
public
constructor Create; virtual;
end;
TCustomLoadHandler = class(TCefLoadHandlerOwn)
protected
FEvent: IChromiumEvents;
FEvents : Pointer;
procedure OnLoadingStateChange(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean); override;
procedure OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType); 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 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, uCEFFrame;
procedure cef_load_handler_on_loading_state_change(self: PCefLoadHandler; browser: PCefBrowser; isLoading, canGoBack, canGoForward: Integer); stdcall;
@@ -137,40 +146,61 @@ begin
//
end;
procedure TCefLoadHandlerOwn.RemoveReferences;
begin
//
end;
// TCustomLoadHandler
constructor TCustomLoadHandler.Create(const events: IChromiumEvents);
constructor TCustomLoadHandler.Create(const events : Pointer);
begin
inherited Create;
FEvent := events;
FEvents := events;
end;
destructor TCustomLoadHandler.Destroy;
begin
FEvent := nil;
RemoveReferences;
inherited Destroy;
end;
procedure TCustomLoadHandler.OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
procedure TCustomLoadHandler.RemoveReferences;
begin
if (FEvent <> nil) then FEvent.doOnLoadEnd(browser, frame, httpStatusCode);
FEvents := nil;
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
if (FEvent <> nil) then FEvent.doOnLoadError(browser, frame, errorCode, errorText, failedUrl);
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnLoadEnd(browser, frame, httpStatusCode);
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
if (FEvent <> nil) then FEvent.doOnLoadingStateChange(browser, isLoading, canGoBack, canGoForward);
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnLoadError(browser, frame, errorCode, errorText, failedUrl);
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
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.