1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-08-04 21:32:54 +02:00

Update to CEF 79.0.10

- Removed CEFSentinel from some demos because it's no longer necessary.
- Updated copyright year.
This commit is contained in:
Salvador Díaz Fau
2020-01-01 12:48:10 +01:00
parent 4b585809ed
commit fd1e936198
289 changed files with 2824 additions and 537 deletions

View File

@ -77,9 +77,4 @@ object Form1: TForm1
Left = 56
Top = 152
end
object CEFSentinel1: TCEFSentinel
OnClose = CEFSentinel1Close
Left = 56
Top = 224
end
end

View File

@ -10,7 +10,7 @@
// For more information about CEF4Delphi visit :
// https://www.briskbard.com/index.php?lang=en&pageid=cef
//
// Copyright � 2019 Salvador Diaz Fau. All rights reserved.
// Copyright � 2020 Salvador Diaz Fau. All rights reserved.
//
// ************************************************************************
// ************ vvvv Original license and comments below vvvv *************
@ -50,7 +50,7 @@ uses
Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
{$ENDIF}
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes,
uCEFWinControl, uCEFSentinel;
uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
type
TForm1 = class(TForm)
@ -60,7 +60,6 @@ type
Timer1: TTimer;
Chromium1: TChromium;
CEFWindowParent1: TCEFWindowParent;
CEFSentinel1: TCEFSentinel;
procedure GoBtnClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
@ -85,7 +84,6 @@ type
const targetUrl: ustring;
targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean;
out Result: Boolean);
procedure CEFSentinel1Close(Sender: TObject);
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
@ -132,8 +130,7 @@ uses
// =================
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose calls TCEFSentinel.Start, which will trigger TCEFSentinel.OnClose when the renderer processes are closed.
// 4. TCEFSentinel.OnClose sets FCanClose := True and sends WM_CLOSE to the form.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
@ -165,12 +162,6 @@ begin
if not(Chromium1.CreateBrowser(CEFWindowParent1)) then Timer1.Enabled := True;
end;
procedure TForm1.CEFSentinel1Close(Sender: TObject);
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
procedure TForm1.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.
@ -180,7 +171,8 @@ end;
procedure TForm1.Chromium1BeforeClose(Sender: TObject;
const browser: ICefBrowser);
begin
CEFSentinel1.Start;
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
procedure TForm1.Chromium1BeforePopup(Sender: TObject;