mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-02-02 10:25:26 +02:00
Update to CEF 88.2.7
This commit is contained in:
parent
086042c0d9
commit
7de0ea6a81
14
README.md
14
README.md
@ -3,14 +3,14 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
|
||||
|
||||
CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
||||
|
||||
CEF4Delphi uses CEF 88.2.6 which includes Chromium 88.0.4324.150.
|
||||
CEF4Delphi uses CEF 88.2.7 which includes Chromium 88.0.4324.150.
|
||||
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.6%2Bgd717f0e%2Bchromium-88.0.4324.150_windows32.tar.bz2)
|
||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.6%2Bgd717f0e%2Bchromium-88.0.4324.150_windows64.tar.bz2)
|
||||
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.6%2Bgd717f0e%2Bchromium-88.0.4324.150_linux32.tar.bz2)
|
||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.6%2Bgd717f0e%2Bchromium-88.0.4324.150_linux64.tar.bz2)
|
||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.6%2Bgd717f0e%2Bchromium-88.0.4324.150_linuxarm.tar.bz2)
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.6%2Bgd717f0e%2Bchromium-88.0.4324.150_linuxarm64.tar.bz2)
|
||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.7%2Bgc18ff58%2Bchromium-88.0.4324.150_windows32.tar.bz2)
|
||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.7%2Bgc18ff58%2Bchromium-88.0.4324.150_windows64.tar.bz2)
|
||||
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.7%2Bgc18ff58%2Bchromium-88.0.4324.150_linux32.tar.bz2)
|
||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.7%2Bgc18ff58%2Bchromium-88.0.4324.150_linux64.tar.bz2)
|
||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.7%2Bgc18ff58%2Bchromium-88.0.4324.150_linuxarm.tar.bz2)
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_88.2.7%2Bgc18ff58%2Bchromium-88.0.4324.150_linuxarm64.tar.bz2)
|
||||
|
||||
CEF4Delphi was developed and tested on Delphi 10.4.1 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.10/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||
|
||||
|
@ -3,14 +3,14 @@
|
||||
<ProjectSession>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="52">
|
||||
<Units Count="53">
|
||||
<Unit0>
|
||||
<Filename Value="MiniBrowser.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="26"/>
|
||||
<CursorPos X="62" Y="52"/>
|
||||
<UsageCount Value="38"/>
|
||||
<UsageCount Value="43"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
@ -19,14 +19,16 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="912"/>
|
||||
<CursorPos X="79" Y="958"/>
|
||||
<FoldState Value=" TJnR1{3122{"/>
|
||||
<UsageCount Value="38"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 Y="937" ID="9"/>
|
||||
<Item1 X="12" Y="619" ID="8"/>
|
||||
<Item2 Y="979" ID="1"/>
|
||||
<TopLine Value="19"/>
|
||||
<CursorPos Y="252"/>
|
||||
<FoldState Value=" TJo51{3122K"/>
|
||||
<UsageCount Value="43"/>
|
||||
<Bookmarks Count="5">
|
||||
<Item0 X="12" Y="649" ID="8"/>
|
||||
<Item1 X="3" Y="875" ID="9"/>
|
||||
<Item2 X="65" Y="796" ID="3"/>
|
||||
<Item3 X="43" Y="864" ID="2"/>
|
||||
<Item4 X="3" Y="1094" ID="7"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -37,7 +39,7 @@
|
||||
<UnitName Value="Interfaces"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="11" Y="9"/>
|
||||
<UsageCount Value="38"/>
|
||||
<UsageCount Value="43"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="uminibrowser.pas"/>
|
||||
@ -118,11 +120,10 @@
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="../../../source/uCEFApplicationCore.pas"/>
|
||||
<EditorIndex Value="10"/>
|
||||
<TopLine Value="2023"/>
|
||||
<CursorPos X="90" Y="2050"/>
|
||||
<UsageCount Value="17"/>
|
||||
<Loaded Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="40"/>
|
||||
<CursorPos X="36" Y="69"/>
|
||||
<UsageCount Value="18"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="../../../source/uCEFLibFunctions.pas"/>
|
||||
@ -167,11 +168,10 @@
|
||||
<Unit19>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/lcl/interfaces/gtk3/gtk3bindings/lazgtk3.pas"/>
|
||||
<UnitName Value="LazGtk3"/>
|
||||
<EditorIndex Value="11"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="8267"/>
|
||||
<CursorPos X="89" Y="8308"/>
|
||||
<UsageCount Value="12"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit19>
|
||||
<Unit20>
|
||||
<Filename Value="../../../source/uCEFLinuxFunctions.pas"/>
|
||||
@ -285,11 +285,10 @@
|
||||
</Unit35>
|
||||
<Unit36>
|
||||
<Filename Value="../../../source/uCEFInterfaces.pas"/>
|
||||
<EditorIndex Value="8"/>
|
||||
<TopLine Value="2274"/>
|
||||
<CursorPos X="53" Y="2312"/>
|
||||
<UsageCount Value="15"/>
|
||||
<Loaded Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="1569"/>
|
||||
<CursorPos X="15" Y="1589"/>
|
||||
<UsageCount Value="16"/>
|
||||
</Unit36>
|
||||
<Unit37>
|
||||
<Filename Value="../../../source/uCEFPrintHandler.pas"/>
|
||||
@ -312,10 +311,9 @@
|
||||
</Unit39>
|
||||
<Unit40>
|
||||
<Filename Value="../../../source/uCEFPrintJobCallback.pas"/>
|
||||
<EditorIndex Value="9"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="22"/>
|
||||
<UsageCount Value="15"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit40>
|
||||
<Unit41>
|
||||
<Filename Value="../../../source/uCEFPDFPrintOptions.pas"/>
|
||||
@ -327,11 +325,10 @@
|
||||
<Unit42>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/lcl/printers.pas"/>
|
||||
<UnitName Value="Printers"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="209"/>
|
||||
<CursorPos X="6" Y="190"/>
|
||||
<UsageCount Value="14"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit42>
|
||||
<Unit43>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/lcl/graphics.pp"/>
|
||||
@ -349,20 +346,18 @@
|
||||
<Unit45>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/printersdlgs.pp"/>
|
||||
<UnitName Value="PrintersDlgs"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="90"/>
|
||||
<CursorPos X="14" Y="128"/>
|
||||
<UsageCount Value="13"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit45>
|
||||
<Unit46>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/lcl/dialogs.pp"/>
|
||||
<UnitName Value="Dialogs"/>
|
||||
<EditorIndex Value="7"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="489"/>
|
||||
<CursorPos X="3" Y="506"/>
|
||||
<UsageCount Value="13"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit46>
|
||||
<Unit47>
|
||||
<Filename Value="/usr/share/fpcsrc/3.2.0/packages/gtk1/src/glib/glib.pp"/>
|
||||
@ -373,158 +368,165 @@
|
||||
</Unit47>
|
||||
<Unit48>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters_h.inc"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="105"/>
|
||||
<CursorPos X="14" Y="170"/>
|
||||
<UsageCount Value="12"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit48>
|
||||
<Unit49>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="467"/>
|
||||
<CursorPos X="72" Y="491"/>
|
||||
<UsageCount Value="12"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit49>
|
||||
<Unit50>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsdyn.pp"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="1117"/>
|
||||
<CursorPos X="16" Y="1140"/>
|
||||
<UsageCount Value="12"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit50>
|
||||
<Unit51>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/osprinters.pas"/>
|
||||
<UnitName Value="OSPrinters"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit51>
|
||||
<Unit52>
|
||||
<Filename Value="../../Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="273"/>
|
||||
<CursorPos X="51" Y="310"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="33" Y="297" ID="1"/>
|
||||
</Bookmarks>
|
||||
</Unit52>
|
||||
</Units>
|
||||
<OtherDefines Count="1">
|
||||
<Define0 Value="UseCThreads"/>
|
||||
</OtherDefines>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters_h.inc"/>
|
||||
<Caret Line="170" Column="14" TopLine="131"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="794" Column="38" TopLine="765"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="497" Column="80" TopLine="470"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1071" Column="22" TopLine="1051"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="189" Column="27" TopLine="171"/>
|
||||
<Caret Line="1058" Column="54" TopLine="1045"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters_h.inc"/>
|
||||
<Caret Line="77" Column="51" TopLine="68"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="201" Column="15" TopLine="178"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="29" Column="35"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1070" TopLine="1057"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters_h.inc"/>
|
||||
<Caret Line="170" Column="36" TopLine="131"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="782" TopLine="766"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="475" Column="3" TopLine="470"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1072" TopLine="1036"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="201" Column="27" TopLine="165"/>
|
||||
<Caret Line="1189" Column="41" TopLine="1138"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1091" Column="33" TopLine="1058"/>
|
||||
<Caret Line="660" Column="3" TopLine="655"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="226" Column="22" TopLine="203"/>
|
||||
<Caret Line="669" Column="3" TopLine="655"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1006" Column="24" TopLine="967"/>
|
||||
<Caret Line="675" Column="3" TopLine="655"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="187" Column="15" TopLine="166"/>
|
||||
<Caret Line="689" Column="3" TopLine="655"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="981" Column="23" TopLine="975"/>
|
||||
<Caret Line="843" Column="3" TopLine="838"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="147" Column="25" TopLine="139"/>
|
||||
<Caret Line="701" Column="3" TopLine="699"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="981" Column="46" TopLine="955"/>
|
||||
<Caret Line="719" Column="3" TopLine="699"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="474" Column="33" TopLine="461"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="880" Column="40" TopLine="854"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="48" Column="76" TopLine="22"/>
|
||||
<Caret Line="243" Column="31" TopLine="218"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/osprinters.pas"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="808" Column="41" TopLine="769"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="489" Column="57" TopLine="461"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1089" Column="3" TopLine="1057"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters_h.inc"/>
|
||||
<Caret Line="170" Column="14" TopLine="132"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="858" TopLine="847"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="981" Column="36" TopLine="956"/>
|
||||
<Caret Line="1084" Column="35" TopLine="1065"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="146" Column="26" TopLine="125"/>
|
||||
<Caret Line="867" Column="3" TopLine="861"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="202" Column="24" TopLine="176"/>
|
||||
<Caret Line="763" Column="3" TopLine="759"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1103" Column="3" TopLine="1062"/>
|
||||
<Caret Line="783" Column="3" TopLine="759"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="189" Column="15" TopLine="181"/>
|
||||
<Caret Line="802" Column="3" TopLine="799"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="486" Column="74" TopLine="467"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="813" Column="3" TopLine="799"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="983" Column="62" TopLine="933"/>
|
||||
<Caret Line="751" Column="3" TopLine="747"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/unix/cupsprinters.inc"/>
|
||||
<Caret Line="491" Column="72" TopLine="467"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="819" Column="3" TopLine="816"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="937" Column="44" TopLine="923"/>
|
||||
<Caret Line="829" Column="3" TopLine="816"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="/usr/share/lazarus/2.0.10/components/printers/printersdlgs.pp"/>
|
||||
<Caret Line="128" Column="14" TopLine="90"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1075" Column="53" TopLine="1059"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
|
@ -50,6 +50,14 @@ uses
|
||||
uCEFConstants, uCEFWinControl, uCEFChromiumEvents, uCEFLinkedWindowParent;
|
||||
|
||||
type
|
||||
TJSDialogParams = record
|
||||
originUrl : ustring;
|
||||
dialogType : TCefJsDialogType;
|
||||
messageText : ustring;
|
||||
defaultPromptText : ustring;
|
||||
callback : ICefJsDialogCallback;
|
||||
end;
|
||||
|
||||
{ TMiniBrowserFrm }
|
||||
TMiniBrowserFrm = class(TForm)
|
||||
CEFLinkedWindowParent1: TCEFLinkedWindowParent;
|
||||
@ -141,12 +149,14 @@ type
|
||||
FBrowserCanGoForward : boolean;
|
||||
FBrowserStatusText : string;
|
||||
FBrowserTitle : string;
|
||||
FBrowserPendingHTML : string;
|
||||
|
||||
FPrintJobCallback : ICefPrintJobCallback;
|
||||
FPrintJobDocumentName : ustring;
|
||||
FPrintJobPDFFilePath : ustring;
|
||||
FPrintDialogCallback : ICefPrintDialogCallback;
|
||||
FPrintDialogHasSelection : boolean;
|
||||
FJSDialogParams : TJSDialogParams;
|
||||
|
||||
|
||||
procedure SetBrowserAddress(const aValue : string);
|
||||
@ -187,6 +197,9 @@ type
|
||||
procedure BrowserPrintJobStartedMsg(Data: PtrInt);
|
||||
procedure BrowserPrintStartMsg(Data: PtrInt);
|
||||
procedure BrowserPrintResetMsg(Data: PtrInt);
|
||||
procedure BrowserShowJSDialogMsg(Data: PtrInt);
|
||||
procedure BrowserLoadErrorMsg(Data: PtrInt);
|
||||
procedure BrowserSetFocusMsg(Data: PtrInt);
|
||||
|
||||
property BrowserAddress : string read GetBrowserAddress write SetBrowserAddress;
|
||||
property BrowserIsLoading : boolean read GetBrowserIsLoading write SetBrowserIsLoading;
|
||||
@ -226,10 +239,18 @@ const
|
||||
CEF_PRINTJOBSTARTED = 9;
|
||||
CEF_PRINTSTART = 10;
|
||||
CEF_PRINTRESET = 11;
|
||||
CEF_SHOWJSDIALOG = 12;
|
||||
CEF_LOADERROR = 13;
|
||||
CEF_SETFOCUS = 14;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS = MENU_ID_USER_FIRST + 1;
|
||||
MINIBROWSER_CONTEXTMENU_HIDEDEVTOOLS = MENU_ID_USER_FIRST + 2;
|
||||
|
||||
// Most of the TChromium events are executed in a CEF thread and this causes
|
||||
// issues with most GTK API functions. If you need to update the GUI, store the
|
||||
// TChromium event parameters and use SendCompMessage (Application.QueueAsyncCall)
|
||||
// to do it in the main application thread.
|
||||
|
||||
// Destruction steps
|
||||
// =================
|
||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
|
||||
@ -539,6 +560,12 @@ begin
|
||||
FPrintDialogCallback := nil;
|
||||
FPrintJobCallback := nil;
|
||||
|
||||
FJSDialogParams.originUrl := '';
|
||||
FJSDialogParams.messageText := '';
|
||||
FJSDialogParams.defaultPromptText := '';
|
||||
FJSDialogParams.dialogType := JSDIALOGTYPE_ALERT;
|
||||
FJSDialogParams.callback := nil;
|
||||
|
||||
FBrowserCS := TCriticalSection.Create;
|
||||
|
||||
// The MultiBrowserMode store all the browser references in TChromium.
|
||||
@ -560,8 +587,9 @@ end;
|
||||
|
||||
procedure TMiniBrowserFrm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FPrintDialogCallback := nil;
|
||||
FPrintJobCallback := nil;
|
||||
FPrintDialogCallback := nil;
|
||||
FPrintJobCallback := nil;
|
||||
FJSDialogParams.callback := nil;
|
||||
|
||||
FBrowserCS.Free;
|
||||
end;
|
||||
@ -611,12 +639,16 @@ procedure TMiniBrowserFrm.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
if Chromium1.Initialized then
|
||||
begin
|
||||
FBrowserCS.Acquire;
|
||||
|
||||
if (FPrintJobCallback <> nil) and not(Printer.Printing) then
|
||||
begin
|
||||
FPrintJobCallback.Cont();
|
||||
FPrintJobCallback := nil;
|
||||
Timer1.Enabled := False;
|
||||
end;
|
||||
|
||||
FBrowserCS.Release;
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -753,17 +785,21 @@ end;
|
||||
procedure TMiniBrowserFrm.Chromium1LoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer;
|
||||
const errorText, failedUrl: ustring);
|
||||
var
|
||||
TempString : ustring;
|
||||
begin
|
||||
if (errorCode = ERR_ABORTED) then exit;
|
||||
if (errorCode = ERR_ABORTED) or
|
||||
(frame = nil) or
|
||||
not(frame.IsValid) or
|
||||
not(frame.IsMain) then
|
||||
exit;
|
||||
|
||||
TempString := '<html><body bgcolor="white">' +
|
||||
'<h2>Failed to load URL ' + failedUrl +
|
||||
' with error ' + errorText +
|
||||
' (' + inttostr(errorCode) + ').</h2></body></html>';
|
||||
FBrowserCS.Acquire;
|
||||
FBrowserPendingHTML := '<html><body bgcolor="white">' +
|
||||
'<h2>Failed to load URL ' + failedUrl +
|
||||
' with error ' + errorText +
|
||||
' (' + inttostr(errorCode) + ').</h2></body></html>';
|
||||
FBrowserCS.Release;
|
||||
|
||||
Chromium1.LoadString(TempString, frame);
|
||||
SendCompMessage(CEF_LOADERROR);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1LoadingStateChange(Sender: TObject;
|
||||
@ -825,7 +861,7 @@ end;
|
||||
procedure TMiniBrowserFrm.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
SendCompMessage(CEF_SETFOCUS);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1Jsdialog(Sender: TObject;
|
||||
@ -834,11 +870,20 @@ procedure TMiniBrowserFrm.Chromium1Jsdialog(Sender: TObject;
|
||||
const callback: ICefJsDialogCallback; out suppressMessage: Boolean; out
|
||||
Result: Boolean);
|
||||
begin
|
||||
// We skip JS dialogs to avoid a crash due to the CEF issue #3087
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/3087/linux-multi-threaded-message-loop-not
|
||||
// Even with this workaround the application may have issues if a JS dialog is suppressed.
|
||||
suppressMessage := True;
|
||||
Result := False;
|
||||
FBrowserCS.Acquire;
|
||||
|
||||
FJSDialogParams.originUrl := originUrl;
|
||||
FJSDialogParams.dialogType := dialogType;
|
||||
FJSDialogParams.messageText := messageText;
|
||||
FJSDialogParams.defaultPromptText := defaultPromptText;
|
||||
FJSDialogParams.callback := callback;
|
||||
|
||||
suppressMessage := False;
|
||||
Result := True;
|
||||
|
||||
FBrowserCS.Release;
|
||||
|
||||
SendCompMessage(CEF_SHOWJSDIALOG);
|
||||
end;
|
||||
|
||||
{%Endregion}
|
||||
@ -997,6 +1042,54 @@ begin
|
||||
StatusBar1.Panels[0].Text := '';
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.BrowserShowJSDialogMsg(Data: PtrInt);
|
||||
var
|
||||
TempCaption : string;
|
||||
begin
|
||||
FBrowserCS.Acquire;
|
||||
|
||||
if (FJSDialogParams.callback <> nil) then
|
||||
begin
|
||||
TempCaption := 'JavaScript message from : ' + FJSDialogParams.originUrl;
|
||||
|
||||
case FJSDialogParams.dialogType of
|
||||
JSDIALOGTYPE_CONFIRM : FJSDialogParams.callback.cont((MessageDlg(TempCaption + CRLF + CRLF + FJSDialogParams.messageText, mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes), '');
|
||||
JSDIALOGTYPE_PROMPT : FJSDialogParams.callback.cont(True, InputBox(TempCaption, FJSDialogParams.messageText, FJSDialogParams.defaultPromptText));
|
||||
else
|
||||
begin
|
||||
showmessage(TempCaption + CRLF + CRLF + FJSDialogParams.messageText);
|
||||
FJSDialogParams.callback.cont(True, '');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
FJSDialogParams.originUrl := '';
|
||||
FJSDialogParams.messageText := '';
|
||||
FJSDialogParams.defaultPromptText := '';
|
||||
FJSDialogParams.dialogType := JSDIALOGTYPE_ALERT;
|
||||
FJSDialogParams.callback := nil;
|
||||
|
||||
FBrowserCS.Release;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.BrowserLoadErrorMsg(Data: PtrInt);
|
||||
var
|
||||
TempHTML : ustring;
|
||||
begin
|
||||
FBrowserCS.Acquire;
|
||||
TempHTML := FBrowserPendingHTML;
|
||||
FBrowserPendingHTML := '';
|
||||
FBrowserCS.Release;
|
||||
|
||||
if (length(TempHTML) > 0) then
|
||||
Chromium1.LoadString(TempHTML);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.BrowserSetFocusMsg(Data: PtrInt);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.SendCompMessage(aMsg : cardinal; Data: PtrInt);
|
||||
begin
|
||||
case aMsg of
|
||||
@ -1013,6 +1106,9 @@ begin
|
||||
CEF_PRINTJOBSTARTED : Application.QueueAsyncCall(@BrowserPrintJobStartedMsg, Data);
|
||||
CEF_PRINTSTART : Application.QueueAsyncCall(@BrowserPrintStartMsg, Data);
|
||||
CEF_PRINTRESET : Application.QueueAsyncCall(@BrowserPrintResetMsg, Data);
|
||||
CEF_SHOWJSDIALOG : Application.QueueAsyncCall(@BrowserShowJSDialogMsg, Data);
|
||||
CEF_LOADERROR : Application.QueueAsyncCall(@BrowserLoadErrorMsg, Data);
|
||||
CEF_SETFOCUS : Application.QueueAsyncCall(@BrowserSetFocusMsg, Data);
|
||||
end;
|
||||
end;
|
||||
{%Endregion}
|
||||
@ -1076,11 +1172,15 @@ procedure TMiniBrowserFrm.HandlePrintDialog(const browser: ICefBrowser; hasSelec
|
||||
begin
|
||||
if (browser <> nil) and (callback <> nil) and Chromium1.IsSameBrowser(browser) then
|
||||
begin
|
||||
FBrowserCS.Acquire;
|
||||
|
||||
FPrintDialogCallback := callback;
|
||||
FPrintDialogHasSelection := hasSelection;
|
||||
aResult := True;
|
||||
|
||||
SendCompMessage(CEF_SHOWPRINTDIALOG);
|
||||
|
||||
FBrowserCS.Release;
|
||||
end
|
||||
else
|
||||
aResult := False;
|
||||
@ -1090,12 +1190,16 @@ procedure TMiniBrowserFrm.HandlePrintJob(const browser: ICefBrowser; const docum
|
||||
begin
|
||||
if (browser <> nil) and (callback <> nil) and Chromium1.IsSameBrowser(browser) then
|
||||
begin
|
||||
FBrowserCS.Acquire;
|
||||
|
||||
FPrintJobCallback := callback;
|
||||
FPrintJobDocumentName := documentName;
|
||||
FPrintJobPDFFilePath := PDFFilePath;
|
||||
aResult := True;
|
||||
|
||||
SendCompMessage(CEF_PRINTJOBSTARTED);
|
||||
|
||||
FBrowserCS.Release;
|
||||
end
|
||||
else
|
||||
aResult := False;
|
||||
|
@ -51,8 +51,6 @@ uses
|
||||
uMainForm in 'uMainForm.pas' {MainForm},
|
||||
uChildForm in 'uChildForm.pas' {ChildForm};
|
||||
|
||||
//{$R *.res}
|
||||
|
||||
begin
|
||||
CreateGlobalCEFApp;
|
||||
|
||||
|
@ -8,9 +8,8 @@
|
||||
<Unit0>
|
||||
<Filename Value="PopupBrowser2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="28"/>
|
||||
<CursorPos X="64" Y="53"/>
|
||||
<TopLine Value="25"/>
|
||||
<CursorPos Y="54"/>
|
||||
<UsageCount Value="35"/>
|
||||
<Loaded Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
@ -22,11 +21,11 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="398"/>
|
||||
<CursorPos X="71" Y="417"/>
|
||||
<TopLine Value="19"/>
|
||||
<CursorPos X="31" Y="58"/>
|
||||
<UsageCount Value="35"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="50" Y="148" ID="1"/>
|
||||
<Item0 Y="336" ID="1"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -38,11 +37,13 @@
|
||||
<ComponentName Value="ChildForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<TopLine Value="105"/>
|
||||
<CursorPos X="34" Y="159"/>
|
||||
<TopLine Value="44"/>
|
||||
<CursorPos X="34" Y="78"/>
|
||||
<UsageCount Value="35"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
@ -266,7 +267,7 @@
|
||||
<OtherDefines Count="1">
|
||||
<Define0 Value="UseCThreads"/>
|
||||
</OtherDefines>
|
||||
<JumpHistory Count="6" HistoryIndex="5">
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="123" Column="20" TopLine="101"/>
|
||||
@ -291,6 +292,102 @@
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="209" Column="80" TopLine="179"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="434" Column="80" TopLine="396"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="215" Column="3" TopLine="213"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="344" Column="3" TopLine="342"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="230" Column="3" TopLine="220"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="353" Column="3" TopLine="350"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="332" Column="5" TopLine="329"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="111" Column="20" TopLine="72"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="431" Column="23" TopLine="399"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="106" Column="15" TopLine="83"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="159" Column="34" TopLine="113"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="156" Column="3" TopLine="113"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="216" Column="3" TopLine="208"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="164" Column="3" TopLine="162"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="447" Column="11" TopLine="405"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="56" Column="15" TopLine="33"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="334" Column="45" TopLine="295"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="272" Column="13" TopLine="241"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="89" Column="15" TopLine="66"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="277" Column="58" TopLine="240"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="278" Column="40" TopLine="244"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="90" Column="15" TopLine="67"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="293" Column="20" TopLine="251"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uChildForm.pas"/>
|
||||
<Caret Line="172" Column="38" TopLine="158"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="58" Column="31" TopLine="19"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -49,13 +49,8 @@ uses
|
||||
uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFWindowParent,
|
||||
uCEFWinControl, uCEFLinkedWindowParent, uCEFChromiumEvents;
|
||||
|
||||
const
|
||||
CEF_CLOSECHILD = $A52;
|
||||
|
||||
type
|
||||
|
||||
{ TChildForm }
|
||||
|
||||
TChildForm = class(TForm)
|
||||
CEFLinkedWindowParent1: TCEFLinkedWindowParent;
|
||||
Chromium1: TChromium;
|
||||
@ -80,12 +75,15 @@ type
|
||||
FClosing : boolean;
|
||||
FClientInitialized : boolean;
|
||||
FPopupFeatures : TCefPopupFeatures;
|
||||
FCaption : ustring;
|
||||
|
||||
procedure WMMove(var aMessage: TLMMove); message LM_MOVE;
|
||||
procedure WMSize(var aMessage: TLMSize); message LM_SIZE;
|
||||
procedure WMWindowPosChanged(var aMessage: TLMWindowPosChanged); message LM_WINDOWPOSCHANGED;
|
||||
|
||||
procedure BrowserCloseFormMsg(Data: PtrInt);
|
||||
procedure BrowserSetFocusMsg(Data: PtrInt);
|
||||
procedure BrowserTitleChangeMsg(Data: PtrInt);
|
||||
|
||||
public
|
||||
procedure AfterConstruction; override;
|
||||
@ -167,7 +165,8 @@ end;
|
||||
|
||||
procedure TChildForm.Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
|
||||
begin
|
||||
Caption := title;
|
||||
FCaption := title;
|
||||
SendCompMessage(CEF_TITLECHANGE);
|
||||
end;
|
||||
|
||||
procedure TChildForm.WMMove(var aMessage : TLMMove);
|
||||
@ -253,7 +252,7 @@ end;
|
||||
procedure TChildForm.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
SendCompMessage(CEF_SETFOCUS);
|
||||
end;
|
||||
|
||||
procedure TChildForm.FormShow(Sender: TObject);
|
||||
@ -270,12 +269,24 @@ end;
|
||||
procedure TChildForm.BrowserCloseFormMsg(Data: PtrInt);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TChildForm.BrowserSetFocusMsg(Data: PtrInt);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TChildForm.BrowserTitleChangeMsg(Data: PtrInt);
|
||||
begin
|
||||
Caption := FCaption;
|
||||
end;
|
||||
|
||||
procedure TChildForm.SendCompMessage(aMsg : cardinal; aData : PtrInt);
|
||||
begin
|
||||
case aMsg of
|
||||
CEF_BEFORECLOSE : Application.QueueAsyncCall(@BrowserCloseFormMsg, aData);
|
||||
CEF_BEFORECLOSE : Application.QueueAsyncCall(@BrowserCloseFormMsg, aData);
|
||||
CEF_SETFOCUS : Application.QueueAsyncCall(@BrowserSetFocusMsg, aData);
|
||||
CEF_TITLECHANGE : Application.QueueAsyncCall(@BrowserTitleChangeMsg, aData);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -53,6 +53,9 @@ const
|
||||
CEF_CREATENEXTCHILD = $A50;
|
||||
CEF_CHILDDESTROYED = $A51;
|
||||
CEF_INITIALIZED = $A52;
|
||||
CEF_SETFOCUS = $A53;
|
||||
CEF_TITLECHANGE = $A54;
|
||||
CEF_CLOSECHILD = $A55;
|
||||
|
||||
type
|
||||
|
||||
@ -102,6 +105,7 @@ type
|
||||
procedure BrowserCreateNextChildMsg(Data: PtrInt);
|
||||
procedure BrowserChildDestroyedMsg(Data: PtrInt);
|
||||
procedure BrowserCloseFormMsg(Data: PtrInt);
|
||||
procedure BrowserSetFocusMsg(Data: PtrInt);
|
||||
|
||||
property PopupChildCount : integer read GetPopupChildCount;
|
||||
|
||||
@ -329,7 +333,7 @@ end;
|
||||
procedure TMainForm.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
SendCompMessage(CEF_SETFOCUS);
|
||||
end;
|
||||
|
||||
procedure TMainForm.FormActivate(Sender: TObject);
|
||||
@ -429,6 +433,11 @@ begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TMainForm.BrowserSetFocusMsg(Data: PtrInt);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TMainForm.SendCompMessage(aMsg : cardinal; aData : PtrInt);
|
||||
begin
|
||||
case aMsg of
|
||||
@ -437,6 +446,7 @@ begin
|
||||
CEF_CREATENEXTCHILD : Application.QueueAsyncCall(@BrowserCreateNextChildMsg, aData);
|
||||
CEF_CHILDDESTROYED : Application.QueueAsyncCall(@BrowserChildDestroyedMsg, aData);
|
||||
CEF_BEFORECLOSE : Application.QueueAsyncCall(@BrowserCloseFormMsg, aData);
|
||||
CEF_SETFOCUS : Application.QueueAsyncCall(@BrowserSetFocusMsg, aData);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<ProjectSession>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="64">
|
||||
<Units Count="65">
|
||||
<Unit0>
|
||||
<Filename Value="SimpleBrowser2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -20,12 +20,12 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="uSimpleBrowser2"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="225"/>
|
||||
<CursorPos X="49" Y="250"/>
|
||||
<TopLine Value="90"/>
|
||||
<CursorPos X="50" Y="123"/>
|
||||
<UsageCount Value="52"/>
|
||||
<Bookmarks Count="2">
|
||||
<Item0 X="57" Y="243" ID="3"/>
|
||||
<Item1 Y="239" ID="9"/>
|
||||
<Item0 X="57" Y="250" ID="3"/>
|
||||
<Item1 Y="246" ID="9"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -472,8 +472,15 @@
|
||||
<TopLine Value="514"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit63>
|
||||
<Unit64>
|
||||
<Filename Value="../../../source/uCEFConstants.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="601"/>
|
||||
<CursorPos X="3" Y="624"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit64>
|
||||
</Units>
|
||||
<JumpHistory Count="11" HistoryIndex="10">
|
||||
<JumpHistory Count="23" HistoryIndex="22">
|
||||
<Position1>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="245" Column="35" TopLine="242"/>
|
||||
@ -518,6 +525,54 @@
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="76" Column="38" TopLine="51"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="260" Column="48" TopLine="234"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="230" Column="3" TopLine="228"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="222" Column="3" TopLine="220"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="184" Column="3" TopLine="176"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="216" Column="3" TopLine="176"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="255" Column="3" TopLine="251"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="90" Column="20" TopLine="73"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="272" Column="3" TopLine="252"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="256" Column="31" TopLine="225"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="265" Column="32" TopLine="247"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="90" Column="25" TopLine="77"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="usimplebrowser2.pas"/>
|
||||
<Caret Line="283" Column="24" TopLine="263"/>
|
||||
</Position23>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -46,10 +46,11 @@ uses
|
||||
uCEFChromium, uCEFWindowParent, uCEFConstants, uCEFTypes, uCEFInterfaces,
|
||||
uCEFChromiumEvents, uCEFLinkedWindowParent;
|
||||
|
||||
const
|
||||
CEF_SETFOCUS = 1;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
AddressEdt: TEdit;
|
||||
CEFLinkedWindowParent1: TCEFLinkedWindowParent;
|
||||
@ -90,6 +91,7 @@ type
|
||||
|
||||
procedure BrowserCreatedMsg(Data: PtrInt);
|
||||
procedure BrowserCloseFormMsg(Data: PtrInt);
|
||||
procedure BrowserSetFocusMsg(Data: PtrInt);
|
||||
public
|
||||
|
||||
end;
|
||||
@ -120,6 +122,11 @@ implementation
|
||||
// We need to use TCEFLinkedWindowParent in Linux to update the browser
|
||||
// visibility and size automatically.
|
||||
|
||||
// Most of the TChromium events are executed in a CEF thread and this causes
|
||||
// issues with most GTK API functions. If you need to update the GUI, store the
|
||||
// TChromium event parameters and use SendCompMessage (Application.QueueAsyncCall)
|
||||
// to do it in the main application thread.
|
||||
|
||||
// Destruction steps
|
||||
// =================
|
||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
|
||||
@ -252,7 +259,7 @@ end;
|
||||
|
||||
procedure TForm1.Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
SendCompMessage(CEF_SETFOCUS);
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserCreatedMsg(Data: PtrInt);
|
||||
@ -266,11 +273,17 @@ begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserSetFocusMsg(Data: PtrInt);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TForm1.SendCompMessage(aMsg : cardinal);
|
||||
begin
|
||||
case aMsg of
|
||||
CEF_AFTERCREATED : Application.QueueAsyncCall(@BrowserCreatedMsg, 0);
|
||||
CEF_BEFORECLOSE : Application.QueueAsyncCall(@BrowserCloseFormMsg, 0);
|
||||
CEF_SETFOCUS : Application.QueueAsyncCall(@BrowserSetFocusMsg, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -20,11 +20,11 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="50"/>
|
||||
<CursorPos Y="61"/>
|
||||
<TopLine Value="71"/>
|
||||
<CursorPos X="15" Y="94"/>
|
||||
<UsageCount Value="46"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 Y="250" ID="3"/>
|
||||
<Item0 Y="252" ID="3"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -160,12 +160,9 @@
|
||||
<Unit20>
|
||||
<Filename Value="../../../source/uCEFMiscFunctions.pas"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<TopLine Value="2946"/>
|
||||
<CursorPos X="18" Y="2980"/>
|
||||
<TopLine Value="2354"/>
|
||||
<CursorPos X="18" Y="2353"/>
|
||||
<UsageCount Value="14"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="5" Y="2949" ID="1"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
</Unit20>
|
||||
<Unit21>
|
||||
@ -445,7 +442,7 @@
|
||||
<UsageCount Value="10"/>
|
||||
</Unit58>
|
||||
</Units>
|
||||
<JumpHistory Count="28" HistoryIndex="27">
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="../../../source/uCEFMiscFunctions.pas"/>
|
||||
<Caret Line="1613" TopLine="1591"/>
|
||||
@ -558,6 +555,14 @@
|
||||
<Filename Value="uSubProcess.pas"/>
|
||||
<Caret Line="62" Column="15" TopLine="45"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uSubProcess.pas"/>
|
||||
<Caret Line="90" Column="25" TopLine="53"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="uSubProcess.pas"/>
|
||||
<Caret Line="253" Column="28" TopLine="220"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -46,10 +46,11 @@ uses
|
||||
uCEFChromium, uCEFWindowParent, uCEFConstants, uCEFTypes, uCEFInterfaces,
|
||||
uCEFChromiumEvents, uCEFLinkedWindowParent;
|
||||
|
||||
const
|
||||
CEF_SETFOCUS = 1;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
AddressEdt: TEdit;
|
||||
CEFLinkedWindowParent1: TCEFLinkedWindowParent;
|
||||
@ -90,6 +91,7 @@ type
|
||||
|
||||
procedure BrowserCreatedMsg(Data: PtrInt);
|
||||
procedure BrowserCloseFormMsg(Data: PtrInt);
|
||||
procedure BrowserSetFocusMsg(Data: PtrInt);
|
||||
public
|
||||
|
||||
end;
|
||||
@ -238,7 +240,7 @@ end;
|
||||
|
||||
procedure TForm1.Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
SendCompMessage(CEF_SETFOCUS);
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserCreatedMsg(Data: PtrInt);
|
||||
@ -252,11 +254,17 @@ begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserSetFocusMsg(Data: PtrInt);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TForm1.SendCompMessage(aMsg : cardinal);
|
||||
begin
|
||||
case aMsg of
|
||||
CEF_AFTERCREATED : Application.QueueAsyncCall(@BrowserCreatedMsg, 0);
|
||||
CEF_BEFORECLOSE : Application.QueueAsyncCall(@BrowserCloseFormMsg, 0);
|
||||
CEF_SETFOCUS : Application.QueueAsyncCall(@BrowserSetFocusMsg, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="12">
|
||||
<Units Count="13">
|
||||
<Unit0>
|
||||
<Filename Value="TabbedBrowser2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -39,13 +39,13 @@
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<TopLine Value="442"/>
|
||||
<CursorPos X="6" Y="440"/>
|
||||
<TopLine Value="397"/>
|
||||
<CursorPos X="3" Y="428"/>
|
||||
<UsageCount Value="24"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 X="22" Y="477" ID="2"/>
|
||||
<Item1 X="50" Y="397" ID="3"/>
|
||||
<Item2 X="36" Y="420" ID="4"/>
|
||||
<Item0 X="22" Y="504" ID="2"/>
|
||||
<Item1 X="50" Y="406" ID="3"/>
|
||||
<Item2 X="36" Y="429" ID="4"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -121,131 +121,123 @@
|
||||
<CursorPos X="3" Y="177"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="..\MiniBrowser\uMiniBrowser.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="1066"/>
|
||||
<CursorPos Y="1070"/>
|
||||
<UsageCount Value="10"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit12>
|
||||
</Units>
|
||||
<OtherDefines Count="1">
|
||||
<Define0 Value="UseCThreads"/>
|
||||
</OtherDefines>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<JumpHistory Count="26" HistoryIndex="25">
|
||||
<Position1>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="117" Column="67" TopLine="84"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="473" Column="68" TopLine="440"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="128" Column="61" TopLine="103"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="126" Column="31" TopLine="117"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="144" Column="19" TopLine="123"/>
|
||||
<Caret Line="471" Column="58" TopLine="441"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="133" Column="90" TopLine="103"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="79" Column="30" TopLine="72"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="61" Column="67" TopLine="39"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="336" Column="28" TopLine="332"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="131" Column="41" TopLine="103"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="158" Column="15" TopLine="135"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="61" Column="19" TopLine="39"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="336" Column="31" TopLine="297"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="126" Column="42" TopLine="103"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="477" Column="35" TopLine="448"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="144" Column="19" TopLine="90"/>
|
||||
<Caret Line="347" Column="3" TopLine="344"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="96" Column="28" TopLine="86"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="311" Column="3" TopLine="308"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="264" Column="38" TopLine="240"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="354" Column="3" TopLine="308"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="87" Column="15" TopLine="71"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="365" Column="3" TopLine="357"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="262" Column="75" TopLine="240"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="372" Column="3" TopLine="357"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="303" Column="41" TopLine="261"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="336" Column="3" TopLine="333"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="84" Column="15" TopLine="71"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="386" Column="18" TopLine="367"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="271" Column="41" TopLine="264"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="385" Column="41" TopLine="366"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="85" Column="15" TopLine="63"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="105" Column="38" TopLine="76"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="113" Column="73" TopLine="90"/>
|
||||
<Caret Line="159" Column="15" TopLine="120"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="132" Column="32" TopLine="96"/>
|
||||
<Caret Line="403" Column="31" TopLine="377"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="303" Column="69" TopLine="259"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="160" Column="32" TopLine="133"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="190" Column="3" TopLine="170"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="338" Column="31" TopLine="299"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="219" TopLine="205"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="481" Column="43" TopLine="466"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="71" TopLine="60"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="127" Column="17" TopLine="105"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="78" Column="25" TopLine="62"/>
|
||||
<Caret Line="402" Column="3" TopLine="397"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="359" Column="49" TopLine="355"/>
|
||||
<Caret Line="414" Column="3" TopLine="397"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="77" Column="17" TopLine="56"/>
|
||||
<Caret Line="421" Column="3" TopLine="397"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="464" Column="59" TopLine="40"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="73" Column="41" TopLine="63"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="326" Column="43" TopLine="305"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="79" Column="17" TopLine="50"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -102,6 +102,7 @@ type
|
||||
FBrowserCanGoForward : boolean;
|
||||
FBrowserStatusText : string;
|
||||
FBrowserTitle : string;
|
||||
FBrowserPendingHTML : string;
|
||||
|
||||
procedure SetBrowserAddress(const aValue : string);
|
||||
procedure SetBrowserIsLoading(aValue : boolean);
|
||||
@ -122,6 +123,8 @@ type
|
||||
procedure BrowserUpdateLoadingStateMsg(Data: PtrInt);
|
||||
procedure BrowserUpdateStatusTextMsg(Data: PtrInt);
|
||||
procedure BrowserUpdateTitleMsg(Data: PtrInt);
|
||||
procedure BrowserSetFocusMsg(Data: PtrInt);
|
||||
procedure BrowserLoadErrorMsg(Data: PtrInt);
|
||||
|
||||
procedure SendCompMessage(aMsg : cardinal);
|
||||
|
||||
@ -154,6 +157,8 @@ const
|
||||
CEF_UPDATELOADINGSTATE = 302;
|
||||
CEF_UPDATESTATUSTEXT = 303;
|
||||
CEF_UPDATETITLE = 304;
|
||||
CEF_SETFOCUS = 305;
|
||||
CEF_LOADERROR = 306;
|
||||
|
||||
constructor TBrowserFrame.Create(AOwner : TComponent);
|
||||
begin
|
||||
@ -331,7 +336,7 @@ end;
|
||||
procedure TBrowserFrame.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
SendCompMessage(CEF_SETFOCUS);
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.BackBtnClick(Sender: TObject);
|
||||
@ -374,17 +379,21 @@ end;
|
||||
procedure TBrowserFrame.Chromium1LoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer;
|
||||
const errorText, failedUrl: ustring);
|
||||
var
|
||||
TempString : string;
|
||||
begin
|
||||
if (errorCode = ERR_ABORTED) then exit;
|
||||
if (errorCode = ERR_ABORTED) or
|
||||
(frame = nil) or
|
||||
not(frame.IsValid) or
|
||||
not(frame.IsMain) then
|
||||
exit;
|
||||
|
||||
TempString := '<html><body bgcolor="white">' +
|
||||
'<h2>Failed to load URL ' + failedUrl +
|
||||
' with error ' + errorText +
|
||||
' (' + inttostr(errorCode) + ').</h2></body></html>';
|
||||
FBrowserCS.Acquire;
|
||||
FBrowserPendingHTML := '<html><body bgcolor="white">' +
|
||||
'<h2>Failed to load URL ' + failedUrl +
|
||||
' with error ' + errorText +
|
||||
' (' + inttostr(errorCode) + ').</h2></body></html>';
|
||||
FBrowserCS.Release;
|
||||
|
||||
Chromium1.LoadString(UTF8Decode(TempString), frame);
|
||||
SendCompMessage(CEF_LOADERROR);
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.Chromium1LoadingStateChange(Sender: TObject;
|
||||
@ -470,6 +479,24 @@ begin
|
||||
FOnBrowserTitleChange(self, BrowserTitle);
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.BrowserSetFocusMsg(Data: PtrInt);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.BrowserLoadErrorMsg(Data: PtrInt);
|
||||
var
|
||||
TempHTML : ustring;
|
||||
begin
|
||||
FBrowserCS.Acquire;
|
||||
TempHTML := FBrowserPendingHTML;
|
||||
FBrowserPendingHTML := '';
|
||||
FBrowserCS.Release;
|
||||
|
||||
if (length(TempHTML) > 0) then
|
||||
Chromium1.LoadString(TempHTML);
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.SendCompMessage(aMsg : cardinal);
|
||||
begin
|
||||
case aMsg of
|
||||
@ -478,6 +505,8 @@ begin
|
||||
CEF_UPDATELOADINGSTATE : Application.QueueAsyncCall(@BrowserUpdateLoadingStateMsg, 0);
|
||||
CEF_UPDATESTATUSTEXT : Application.QueueAsyncCall(@BrowserUpdateStatusTextMsg, 0);
|
||||
CEF_UPDATETITLE : Application.QueueAsyncCall(@BrowserUpdateTitleMsg, 0);
|
||||
CEF_SETFOCUS : Application.QueueAsyncCall(@BrowserSetFocusMsg, 0);
|
||||
CEF_LOADERROR : Application.QueueAsyncCall(@BrowserLoadErrorMsg, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
<ComponentName Value="OSRExternalPumpBrowserFrm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="171"/>
|
||||
<CursorPos Y="999"/>
|
||||
@ -102,22 +103,19 @@
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="..\..\..\source\uCEFWorkSchedulerQueueThread.pas"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="69" Y="11"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<Filename Value="..\..\..\source\uCEFWorkScheduler.pas"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="48"/>
|
||||
<CursorPos X="3" Y="359"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit14>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<JumpHistory Count="29" HistoryIndex="28">
|
||||
<Position1>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="354" Column="21" TopLine="317"/>
|
||||
@ -234,10 +232,6 @@
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="999" TopLine="171"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="..\..\..\source\uCEFWorkScheduler.pas"/>
|
||||
<Caret Line="126" Column="19" TopLine="113"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -21,7 +21,7 @@
|
||||
</CompilerOptions>
|
||||
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
|
||||
<License Value="MPL 1.1"/>
|
||||
<Version Major="88" Minor="2" Release="6"/>
|
||||
<Version Major="88" Minor="2" Release="7"/>
|
||||
<Files Count="197">
|
||||
<Item1>
|
||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||
|
@ -66,7 +66,7 @@ uses
|
||||
const
|
||||
CEF_SUPPORTED_VERSION_MAJOR = 88;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 2;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 6;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 7;
|
||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||
|
||||
CEF_CHROMEELF_VERSION_MAJOR = 88;
|
||||
|
@ -2,9 +2,9 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 256,
|
||||
"InternalVersion" : 257,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "88.2.6.0"
|
||||
"Version" : "88.2.7.0"
|
||||
}
|
||||
],
|
||||
"UpdatePackageData" : {
|
||||
|
Loading…
x
Reference in New Issue
Block a user