1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Update to CEF 88.2.7

This commit is contained in:
Salvador Diaz Fau
2021-02-13 14:39:56 +01:00
parent 086042c0d9
commit 7de0ea6a81
17 changed files with 554 additions and 236 deletions

View File

@@ -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>

View File

@@ -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;