You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-08-14 21:42:50 +02:00
Fixed "error 217" in Lazarus with TCEFSentinel
- Removed TCEFSentinel from CookieVisitor and CustomResourceBrowser in Lazarus
This commit is contained in:
@@ -51,7 +51,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls, ClipBrd,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls, ClipBrd,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uMainForm, uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes,
|
uMainForm, uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes,
|
||||||
uCEFWinControl;
|
uCEFWinControl, uCEFChromiumCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
TChildForm = class(TForm)
|
TChildForm = class(TForm)
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="6">
|
<Units Count="7">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="CookieVisitor.lpr"/>
|
<Filename Value="CookieVisitor.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@@ -22,13 +22,11 @@
|
|||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<TopLine Value="229"/>
|
<TopLine Value="145"/>
|
||||||
<CursorPos X="17" Y="250"/>
|
<CursorPos X="31" Y="167"/>
|
||||||
<UsageCount Value="24"/>
|
<UsageCount Value="24"/>
|
||||||
<Bookmarks Count="3">
|
<Bookmarks Count="1">
|
||||||
<Item0 Y="380" ID="1"/>
|
<Item0 X="66" Y="256" ID="3"/>
|
||||||
<Item1 X="3" Y="205" ID="2"/>
|
|
||||||
<Item2 X="66" Y="259" ID="3"/>
|
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
@@ -55,8 +53,8 @@
|
|||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\..\..\source\uCEFChromiumCore.pas"/>
|
<Filename Value="..\..\..\source\uCEFChromiumCore.pas"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="40"/>
|
<TopLine Value="37"/>
|
||||||
<CursorPos X="3" Y="61"/>
|
<CursorPos X="30" Y="57"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
@@ -67,120 +65,111 @@
|
|||||||
<CursorPos X="3" Y="68"/>
|
<CursorPos X="3" Y="68"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="..\..\..\source\uCEFSentinel.pas"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="74"/>
|
||||||
|
<CursorPos X="14" Y="63"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Bookmarks Count="2">
|
||||||
|
<Item0 X="66" Y="60" ID="1"/>
|
||||||
|
<Item1 X="76" Y="164" ID="2"/>
|
||||||
|
</Bookmarks>
|
||||||
|
</Unit6>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="28" HistoryIndex="27">
|
<JumpHistory Count="23" HistoryIndex="22">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="252" Column="3" TopLine="239"/>
|
<Caret Line="191" Column="62" TopLine="176"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="79" Column="67" TopLine="75"/>
|
<Caret Line="120" Column="67" TopLine="106"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="352" Column="38" TopLine="336"/>
|
<Caret Line="339" Column="31" TopLine="324"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="41" Column="100" TopLine="29"/>
|
<Caret Line="117" Column="84" TopLine="94"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="99" Column="40" TopLine="71"/>
|
<Caret Line="115" Column="96" TopLine="95"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="119" Column="15" TopLine="103"/>
|
<Caret Line="119" Column="87" TopLine="95"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="191" Column="3" TopLine="182"/>
|
<Caret Line="245" Column="11" TopLine="222"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="339" Column="60" TopLine="324"/>
|
<Caret Line="340" TopLine="325"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="191" Column="62" TopLine="176"/>
|
<Caret Line="339" Column="74" TopLine="325"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="120" Column="67" TopLine="106"/>
|
<Caret Line="216" Column="51" TopLine="202"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="339" Column="31" TopLine="324"/>
|
<Caret Line="340" Column="68" TopLine="326"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="117" Column="84" TopLine="94"/>
|
<Caret Line="121" Column="15" TopLine="109"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="115" Column="96" TopLine="95"/>
|
<Caret Line="198" Column="5" TopLine="190"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="119" Column="87" TopLine="95"/>
|
<Caret Line="221" Column="66" TopLine="208"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="245" Column="11" TopLine="222"/>
|
<Caret Line="198" Column="28" TopLine="178"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="340" TopLine="325"/>
|
<Caret Line="83" Column="72" TopLine="75"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="339" Column="74" TopLine="325"/>
|
<Caret Line="236" Column="13" TopLine="232"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="216" Column="51" TopLine="202"/>
|
<Caret Line="66" Column="3" TopLine="37"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="340" Column="68" TopLine="326"/>
|
<Caret Line="252" Column="9" TopLine="233"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="121" Column="15" TopLine="109"/>
|
<Caret Line="250" Column="17" TopLine="229"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="198" Column="5" TopLine="190"/>
|
<Caret Line="249" Column="17" TopLine="228"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="221" Column="66" TopLine="208"/>
|
<Caret Line="294" Column="47" TopLine="282"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
<Filename Value="uCookieVisitor.pas"/>
|
||||||
<Caret Line="198" Column="28" TopLine="178"/>
|
<Caret Line="78" TopLine="63"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
|
||||||
<Caret Line="83" Column="72" TopLine="75"/>
|
|
||||||
</Position24>
|
|
||||||
<Position25>
|
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
|
||||||
<Caret Line="236" Column="13" TopLine="232"/>
|
|
||||||
</Position25>
|
|
||||||
<Position26>
|
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
|
||||||
<Caret Line="66" Column="3" TopLine="37"/>
|
|
||||||
</Position26>
|
|
||||||
<Position27>
|
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
|
||||||
<Caret Line="252" Column="9" TopLine="233"/>
|
|
||||||
</Position27>
|
|
||||||
<Position28>
|
|
||||||
<Filename Value="uCookieVisitor.pas"/>
|
|
||||||
<Caret Line="250" Column="17" TopLine="229"/>
|
|
||||||
</Position28>
|
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
|
@@ -79,9 +79,4 @@ object CookieVisitorFrm: TCookieVisitorFrm
|
|||||||
left = 32
|
left = 32
|
||||||
top = 280
|
top = 280
|
||||||
end
|
end
|
||||||
object CEFSentinel1: TCEFSentinel
|
|
||||||
OnClose = CEFSentinel1Close
|
|
||||||
left = 32
|
|
||||||
top = 352
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@@ -70,13 +70,11 @@ type
|
|||||||
|
|
||||||
TCookieVisitorFrm = class(TForm)
|
TCookieVisitorFrm = class(TForm)
|
||||||
AddressBarPnl: TPanel;
|
AddressBarPnl: TPanel;
|
||||||
CEFSentinel1: TCEFSentinel;
|
|
||||||
Edit1: TEdit;
|
Edit1: TEdit;
|
||||||
GoBtn: TButton;
|
GoBtn: TButton;
|
||||||
CEFWindowParent1: TCEFWindowParent;
|
CEFWindowParent1: TCEFWindowParent;
|
||||||
Chromium1: TChromium;
|
Chromium1: TChromium;
|
||||||
Timer1: TTimer;
|
Timer1: TTimer;
|
||||||
procedure CEFSentinel1Close(Sender: TObject);
|
|
||||||
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1CanSaveCookie(Sender: TObject;
|
procedure Chromium1CanSaveCookie(Sender: TObject;
|
||||||
const browser: ICefBrowser; const frame: ICefFrame;
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
@@ -166,8 +164,7 @@ uses
|
|||||||
// =================
|
// =================
|
||||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
|
// 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.
|
// 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.
|
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||||
// 4. TCEFSentinel.OnClose sets FCanClose := True and sends WM_CLOSE to the form.
|
|
||||||
|
|
||||||
procedure CreateGlobalCEFApp;
|
procedure CreateGlobalCEFApp;
|
||||||
begin
|
begin
|
||||||
@@ -290,17 +287,12 @@ begin
|
|||||||
PostMessage(Handle, MINIBROWSER_SHOWCOOKIES, 0, 0);
|
PostMessage(Handle, MINIBROWSER_SHOWCOOKIES, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCookieVisitorFrm.CEFSentinel1Close(Sender: TObject);
|
procedure TCookieVisitorFrm.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
FCanClose := True;
|
FCanClose := True;
|
||||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCookieVisitorFrm.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
CEFSentinel1.Start;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCookieVisitorFrm.Chromium1BeforeContextMenu(Sender: TObject;
|
procedure TCookieVisitorFrm.Chromium1BeforeContextMenu(Sender: TObject;
|
||||||
const browser: ICefBrowser; const frame: ICefFrame;
|
const browser: ICefBrowser; const frame: ICefFrame;
|
||||||
const params: ICefContextMenuParams; const model: ICefMenuModel);
|
const params: ICefContextMenuParams; const model: ICefMenuModel);
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="7">
|
<Units Count="8">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="CRBrowser.lpr"/>
|
<Filename Value="CRBrowser.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="2"/>
|
||||||
<TopLine Value="88"/>
|
<TopLine Value="153"/>
|
||||||
<CursorPos X="82" Y="113"/>
|
<CursorPos X="49" Y="172"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
@@ -68,8 +68,15 @@
|
|||||||
<CursorPos X="3" Y="125"/>
|
<CursorPos X="3" Y="125"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit6>
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="..\..\..\source\uCEFSentinel.pas"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="140"/>
|
||||||
|
<CursorPos X="41" Y="162"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="16" HistoryIndex="15">
|
<JumpHistory Count="27" HistoryIndex="26">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="uMainForm.pas"/>
|
<Filename Value="uMainForm.pas"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
@@ -133,6 +140,50 @@
|
|||||||
<Filename Value="uMainForm.pas"/>
|
<Filename Value="uMainForm.pas"/>
|
||||||
<Caret Line="124" Column="44" TopLine="102"/>
|
<Caret Line="124" Column="44" TopLine="102"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="104" Column="52" TopLine="49"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="104" Column="52" TopLine="49"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="103" Column="52" TopLine="74"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="66" Column="26" TopLine="59"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="161" Column="30" TopLine="150"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="66" TopLine="51"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="155" Column="45" TopLine="134"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="66" Column="42" TopLine="51"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="153" TopLine="129"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="66" Column="66" TopLine="51"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="uMainForm.pas"/>
|
||||||
|
<Caret Line="168" Column="51" TopLine="153"/>
|
||||||
|
</Position27>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
|
@@ -14,7 +14,7 @@ object MainForm: TMainForm
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '2.0.4.0'
|
LCLVersion = '2.0.6.0'
|
||||||
object ChromiumWindow1: TChromiumWindow
|
object ChromiumWindow1: TChromiumWindow
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 637
|
Height = 637
|
||||||
@@ -24,7 +24,6 @@ object MainForm: TMainForm
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnClose = ChromiumWindow1Close
|
OnClose = ChromiumWindow1Close
|
||||||
OnBeforeClose = ChromiumWindow1BeforeClose
|
OnBeforeClose = ChromiumWindow1BeforeClose
|
||||||
OnAfterCreated = ChromiumWindow1AfterCreated
|
|
||||||
end
|
end
|
||||||
object AddressBarPnl: TPanel
|
object AddressBarPnl: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
@@ -66,9 +65,4 @@ object MainForm: TMainForm
|
|||||||
left = 48
|
left = 48
|
||||||
top = 240
|
top = 240
|
||||||
end
|
end
|
||||||
object CEFSentinel1: TCEFSentinel
|
|
||||||
OnClose = CEFSentinel1Close
|
|
||||||
left = 48
|
|
||||||
top = 320
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@@ -57,15 +57,12 @@ type
|
|||||||
{ TMainForm }
|
{ TMainForm }
|
||||||
|
|
||||||
TMainForm = class(TForm)
|
TMainForm = class(TForm)
|
||||||
CEFSentinel1: TCEFSentinel;
|
|
||||||
ChromiumWindow1: TChromiumWindow;
|
ChromiumWindow1: TChromiumWindow;
|
||||||
AddressBarPnl: TPanel;
|
AddressBarPnl: TPanel;
|
||||||
Edit1: TEdit;
|
Edit1: TEdit;
|
||||||
Button1: TButton;
|
Button1: TButton;
|
||||||
Timer1: TTimer;
|
Timer1: TTimer;
|
||||||
|
|
||||||
procedure CEFSentinel1Close(Sender: TObject);
|
|
||||||
procedure ChromiumWindow1AfterCreated(Sender: TObject);
|
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure Button1Click(Sender: TObject);
|
procedure Button1Click(Sender: TObject);
|
||||||
procedure Timer1Timer(Sender: TObject);
|
procedure Timer1Timer(Sender: TObject);
|
||||||
@@ -109,8 +106,7 @@ uses
|
|||||||
// =================
|
// =================
|
||||||
// 1. The FormCloseQuery event sets CanClose to False and calls TChromiumWindow.CloseBrowser, which triggers the TChromiumWindow.OnClose event.
|
// 1. The FormCloseQuery event sets CanClose to False and calls TChromiumWindow.CloseBrowser, which triggers the TChromiumWindow.OnClose event.
|
||||||
// 2. The TChromiumWindow.OnClose event calls TChromiumWindow.DestroyChildWindow which triggers the TChromiumWindow.OnBeforeClose event.
|
// 2. The TChromiumWindow.OnClose event calls TChromiumWindow.DestroyChildWindow which triggers the TChromiumWindow.OnBeforeClose event.
|
||||||
// 3. TChromiumWindow.OnBeforeClose calls TCEFSentinel.Start, which will trigger TCEFSentinel.OnClose when the renderer processes are closed.
|
// 3. TChromiumWindow.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||||
// 4. TCEFSentinel.OnClose sets FCanClose := True and sends WM_CLOSE to the form.
|
|
||||||
|
|
||||||
procedure CreateGlobalCEFApp;
|
procedure CreateGlobalCEFApp;
|
||||||
begin
|
begin
|
||||||
@@ -153,17 +149,6 @@ begin
|
|||||||
if not(ChromiumWindow1.CreateBrowser) then Timer1.Enabled := True;
|
if not(ChromiumWindow1.CreateBrowser) then Timer1.Enabled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.ChromiumWindow1AfterCreated(Sender: TObject);
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMainForm.CEFSentinel1Close(Sender: TObject);
|
|
||||||
begin
|
|
||||||
FCanClose := True;
|
|
||||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMainForm.Timer1Timer(Sender: TObject);
|
procedure TMainForm.Timer1Timer(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Timer1.Enabled := False;
|
Timer1.Enabled := False;
|
||||||
@@ -173,13 +158,18 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.ChromiumWindow1BeforeClose(Sender: TObject);
|
procedure TMainForm.ChromiumWindow1BeforeClose(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CEFSentinel1.Start;
|
FCanClose := True;
|
||||||
|
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.ChromiumWindow1Close(Sender: TObject);
|
procedure TMainForm.ChromiumWindow1Close(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
// DestroyChildWindow will destroy the child window created by CEF at the top of the Z order.
|
// DestroyChildWindow will destroy the child window created by CEF at the top of the Z order.
|
||||||
if not(ChromiumWindow1.DestroyChildWindow) then CEFSentinel1.Start;
|
if not(ChromiumWindow1.DestroyChildWindow) then
|
||||||
|
begin
|
||||||
|
FCanClose := True;
|
||||||
|
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.Chromium_OnAfterCreated(Sender: TObject);
|
procedure TMainForm.Chromium_OnAfterCreated(Sender: TObject);
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="11"/>
|
<Version Value="11"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="2">
|
<Units Count="5">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="SimpleServer.lpr"/>
|
<Filename Value="SimpleServer.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@@ -19,18 +19,72 @@
|
|||||||
<ComponentName Value="SimpleServerFrm"/>
|
<ComponentName Value="SimpleServerFrm"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
|
<WindowIndex Value="-1"/>
|
||||||
<TopLine Value="61"/>
|
<TopLine Value="61"/>
|
||||||
<CursorPos X="73" Y="214"/>
|
<CursorPos X="73" Y="214"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="..\..\..\source\uCEFMiscFunctions.pas"/>
|
||||||
|
<TopLine Value="267"/>
|
||||||
|
<CursorPos X="37" Y="291"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||||
|
<IsVisibleTab Value="True"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<TopLine Value="45"/>
|
||||||
|
<CursorPos X="73" Y="61"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="..\..\..\source\uCEFConstants.pas"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<TopLine Value="577"/>
|
||||||
|
<CursorPos X="40" Y="599"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit4>
|
||||||
</Units>
|
</Units>
|
||||||
<General>
|
<JumpHistory Count="8" HistoryIndex="7">
|
||||||
<ActiveWindowIndexAtStart Value="-1"/>
|
<Position1>
|
||||||
</General>
|
<Filename Value="..\..\..\source\uCEFMiscFunctions.pas"/>
|
||||||
<JumpHistory HistoryIndex="-1"/>
|
<Caret Line="65" Column="41" TopLine="410"/>
|
||||||
|
</Position1>
|
||||||
|
<Position2>
|
||||||
|
<Filename Value="..\..\..\source\uCEFMiscFunctions.pas"/>
|
||||||
|
<Caret Line="264" Column="21" TopLine="248"/>
|
||||||
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="..\..\..\source\uCEFMiscFunctions.pas"/>
|
||||||
|
<Caret Line="2098" Column="11" TopLine="2079"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="..\..\..\source\uCEFMiscFunctions.pas"/>
|
||||||
|
<Caret Line="291" Column="37" TopLine="267"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||||
|
<Caret Line="106" Column="58" TopLine="88"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||||
|
<Caret Line="107" Column="78" TopLine="93"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||||
|
<Caret Line="108" Column="82" TopLine="94"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||||
|
<Caret Line="103" Column="90" TopLine="45"/>
|
||||||
|
</Position8>
|
||||||
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
<Modes Count="0" ActiveMode=""/>
|
<Modes Count="0" ActiveMode=""/>
|
||||||
|
@@ -60,7 +60,7 @@ uses
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF MSWINDOWS}Windows, {$ENDIF} Classes, Controls, ExtCtrls, SysUtils, SyncObjs, Math,
|
{$IFDEF MSWINDOWS}Windows, {$ENDIF} Classes, Controls, ExtCtrls, SysUtils, SyncObjs, Math,
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
LResources, Forms,
|
LCLIntf, LResources, Forms,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Messages,
|
Messages,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 90,
|
"InternalVersion" : 91,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "79.1.36.0"
|
"Version" : "79.1.36.0"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user