1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Fixed the CustomResourceHandler demo

- Added TCEFSentinel to more demos
This commit is contained in:
Salvador Díaz Fau
2019-10-14 15:39:27 +02:00
parent 77121dc510
commit 4d994de2e9
99 changed files with 1179 additions and 512 deletions

View File

@ -49,14 +49,19 @@ uses
LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, ComCtrls, StdCtrls,
{$ENDIF}
uCEFInterfaces, uCEFUrlRequestClientComponent, uCEFRequest, uCEFUrlRequest;
uCEFInterfaces, uCEFUrlRequestClientComponent, uCEFRequest, uCEFUrlRequest,
uCEFSentinel;
const
URLREQUEST_SUCCESS = WM_APP + $101;
URLREQUEST_ERROR = WM_APP + $102;
type
{ TURLRequestFrm }
TURLRequestFrm = class(TForm)
CEFSentinel1: TCEFSentinel;
StatusBar1: TStatusBar;
SaveDialog1: TSaveDialog;
CEFUrlRequestClientComponent1: TCEFUrlRequestClientComponent;
@ -80,6 +85,7 @@ type
PostParam2NameEdt: TEdit;
PostParam2ValueEdt: TEdit;
procedure CEFSentinel1Close(Sender: TObject);
procedure DownloadBtnClick(Sender: TObject);
procedure SendPostReqBtnClick(Sender: TObject);
@ -197,6 +203,12 @@ begin
end;
end;
procedure TURLRequestFrm.CEFSentinel1Close(Sender: TObject);
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
procedure TURLRequestFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := FCanClose or not(FBusy);
@ -346,10 +358,7 @@ begin
// Use request.response here to get a ICefResponse interface with all the response headers, status, error code, etc.
if FClosing then
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end
CEFSentinel1.Start
else
if (request <> nil) and (request.RequestStatus = UR_SUCCESS) then
PostMessage(Handle, URLREQUEST_SUCCESS, 0, 0)