mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-04-27 07:02:21 +02:00
Update to CEF 90.5.4
This commit is contained in:
parent
8d8d498b0f
commit
c5fae76a1f
16
README.md
16
README.md
@ -3,15 +3,15 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
|
|||||||
|
|
||||||
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
||||||
|
|
||||||
CEF4Delphi uses CEF 89.0.18 which includes Chromium 89.0.4389.114.
|
CEF4Delphi uses CEF 90.5.4 which includes Chromium 90.0.4430.72.
|
||||||
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
||||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_windows32.tar.bz2)
|
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_windows32.tar.bz2)
|
||||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_windows64.tar.bz2)
|
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_windows64.tar.bz2)
|
||||||
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_linux32.tar.bz2)
|
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_linux32.tar.bz2)
|
||||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_linux64.tar.bz2)
|
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_linux64.tar.bz2)
|
||||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_linuxarm.tar.bz2)
|
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_linuxarm.tar.bz2)
|
||||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_linuxarm64.tar.bz2)
|
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_linuxarm64.tar.bz2)
|
||||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb36241d%2Bchromium-89.0.4389.114_macosx64.tar.bz2)
|
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.5.4%2Bgc6a4331%2Bchromium-90.0.4430.72_macosx64.tar.bz2)
|
||||||
|
|
||||||
CEF4Delphi was developed and tested on Delphi 10.4.2 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.12/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
CEF4Delphi was developed and tested on Delphi 10.4.2 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.12/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||||
|
|
||||||
|
@ -222,8 +222,7 @@ begin
|
|||||||
else
|
else
|
||||||
TempCache := GlobalCEFApp.RootCache + '\cache' + inttostr(MainForm.BrowserCount);
|
TempCache := GlobalCEFApp.RootCache + '\cache' + inttostr(MainForm.BrowserCount);
|
||||||
|
|
||||||
TempContext := TCefRequestContextRef.New(TempCache, '', False, False, False)
|
TempContext := TCefRequestContextRef.New(TempCache, '', '', True, False, False, False)
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
TempContext := nil;
|
TempContext := nil;
|
||||||
|
@ -215,7 +215,7 @@ begin
|
|||||||
// GlobalCEFApp.RootCache unless you use a blank cache (in-memory).
|
// GlobalCEFApp.RootCache unless you use a blank cache (in-memory).
|
||||||
|
|
||||||
if MainForm.NewContextChk.Checked then
|
if MainForm.NewContextChk.Checked then
|
||||||
TempContext := TCefRequestContextRef.New('', '', False, False, False)
|
TempContext := TCefRequestContextRef.New('', '', '', True, False, False, False)
|
||||||
else
|
else
|
||||||
TempContext := nil;
|
TempContext := nil;
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ begin
|
|||||||
else
|
else
|
||||||
TempFullPath := TempName;
|
TempFullPath := TempName;
|
||||||
|
|
||||||
callback.cont(TempFullPath, False);
|
callback.cont(TempFullPath, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.Chromium1BeforePluginLoad(Sender: TObject;
|
procedure TMiniBrowserFrm.Chromium1BeforePluginLoad(Sender: TObject;
|
||||||
|
@ -40,6 +40,7 @@ unit uTinyBrowser2;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
Types,
|
||||||
uCEFInterfaces, uCEFTypes, uCEFChromiumCore;
|
uCEFInterfaces, uCEFTypes, uCEFChromiumCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -47,7 +48,6 @@ type
|
|||||||
private
|
private
|
||||||
FChromium : TChromiumCore;
|
FChromium : TChromiumCore;
|
||||||
|
|
||||||
procedure Chromium_OnClose(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
|
||||||
procedure Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium_OnBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
procedure Chromium_OnBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
||||||
procedure Chromium_OnOpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
procedure Chromium_OnOpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||||
@ -79,7 +79,7 @@ implementation
|
|||||||
// and it's necessary to close the message loop.
|
// and it's necessary to close the message loop.
|
||||||
|
|
||||||
uses
|
uses
|
||||||
uCEFApplication;
|
uCEFApplication, uCEFConstants, uCEFMiscFunctions;
|
||||||
|
|
||||||
var
|
var
|
||||||
TinyBrowser : TTinyBrowser2 = nil;
|
TinyBrowser : TTinyBrowser2 = nil;
|
||||||
@ -129,21 +129,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTinyBrowser2.AfterConstruction;
|
procedure TTinyBrowser2.AfterConstruction;
|
||||||
|
var
|
||||||
|
TempHandle : TCefWindowHandle;
|
||||||
|
TempRect : TRect;
|
||||||
begin
|
begin
|
||||||
inherited AfterConstruction;
|
inherited AfterConstruction;
|
||||||
|
|
||||||
FChromium := TChromiumCore.Create(nil);
|
FChromium := TChromiumCore.Create(nil);
|
||||||
FChromium.DefaultURL := 'https://www.google.com';
|
FChromium.DefaultURL := 'https://www.google.com';
|
||||||
FChromium.OnClose := Chromium_OnClose;
|
|
||||||
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
|
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
|
||||||
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
|
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
|
||||||
FChromium.OnOpenUrlFromTab := Chromium_OnOpenUrlFromTab;
|
FChromium.OnOpenUrlFromTab := Chromium_OnOpenUrlFromTab;
|
||||||
FChromium.CreateBrowser('Tiny Browser 2');
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TTinyBrowser2.Chromium_OnClose(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
InitializeWindowHandle(TempHandle);
|
||||||
begin
|
FChromium.CreateBrowser(TempHandle, TempRect, 'Tiny Browser 2', nil, nil, True);
|
||||||
aAction := cbaClose;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTinyBrowser2.Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
procedure TTinyBrowser2.Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
@ -241,6 +241,12 @@ object MiniBrowserFrm: TMiniBrowserFrm
|
|||||||
OnBeforeClose = Chromium1BeforeClose
|
OnBeforeClose = Chromium1BeforeClose
|
||||||
OnClose = Chromium1Close
|
OnClose = Chromium1Close
|
||||||
OnBeforePluginLoad = Chromium1BeforePluginLoad
|
OnBeforePluginLoad = Chromium1BeforePluginLoad
|
||||||
|
OnPrintStart = Chromium1PrintStart
|
||||||
|
OnPrintSettings = Chromium1PrintSettings
|
||||||
|
OnPrintDialog = Chromium1PrintDialog
|
||||||
|
OnPrintJob = Chromium1PrintJob
|
||||||
|
OnPrintReset = Chromium1PrintReset
|
||||||
|
OnGetPDFPaperSize = Chromium1GetPDFPaperSize
|
||||||
Left = 32
|
Left = 32
|
||||||
Top = 224
|
Top = 224
|
||||||
end
|
end
|
||||||
|
@ -99,9 +99,15 @@ type
|
|||||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1BeforePluginLoad(Sender: TObject; const mimeType, pluginUrl: ustring; isMainFrame: boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; var pluginPolicy: TCefPluginPolicy; var aResult: boolean);
|
procedure Chromium1BeforePluginLoad(Sender: TObject; const mimeType, pluginUrl: ustring; isMainFrame: boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; var pluginPolicy: TCefPluginPolicy; var aResult: boolean);
|
||||||
|
procedure Chromium1GetPDFPaperSize(Sender: TObject; const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult: TCefSize);
|
||||||
procedure Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
procedure Chromium1GotFocus(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1Jsdialog(Sender: TObject; const browser: ICefBrowser; const originUrl: ustring; dialogType: TCefJsDialogType; const messageText, defaultPromptText: ustring; const callback: ICefJsDialogCallback; out suppressMessage: Boolean; out Result: Boolean);
|
procedure Chromium1Jsdialog(Sender: TObject; const browser: ICefBrowser; const originUrl: ustring; dialogType: TCefJsDialogType; const messageText, defaultPromptText: ustring; const callback: ICefJsDialogCallback; out suppressMessage: Boolean; out Result: Boolean);
|
||||||
procedure Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
|
procedure Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
|
||||||
|
procedure Chromium1PrintDialog(Sender: TObject; const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean);
|
||||||
|
procedure Chromium1PrintJob(Sender: TObject; const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean);
|
||||||
|
procedure Chromium1PrintReset(Sender: TObject; const browser: ICefBrowser);
|
||||||
|
procedure Chromium1PrintSettings(Sender: TObject; const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
||||||
|
procedure Chromium1PrintStart(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
|
procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
|
||||||
procedure Chromium1AddressChange(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
|
procedure Chromium1AddressChange(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
|
||||||
procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
|
procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
|
||||||
@ -210,12 +216,6 @@ type
|
|||||||
property BrowserCanGoForward : boolean read GetBrowserCanGoForward write SetBrowserCanGoForward;
|
property BrowserCanGoForward : boolean read GetBrowserCanGoForward write SetBrowserCanGoForward;
|
||||||
property BrowserStatusText : string read GetBrowserStatusText write SetBrowserStatusText;
|
property BrowserStatusText : string read GetBrowserStatusText write SetBrowserStatusText;
|
||||||
property BrowserTitle : string read GetBrowserTitle write SetBrowserTitle;
|
property BrowserTitle : string read GetBrowserTitle write SetBrowserTitle;
|
||||||
public
|
|
||||||
procedure HandlePrintStart(const browser: ICefBrowser);
|
|
||||||
procedure HandlePrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
|
||||||
procedure HandlePrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
|
||||||
procedure HandlePrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
|
||||||
procedure HandlePrintReset(const browser: ICefBrowser);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -260,37 +260,6 @@ const
|
|||||||
// 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 sets FCanClose := True and sends WM_CLOSE to the form.
|
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnPrintStart(const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
MiniBrowserFrm.HandlePrintStart(browser);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
|
||||||
begin
|
|
||||||
MiniBrowserFrm.HandlePrintSettings(browser, settings, getDefaults);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
|
||||||
begin
|
|
||||||
MiniBrowserFrm.HandlePrintDialog(browser, hasSelection, callback, aResult);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
|
||||||
begin
|
|
||||||
MiniBrowserFrm.HandlePrintJob(browser, documentName, PDFFilePath, callback, aResult);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnPrintReset(const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
MiniBrowserFrm.HandlePrintReset(browser);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnGetPDFPaperSize(deviceUnitsPerInch: Integer; var aResult : TCefSize);
|
|
||||||
begin
|
|
||||||
aResult.width := Printer.PaperSize.Width;
|
|
||||||
aResult.height := Printer.PaperSize.Height;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure CreateGlobalCEFApp;
|
procedure CreateGlobalCEFApp;
|
||||||
begin
|
begin
|
||||||
GlobalCEFApp := TCefApplication.Create;
|
GlobalCEFApp := TCefApplication.Create;
|
||||||
@ -298,12 +267,6 @@ begin
|
|||||||
GlobalCEFApp.LogFile := 'debug.log';
|
GlobalCEFApp.LogFile := 'debug.log';
|
||||||
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
|
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
|
||||||
//GlobalCEFApp.EnablePrintPreview := True;
|
//GlobalCEFApp.EnablePrintPreview := True;
|
||||||
GlobalCEFApp.OnPrintStart := @GlobalCEFApp_OnPrintStart;
|
|
||||||
GlobalCEFApp.OnPrintSettings := @GlobalCEFApp_OnPrintSettings;
|
|
||||||
GlobalCEFApp.OnPrintDialog := @GlobalCEFApp_OnPrintDialog;
|
|
||||||
GlobalCEFApp.OnPrintJob := @GlobalCEFApp_OnPrintJob;
|
|
||||||
GlobalCEFApp.OnPrintReset := @GlobalCEFApp_OnPrintReset;
|
|
||||||
GlobalCEFApp.OnGetPDFPaperSize := @GlobalCEFApp_OnGetPDFPaperSize;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{Property setters and getters}
|
{Property setters and getters}
|
||||||
@ -831,6 +794,88 @@ begin
|
|||||||
SendCompMessage(CEF_UPDATELOADINGSTATE);
|
SendCompMessage(CEF_UPDATELOADINGSTATE);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1PrintDialog(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; hasSelection: boolean;
|
||||||
|
const callback: ICefPrintDialogCallback; var aResult: boolean);
|
||||||
|
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;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1PrintJob(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const documentName, PDFFilePath: ustring;
|
||||||
|
const callback: ICefPrintJobCallback; var aResult: boolean);
|
||||||
|
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;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1PrintReset(Sender: TObject;
|
||||||
|
const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
if (browser <> nil) and Chromium1.IsSameBrowser(browser) then
|
||||||
|
SendCompMessage(CEF_PRINTRESET);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1PrintSettings(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; const settings: ICefPrintSettings;
|
||||||
|
getDefaults: boolean);
|
||||||
|
var
|
||||||
|
TempSize : TCefSize;
|
||||||
|
TempArea : TCefRect;
|
||||||
|
begin
|
||||||
|
if (settings <> nil) and (browser <> nil) and settings.IsValid and not(settings.IsReadOnly) and Chromium1.IsSameBrowser(browser) then
|
||||||
|
begin
|
||||||
|
// if getDefaults then ...
|
||||||
|
|
||||||
|
TempSize.width := Printer.PaperSize.Width;
|
||||||
|
TempSize.height := Printer.PaperSize.Height;
|
||||||
|
|
||||||
|
TempArea.x := TPrinterCanvas(Printer.Canvas).LeftMargin;
|
||||||
|
TempArea.y := TPrinterCanvas(Printer.Canvas).TopMargin;
|
||||||
|
TempArea.width := TPrinterCanvas(Printer.Canvas).PageWidth;
|
||||||
|
TempArea.height := TPrinterCanvas(Printer.Canvas).PageHeight;
|
||||||
|
|
||||||
|
settings.DeviceName := Printer.PrinterName;
|
||||||
|
settings.Dpi := Printer.XDPI;
|
||||||
|
|
||||||
|
settings.SetOrientation(Printer.Orientation in [TPrinterOrientation.poLandscape, TPrinterOrientation.poReverseLandscape]);
|
||||||
|
settings.SetPrinterPrintableArea(@TempSize, @TempArea, Printer.Orientation = TPrinterOrientation.poReverseLandscape);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1PrintStart(Sender: TObject;
|
||||||
|
const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
if (browser <> nil) and Chromium1.IsSameBrowser(browser) then
|
||||||
|
SendCompMessage(CEF_PRINTSTART);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.Chromium1PdfPrintFinished(Sender: TObject; aResultOK: Boolean);
|
procedure TMiniBrowserFrm.Chromium1PdfPrintFinished(Sender: TObject; aResultOK: Boolean);
|
||||||
begin
|
begin
|
||||||
SendCompMessage(CEF_PDFPRINTEND, PtrInt(ord(aResultOK)));
|
SendCompMessage(CEF_PDFPRINTEND, PtrInt(ord(aResultOK)));
|
||||||
@ -875,6 +920,14 @@ begin
|
|||||||
aResult := False;
|
aResult := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1GetPDFPaperSize(Sender: TObject;
|
||||||
|
const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult: TCefSize
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
aResult.width := Printer.PaperSize.Width;
|
||||||
|
aResult.height := Printer.PaperSize.Height;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.Chromium1GotFocus(Sender: TObject;
|
procedure TMiniBrowserFrm.Chromium1GotFocus(Sender: TObject;
|
||||||
const browser: ICefBrowser);
|
const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
@ -1152,81 +1205,4 @@ begin
|
|||||||
end;
|
end;
|
||||||
{%Endregion}
|
{%Endregion}
|
||||||
|
|
||||||
{Printing procedures}
|
|
||||||
{%Region}
|
|
||||||
procedure TMiniBrowserFrm.HandlePrintStart(const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
if (browser <> nil) and Chromium1.IsSameBrowser(browser) then
|
|
||||||
SendCompMessage(CEF_PRINTSTART);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.HandlePrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
|
||||||
var
|
|
||||||
TempSize : TCefSize;
|
|
||||||
TempArea : TCefRect;
|
|
||||||
begin
|
|
||||||
if (settings <> nil) and (browser <> nil) and settings.IsValid and not(settings.IsReadOnly) and Chromium1.IsSameBrowser(browser) then
|
|
||||||
begin
|
|
||||||
// if getDefaults then ...
|
|
||||||
|
|
||||||
TempSize.width := Printer.PaperSize.Width;
|
|
||||||
TempSize.height := Printer.PaperSize.Height;
|
|
||||||
|
|
||||||
TempArea.x := TPrinterCanvas(Printer.Canvas).LeftMargin;
|
|
||||||
TempArea.y := TPrinterCanvas(Printer.Canvas).TopMargin;
|
|
||||||
TempArea.width := TPrinterCanvas(Printer.Canvas).PageWidth;
|
|
||||||
TempArea.height := TPrinterCanvas(Printer.Canvas).PageHeight;
|
|
||||||
|
|
||||||
settings.DeviceName := Printer.PrinterName;
|
|
||||||
settings.Dpi := Printer.XDPI;
|
|
||||||
|
|
||||||
settings.SetOrientation(Printer.Orientation in [TPrinterOrientation.poLandscape, TPrinterOrientation.poReverseLandscape]);
|
|
||||||
settings.SetPrinterPrintableArea(@TempSize, @TempArea, Printer.Orientation = TPrinterOrientation.poReverseLandscape);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.HandlePrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
|
||||||
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;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.HandlePrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
|
||||||
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;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.HandlePrintReset(const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
if (browser <> nil) and Chromium1.IsSameBrowser(browser) then
|
|
||||||
SendCompMessage(CEF_PRINTRESET);
|
|
||||||
end;
|
|
||||||
{%Endregion}
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -42,7 +42,7 @@ unit uTinyBrowser2;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils, Classes,
|
||||||
uCEFInterfaces, uCEFTypes, uCEFChromiumCore;
|
uCEFInterfaces, uCEFTypes, uCEFChromiumCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -57,6 +57,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure AfterConstruction; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure CreateGlobalCEFApp;
|
procedure CreateGlobalCEFApp;
|
||||||
@ -77,12 +78,12 @@ implementation
|
|||||||
|
|
||||||
// The destruction steps are much simpler for that reason.
|
// The destruction steps are much simpler for that reason.
|
||||||
// In this demo it's only necessary to implement the TChromium.OnBeforeClose
|
// In this demo it's only necessary to implement the TChromium.OnBeforeClose
|
||||||
// events. The TChromium.OnBeforeClose event calls GlobalCEFApp.QuitMessageLoop
|
// event. The TChromium.OnBeforeClose event calls GlobalCEFApp.QuitMessageLoop
|
||||||
// because the browser has been destroyed and it's necessary to close the
|
// because the browser has been destroyed and it's necessary to close the
|
||||||
// message loop.
|
// message loop.
|
||||||
|
|
||||||
uses
|
uses
|
||||||
uCEFApplication, uCEFConstants;
|
uCEFApplication, uCEFConstants, uCEFMiscFunctions;
|
||||||
|
|
||||||
var
|
var
|
||||||
TinyBrowser : TTinyBrowser2 = nil;
|
TinyBrowser : TTinyBrowser2 = nil;
|
||||||
@ -100,8 +101,8 @@ begin
|
|||||||
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
|
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
|
||||||
|
|
||||||
// Add a debug log in the BIN directory
|
// Add a debug log in the BIN directory
|
||||||
//GlobalCEFApp.LogFile := 'cef.log';
|
GlobalCEFApp.LogFile := 'cef.log';
|
||||||
//GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
|
GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DestroyTinyBrowser;
|
procedure DestroyTinyBrowser;
|
||||||
@ -117,12 +118,7 @@ constructor TTinyBrowser2.Create;
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FChromium := TChromiumCore.Create(nil);
|
FChromium := nil;
|
||||||
FChromium.DefaultURL := 'https://www.google.com';
|
|
||||||
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
|
|
||||||
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
|
|
||||||
FChromium.OnOpenUrlFromTab := Chromium_OnOpenUrlFromTab;
|
|
||||||
FChromium.CreateBrowser('Tiny Browser 2');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TTinyBrowser2.Destroy;
|
destructor TTinyBrowser2.Destroy;
|
||||||
@ -133,6 +129,23 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTinyBrowser2.AfterConstruction;
|
||||||
|
var
|
||||||
|
TempHandle : TCefWindowHandle;
|
||||||
|
TempRect : TRect;
|
||||||
|
begin
|
||||||
|
inherited AfterConstruction;
|
||||||
|
|
||||||
|
FChromium := TChromiumCore.Create(nil);
|
||||||
|
FChromium.DefaultURL := 'https://www.google.com';
|
||||||
|
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
|
||||||
|
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
|
||||||
|
FChromium.OnOpenUrlFromTab := Chromium_OnOpenUrlFromTab;
|
||||||
|
|
||||||
|
InitializeWindowHandle(TempHandle);
|
||||||
|
FChromium.CreateBrowser(TempHandle, TempRect, 'Tiny Browser 2', nil, nil, True);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TTinyBrowser2.Chromium_OnBeforeClose(Sender: TObject;
|
procedure TTinyBrowser2.Chromium_OnBeforeClose(Sender: TObject;
|
||||||
const browser: ICefBrowser);
|
const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
</CompilerOptions>
|
</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."/>
|
<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"/>
|
<License Value="MPL 1.1"/>
|
||||||
<Version Major="89" Release="18"/>
|
<Version Major="90" Minor="5" Release="4"/>
|
||||||
<Files Count="201">
|
<Files Count="201">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||||
|
@ -209,7 +209,8 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
inherited Create;
|
inherited Create;
|
||||||
if GlobalCEFApp = nil then
|
|
||||||
|
if (GlobalCEFApp = nil) then
|
||||||
GlobalCEFApp := Self;
|
GlobalCEFApp := Self;
|
||||||
|
|
||||||
FDestroyApplicationObject := False;
|
FDestroyApplicationObject := False;
|
||||||
@ -218,8 +219,9 @@ end;
|
|||||||
|
|
||||||
destructor TCefApplication.Destroy;
|
destructor TCefApplication.Destroy;
|
||||||
begin
|
begin
|
||||||
if GlobalCEFApp = Self then
|
if (GlobalCEFApp = Self) then
|
||||||
GlobalCEFApp := nil;
|
GlobalCEFApp := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
@ -301,7 +303,7 @@ var
|
|||||||
begin
|
begin
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
{$IFNDEF FMX}
|
{$IFNDEF FMX}
|
||||||
if Application <> nil then
|
if (Application <> nil) then
|
||||||
begin
|
begin
|
||||||
if FDestroyApplicationObject then
|
if FDestroyApplicationObject then
|
||||||
begin
|
begin
|
||||||
@ -335,7 +337,8 @@ begin
|
|||||||
if (Application.PopupControlWnd <> 0) then DeallocateHWnd(Application.PopupControlWnd);
|
if (Application.PopupControlWnd <> 0) then DeallocateHWnd(Application.PopupControlWnd);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
if not IsLibrary then
|
|
||||||
|
if not(IsLibrary) then
|
||||||
begin
|
begin
|
||||||
// Undo the OleInitialize from TApplication.Create. The sub-processes want a different
|
// Undo the OleInitialize from TApplication.Create. The sub-processes want a different
|
||||||
// COM thread model and fail with an assertion if the Debug-DLLs are used.
|
// COM thread model and fail with an assertion if the Debug-DLLs are used.
|
||||||
|
@ -64,15 +64,15 @@ uses
|
|||||||
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
|
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
|
||||||
|
|
||||||
const
|
const
|
||||||
CEF_SUPPORTED_VERSION_MAJOR = 89;
|
CEF_SUPPORTED_VERSION_MAJOR = 90;
|
||||||
CEF_SUPPORTED_VERSION_MINOR = 0;
|
CEF_SUPPORTED_VERSION_MINOR = 5;
|
||||||
CEF_SUPPORTED_VERSION_RELEASE = 18;
|
CEF_SUPPORTED_VERSION_RELEASE = 4;
|
||||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||||
|
|
||||||
CEF_CHROMEELF_VERSION_MAJOR = 89;
|
CEF_CHROMEELF_VERSION_MAJOR = 90;
|
||||||
CEF_CHROMEELF_VERSION_MINOR = 0;
|
CEF_CHROMEELF_VERSION_MINOR = 0;
|
||||||
CEF_CHROMEELF_VERSION_RELEASE = 4389;
|
CEF_CHROMEELF_VERSION_RELEASE = 4430;
|
||||||
CEF_CHROMEELF_VERSION_BUILD = 114;
|
CEF_CHROMEELF_VERSION_BUILD = 72;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
LIBCEF_DLL = 'libcef.dll';
|
LIBCEF_DLL = 'libcef.dll';
|
||||||
@ -125,6 +125,8 @@ type
|
|||||||
FIgnoreCertificateErrors : Boolean;
|
FIgnoreCertificateErrors : Boolean;
|
||||||
FBackgroundColor : TCefColor;
|
FBackgroundColor : TCefColor;
|
||||||
FAcceptLanguageList : ustring;
|
FAcceptLanguageList : ustring;
|
||||||
|
FCookieableSchemesList : ustring;
|
||||||
|
FCookieableSchemesExcludeDefaults : boolean;
|
||||||
FApplicationClientID : ustring;
|
FApplicationClientID : ustring;
|
||||||
FWindowsSandboxInfo : Pointer;
|
FWindowsSandboxInfo : Pointer;
|
||||||
FWindowlessRenderingEnabled : Boolean;
|
FWindowlessRenderingEnabled : Boolean;
|
||||||
@ -172,7 +174,6 @@ type
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FOnRegisterCustomSchemes : TOnRegisterCustomSchemesEvent;
|
FOnRegisterCustomSchemes : TOnRegisterCustomSchemesEvent;
|
||||||
FAppSettings : TCefSettings;
|
FAppSettings : TCefSettings;
|
||||||
FCheckDevToolsResources : boolean;
|
|
||||||
FDisableExtensions : boolean;
|
FDisableExtensions : boolean;
|
||||||
FDisableGPUCache : boolean;
|
FDisableGPUCache : boolean;
|
||||||
FStatus : TCefAplicationStatus;
|
FStatus : TCefAplicationStatus;
|
||||||
@ -218,7 +219,6 @@ type
|
|||||||
FMustCreateBrowserProcessHandler : boolean;
|
FMustCreateBrowserProcessHandler : boolean;
|
||||||
FMustCreateRenderProcessHandler : boolean;
|
FMustCreateRenderProcessHandler : boolean;
|
||||||
FMustCreateLoadHandler : boolean;
|
FMustCreateLoadHandler : boolean;
|
||||||
FMustCreatePrintHandler : boolean;
|
|
||||||
|
|
||||||
// ICefBrowserProcessHandler
|
// ICefBrowserProcessHandler
|
||||||
FOnGetCookieableSchemes : TOnGetCookieableSchemesEvent;
|
FOnGetCookieableSchemes : TOnGetCookieableSchemesEvent;
|
||||||
@ -251,14 +251,6 @@ type
|
|||||||
FOnLoadEnd : TOnRenderLoadEnd;
|
FOnLoadEnd : TOnRenderLoadEnd;
|
||||||
FOnLoadError : TOnRenderLoadError;
|
FOnLoadError : TOnRenderLoadError;
|
||||||
|
|
||||||
// ICefPrintHandler
|
|
||||||
FOnPrintStart : TOnPrintStartEvent;
|
|
||||||
FOnPrintSettings : TOnPrintSettingsEvent;
|
|
||||||
FOnPrintDialog : TOnPrintDialogEvent;
|
|
||||||
FOnPrintJob : TOnPrintJobEvent;
|
|
||||||
FOnPrintReset : TOnPrintResetEvent;
|
|
||||||
FOnGetPDFPaperSize : TOnGetPDFPaperSizeEvent;
|
|
||||||
|
|
||||||
procedure SetCache(const aValue : ustring);
|
procedure SetCache(const aValue : ustring);
|
||||||
procedure SetRootCache(const aValue : ustring);
|
procedure SetRootCache(const aValue : ustring);
|
||||||
procedure SetUserDataPath(const aValue : ustring);
|
procedure SetUserDataPath(const aValue : ustring);
|
||||||
@ -278,7 +270,6 @@ type
|
|||||||
function GetMustCreateBrowserProcessHandler : boolean; virtual;
|
function GetMustCreateBrowserProcessHandler : boolean; virtual;
|
||||||
function GetMustCreateRenderProcessHandler : boolean; virtual;
|
function GetMustCreateRenderProcessHandler : boolean; virtual;
|
||||||
function GetMustCreateLoadHandler : boolean; virtual;
|
function GetMustCreateLoadHandler : boolean; virtual;
|
||||||
function GetMustCreatePrintHandler : boolean; virtual;
|
|
||||||
function GetGlobalContextInitialized : boolean;
|
function GetGlobalContextInitialized : boolean;
|
||||||
function GetChildProcessesCount : integer;
|
function GetChildProcessesCount : integer;
|
||||||
function GetUsedMemory : uint64;
|
function GetUsedMemory : uint64;
|
||||||
@ -364,7 +355,6 @@ type
|
|||||||
function CheckCEFLibrary : boolean;
|
function CheckCEFLibrary : boolean;
|
||||||
procedure RegisterWidevineCDM;
|
procedure RegisterWidevineCDM;
|
||||||
procedure ShowErrorMessageDlg(const aError : string); virtual;
|
procedure ShowErrorMessageDlg(const aError : string); virtual;
|
||||||
procedure UpdateSupportedSchemes(aIncludeDefaults : boolean = True); virtual;
|
|
||||||
function ParseProcessType : TCefProcessType;
|
function ParseProcessType : TCefProcessType;
|
||||||
procedure AddCustomCommandLineSwitches(var aKeys, aValues : TStringList); virtual;
|
procedure AddCustomCommandLineSwitches(var aKeys, aValues : TStringList); virtual;
|
||||||
procedure AppendSwitch(var aKeys, aValues : TStringList; const aNewKey : ustring; const aNewValue : ustring = '');
|
procedure AppendSwitch(var aKeys, aValues : TStringList; const aNewKey : ustring; const aNewValue : ustring = '');
|
||||||
@ -388,8 +378,8 @@ type
|
|||||||
procedure UpdateDeviceScaleFactor; virtual;
|
procedure UpdateDeviceScaleFactor; virtual;
|
||||||
|
|
||||||
// Internal procedures. Only ICefApp, ICefBrowserProcessHandler,
|
// Internal procedures. Only ICefApp, ICefBrowserProcessHandler,
|
||||||
// ICefResourceBundleHandler, ICefRenderProcessHandler, ICefRegisterCDMCallback,
|
// ICefResourceBundleHandler, ICefRenderProcessHandler, ICefRegisterCDMCallback and
|
||||||
// ICefLoadHandler and ICefPrintHandler should use them.
|
// ICefLoadHandler should use them.
|
||||||
procedure Internal_OnBeforeCommandLineProcessing(const processType: ustring; const commandLine: ICefCommandLine);
|
procedure Internal_OnBeforeCommandLineProcessing(const processType: ustring; const commandLine: ICefCommandLine);
|
||||||
procedure Internal_OnRegisterCustomSchemes(const registrar: TCefSchemeRegistrarRef);
|
procedure Internal_OnRegisterCustomSchemes(const registrar: TCefSchemeRegistrarRef);
|
||||||
procedure Internal_OnContextInitialized; virtual;
|
procedure Internal_OnContextInitialized; virtual;
|
||||||
@ -413,12 +403,6 @@ type
|
|||||||
procedure Internal_OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
|
procedure Internal_OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
|
||||||
procedure Internal_GetCookieableSchemes(var schemes: TStringList; var include_defaults : boolean);
|
procedure Internal_GetCookieableSchemes(var schemes: TStringList; var include_defaults : boolean);
|
||||||
procedure Internal_GetDefaultClient(var aClient : ICefClient);
|
procedure Internal_GetDefaultClient(var aClient : ICefClient);
|
||||||
procedure Internal_OnPrintStart(const browser: ICefBrowser);
|
|
||||||
procedure Internal_OnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
|
||||||
procedure Internal_OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
|
||||||
procedure Internal_OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
|
||||||
procedure Internal_OnPrintReset(const browser: ICefBrowser);
|
|
||||||
procedure Internal_OnGetPDFPaperSize(deviceUnitsPerInch: Integer; var aResult : TCefSize);
|
|
||||||
|
|
||||||
// Properties used to populate TCefSettings (cef_settings_t)
|
// Properties used to populate TCefSettings (cef_settings_t)
|
||||||
property NoSandbox : Boolean read FNoSandbox write FNoSandbox;
|
property NoSandbox : Boolean read FNoSandbox write FNoSandbox;
|
||||||
@ -449,6 +433,8 @@ type
|
|||||||
property IgnoreCertificateErrors : Boolean read FIgnoreCertificateErrors write FIgnoreCertificateErrors;
|
property IgnoreCertificateErrors : Boolean read FIgnoreCertificateErrors write FIgnoreCertificateErrors;
|
||||||
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor;
|
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor;
|
||||||
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
|
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
|
||||||
|
property CookieableSchemesList : ustring read FCookieableSchemesList write FCookieableSchemesList;
|
||||||
|
property CookieableSchemesExcludeDefaults : boolean read FCookieableSchemesExcludeDefaults write FCookieableSchemesExcludeDefaults;
|
||||||
property ApplicationClientID : ustring read FApplicationClientID write FApplicationClientID;
|
property ApplicationClientID : ustring read FApplicationClientID write FApplicationClientID;
|
||||||
|
|
||||||
// Properties used to set command line switches
|
// Properties used to set command line switches
|
||||||
@ -529,14 +515,12 @@ type
|
|||||||
property LogProcessInfo : boolean read FLogProcessInfo write FLogProcessInfo;
|
property LogProcessInfo : boolean read FLogProcessInfo write FLogProcessInfo;
|
||||||
property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions;
|
property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions;
|
||||||
property DeviceScaleFactor : single read FDeviceScaleFactor;
|
property DeviceScaleFactor : single read FDeviceScaleFactor;
|
||||||
property CheckDevToolsResources : boolean read FCheckDevToolsResources write FCheckDevToolsResources;
|
|
||||||
property LocalesRequired : ustring read FLocalesRequired write FLocalesRequired;
|
property LocalesRequired : ustring read FLocalesRequired write FLocalesRequired;
|
||||||
property ProcessType : TCefProcessType read FProcessType;
|
property ProcessType : TCefProcessType read FProcessType;
|
||||||
property MustCreateResourceBundleHandler : boolean read GetMustCreateResourceBundleHandler write FMustCreateResourceBundleHandler;
|
property MustCreateResourceBundleHandler : boolean read GetMustCreateResourceBundleHandler write FMustCreateResourceBundleHandler;
|
||||||
property MustCreateBrowserProcessHandler : boolean read GetMustCreateBrowserProcessHandler write FMustCreateBrowserProcessHandler;
|
property MustCreateBrowserProcessHandler : boolean read GetMustCreateBrowserProcessHandler write FMustCreateBrowserProcessHandler;
|
||||||
property MustCreateRenderProcessHandler : boolean read GetMustCreateRenderProcessHandler write FMustCreateRenderProcessHandler;
|
property MustCreateRenderProcessHandler : boolean read GetMustCreateRenderProcessHandler write FMustCreateRenderProcessHandler;
|
||||||
property MustCreateLoadHandler : boolean read GetMustCreateLoadHandler write FMustCreateLoadHandler;
|
property MustCreateLoadHandler : boolean read GetMustCreateLoadHandler write FMustCreateLoadHandler;
|
||||||
property MustCreatePrintHandler : boolean read GetMustCreatePrintHandler write FMustCreatePrintHandler;
|
|
||||||
property OsmodalLoop : boolean write SetOsmodalLoop;
|
property OsmodalLoop : boolean write SetOsmodalLoop;
|
||||||
property Status : TCefAplicationStatus read FStatus;
|
property Status : TCefAplicationStatus read FStatus;
|
||||||
property MissingLibFiles : string read FMissingLibFiles;
|
property MissingLibFiles : string read FMissingLibFiles;
|
||||||
@ -589,16 +573,6 @@ type
|
|||||||
property OnLoadStart : TOnRenderLoadStart read FOnLoadStart write FOnLoadStart;
|
property OnLoadStart : TOnRenderLoadStart read FOnLoadStart write FOnLoadStart;
|
||||||
property OnLoadEnd : TOnRenderLoadEnd read FOnLoadEnd write FOnLoadEnd;
|
property OnLoadEnd : TOnRenderLoadEnd read FOnLoadEnd write FOnLoadEnd;
|
||||||
property OnLoadError : TOnRenderLoadError read FOnLoadError write FOnLoadError;
|
property OnLoadError : TOnRenderLoadError read FOnLoadError write FOnLoadError;
|
||||||
|
|
||||||
// ICefPrintHandler
|
|
||||||
{$IFDEF LINUX}
|
|
||||||
property OnPrintStart : TOnPrintStartEvent read FOnPrintStart write FOnPrintStart;
|
|
||||||
property OnPrintSettings : TOnPrintSettingsEvent read FOnPrintSettings write FOnPrintSettings;
|
|
||||||
property OnPrintDialog : TOnPrintDialogEvent read FOnPrintDialog write FOnPrintDialog;
|
|
||||||
property OnPrintJob : TOnPrintJobEvent read FOnPrintJob write FOnPrintJob;
|
|
||||||
property OnPrintReset : TOnPrintResetEvent read FOnPrintReset write FOnPrintReset;
|
|
||||||
property OnGetPDFPaperSize : TOnGetPDFPaperSizeEvent read FOnGetPDFPaperSize write FOnGetPDFPaperSize;
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCEFDirectoryDeleterThread = class(TThread)
|
TCEFDirectoryDeleterThread = class(TThread)
|
||||||
@ -672,7 +646,8 @@ end;
|
|||||||
constructor TCefApplicationCore.Create;
|
constructor TCefApplicationCore.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
if GlobalCEFApp = nil then
|
|
||||||
|
if (GlobalCEFApp = nil) then
|
||||||
GlobalCEFApp := Self;
|
GlobalCEFApp := Self;
|
||||||
|
|
||||||
FStatus := asLoading;
|
FStatus := asLoading;
|
||||||
@ -708,6 +683,8 @@ begin
|
|||||||
FIgnoreCertificateErrors := False;
|
FIgnoreCertificateErrors := False;
|
||||||
FBackgroundColor := 0;
|
FBackgroundColor := 0;
|
||||||
FAcceptLanguageList := '';
|
FAcceptLanguageList := '';
|
||||||
|
FCookieableSchemesList := '';
|
||||||
|
FCookieableSchemesExcludeDefaults := False;
|
||||||
FApplicationClientID := '';
|
FApplicationClientID := '';
|
||||||
FWindowsSandboxInfo := nil;
|
FWindowsSandboxInfo := nil;
|
||||||
FWindowlessRenderingEnabled := False;
|
FWindowlessRenderingEnabled := False;
|
||||||
@ -745,7 +722,6 @@ begin
|
|||||||
FMissingBinariesException := False;
|
FMissingBinariesException := False;
|
||||||
FSetCurrentDir := False;
|
FSetCurrentDir := False;
|
||||||
FGlobalContextInitialized := False;
|
FGlobalContextInitialized := False;
|
||||||
FCheckDevToolsResources := True;
|
|
||||||
FDisableExtensions := False;
|
FDisableExtensions := False;
|
||||||
FDisableGPUCache := True;
|
FDisableGPUCache := True;
|
||||||
FLocalesRequired := '';
|
FLocalesRequired := '';
|
||||||
@ -796,7 +772,6 @@ begin
|
|||||||
FMustCreateBrowserProcessHandler := True;
|
FMustCreateBrowserProcessHandler := True;
|
||||||
FMustCreateRenderProcessHandler := False;
|
FMustCreateRenderProcessHandler := False;
|
||||||
FMustCreateLoadHandler := False;
|
FMustCreateLoadHandler := False;
|
||||||
FMustCreatePrintHandler := False;
|
|
||||||
|
|
||||||
// ICefBrowserProcessHandler
|
// ICefBrowserProcessHandler
|
||||||
FOnGetCookieableSchemes := nil;
|
FOnGetCookieableSchemes := nil;
|
||||||
@ -829,14 +804,6 @@ begin
|
|||||||
FOnLoadEnd := nil;
|
FOnLoadEnd := nil;
|
||||||
FOnLoadError := nil;
|
FOnLoadError := nil;
|
||||||
|
|
||||||
// ICefPrintHandler
|
|
||||||
FOnPrintStart := nil;
|
|
||||||
FOnPrintSettings := nil;
|
|
||||||
FOnPrintDialog := nil;
|
|
||||||
FOnPrintJob := nil;
|
|
||||||
FOnPrintReset := nil;
|
|
||||||
FOnGetPDFPaperSize := nil;
|
|
||||||
|
|
||||||
UpdateDeviceScaleFactor;
|
UpdateDeviceScaleFactor;
|
||||||
|
|
||||||
FillChar(FAppSettings, SizeOf(TCefSettings), 0);
|
FillChar(FAppSettings, SizeOf(TCefSettings), 0);
|
||||||
@ -1135,7 +1102,7 @@ begin
|
|||||||
|
|
||||||
TempMissingSubProc := not(CheckSubprocessPath(FBrowserSubprocessPath, FMissingLibFiles));
|
TempMissingSubProc := not(CheckSubprocessPath(FBrowserSubprocessPath, FMissingLibFiles));
|
||||||
TempMissingFrm := not(CheckDLLs(FFrameworkDirPath, FMissingLibFiles));
|
TempMissingFrm := not(CheckDLLs(FFrameworkDirPath, FMissingLibFiles));
|
||||||
TempMissingRsc := not(CheckResources(ResourcesDirPath, FMissingLibFiles, FCheckDevToolsResources, not(FDisableExtensions)));
|
TempMissingRsc := not(CheckResources(ResourcesDirPath, FMissingLibFiles));
|
||||||
TempMissingLoc := not(CheckLocales(LocalesDirPath, FMissingLibFiles, FLocalesRequired));
|
TempMissingLoc := not(CheckLocales(LocalesDirPath, FMissingLibFiles, FLocalesRequired));
|
||||||
|
|
||||||
if TempMissingFrm or TempMissingRsc or TempMissingLoc or TempMissingSubProc then
|
if TempMissingFrm or TempMissingRsc or TempMissingLoc or TempMissingSubProc then
|
||||||
@ -1428,6 +1395,8 @@ begin
|
|||||||
aSettings.ignore_certificate_errors := Ord(FIgnoreCertificateErrors);
|
aSettings.ignore_certificate_errors := Ord(FIgnoreCertificateErrors);
|
||||||
aSettings.background_color := FBackgroundColor;
|
aSettings.background_color := FBackgroundColor;
|
||||||
aSettings.accept_language_list := CefString(FAcceptLanguageList);
|
aSettings.accept_language_list := CefString(FAcceptLanguageList);
|
||||||
|
aSettings.cookieable_schemes_list := CefString(FCookieableSchemesList);
|
||||||
|
aSettings.cookieable_schemes_exclude_defaults := Ord(FCookieableSchemesExcludeDefaults);
|
||||||
aSettings.application_client_id_for_file_scanning := CefString(FApplicationClientID);
|
aSettings.application_client_id_for_file_scanning := CefString(FApplicationClientID);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1632,24 +1601,6 @@ begin
|
|||||||
raise Exception.Create(aError);
|
raise Exception.Create(aError);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefApplicationCore.UpdateSupportedSchemes(aIncludeDefaults : boolean);
|
|
||||||
var
|
|
||||||
TempManager : ICefCookieManager;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FSupportedSchemes <> nil) and
|
|
||||||
(FSupportedSchemes.Count > 0) then
|
|
||||||
begin
|
|
||||||
TempManager := TCefCookieManagerRef.Global(nil);
|
|
||||||
|
|
||||||
if (TempManager <> nil) then
|
|
||||||
TempManager.SetSupportedSchemes(FSupportedSchemes, aIncludeDefaults, nil);
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
TempManager := nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCefApplicationCore.ParseProcessType : TCefProcessType;
|
function TCefApplicationCore.ParseProcessType : TCefProcessType;
|
||||||
const
|
const
|
||||||
TYPE_PARAMETER_NAME = '--type=';
|
TYPE_PARAMETER_NAME = '--type=';
|
||||||
@ -1694,7 +1645,6 @@ end;
|
|||||||
procedure TCefApplicationCore.Internal_OnContextInitialized;
|
procedure TCefApplicationCore.Internal_OnContextInitialized;
|
||||||
begin
|
begin
|
||||||
FGlobalContextInitialized := True;
|
FGlobalContextInitialized := True;
|
||||||
UpdateSupportedSchemes;
|
|
||||||
|
|
||||||
if assigned(FOnContextInitialized) then
|
if assigned(FOnContextInitialized) then
|
||||||
FOnContextInitialized();
|
FOnContextInitialized();
|
||||||
@ -1837,42 +1787,6 @@ begin
|
|||||||
FOnGetDefaultClient(aClient);
|
FOnGetDefaultClient(aClient);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefApplicationCore.Internal_OnPrintStart(const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
if assigned(FOnPrintStart) then
|
|
||||||
FOnPrintStart(browser);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefApplicationCore.Internal_OnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
|
||||||
begin
|
|
||||||
if assigned(FOnPrintSettings) then
|
|
||||||
FOnPrintSettings(browser, settings, getDefaults);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefApplicationCore.Internal_OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
|
||||||
begin
|
|
||||||
if assigned(FOnPrintDialog) then
|
|
||||||
FOnPrintDialog(browser, hasSelection, callback, aResult);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefApplicationCore.Internal_OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
|
||||||
begin
|
|
||||||
if assigned(FOnPrintJob) then
|
|
||||||
FOnPrintJob(browser, documentName, PDFFilePath, callback, aResult);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefApplicationCore.Internal_OnPrintReset(const browser: ICefBrowser);
|
|
||||||
begin
|
|
||||||
if assigned(FOnPrintReset) then
|
|
||||||
FOnPrintReset(browser);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefApplicationCore.Internal_OnGetPDFPaperSize(deviceUnitsPerInch: Integer; var aResult : TCefSize);
|
|
||||||
begin
|
|
||||||
if assigned(FOnGetPDFPaperSize) then
|
|
||||||
FOnGetPDFPaperSize(deviceUnitsPerInch, aResult);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefApplicationCore.AppendSwitch(var aKeys, aValues : TStringList; const aNewKey, aNewValue : ustring);
|
procedure TCefApplicationCore.AppendSwitch(var aKeys, aValues : TStringList; const aNewKey, aNewValue : ustring);
|
||||||
var
|
var
|
||||||
TempKey, TempHyphenatedKey : ustring;
|
TempKey, TempHyphenatedKey : ustring;
|
||||||
@ -2305,7 +2219,6 @@ function TCefApplicationCore.GetMustCreateBrowserProcessHandler : boolean;
|
|||||||
begin
|
begin
|
||||||
Result := ((FSingleProcess or (FProcessType = ptBrowser)) and
|
Result := ((FSingleProcess or (FProcessType = ptBrowser)) and
|
||||||
(FMustCreateBrowserProcessHandler or
|
(FMustCreateBrowserProcessHandler or
|
||||||
MustCreatePrintHandler or
|
|
||||||
assigned(FOnGetCookieableSchemes) or
|
assigned(FOnGetCookieableSchemes) or
|
||||||
assigned(FOnContextInitialized) or
|
assigned(FOnContextInitialized) or
|
||||||
assigned(FOnBeforeChildProcessLaunch) or
|
assigned(FOnBeforeChildProcessLaunch) or
|
||||||
@ -2338,22 +2251,6 @@ begin
|
|||||||
assigned(FOnLoadError)));
|
assigned(FOnLoadError)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefApplicationCore.GetMustCreatePrintHandler : boolean;
|
|
||||||
begin
|
|
||||||
{$IFDEF LINUX}
|
|
||||||
Result := ((FSingleProcess or (FProcessType = ptBrowser)) and
|
|
||||||
(FMustCreatePrintHandler or
|
|
||||||
assigned(FOnPrintStart) or
|
|
||||||
assigned(FOnPrintSettings) or
|
|
||||||
assigned(FOnPrintDialog) or
|
|
||||||
assigned(FOnPrintJob) or
|
|
||||||
assigned(FOnPrintReset) or
|
|
||||||
assigned(FOnGetPDFPaperSize)));
|
|
||||||
{$ELSE}
|
|
||||||
Result := False;
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCefApplicationCore.GetGlobalContextInitialized : boolean;
|
function TCefApplicationCore.GetGlobalContextInitialized : boolean;
|
||||||
begin
|
begin
|
||||||
Result := FGlobalContextInitialized or not(MustCreateBrowserProcessHandler);
|
Result := FGlobalContextInitialized or not(MustCreateBrowserProcessHandler);
|
||||||
|
@ -59,10 +59,8 @@ uses
|
|||||||
type
|
type
|
||||||
TCefBrowserProcessHandlerOwn = class(TCefBaseRefCountedOwn, ICefBrowserProcessHandler)
|
TCefBrowserProcessHandlerOwn = class(TCefBaseRefCountedOwn, ICefBrowserProcessHandler)
|
||||||
protected
|
protected
|
||||||
procedure GetCookieableSchemes(var schemes: TStringList; var include_defaults : boolean); virtual; abstract;
|
|
||||||
procedure OnContextInitialized; virtual; abstract;
|
procedure OnContextInitialized; virtual; abstract;
|
||||||
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); virtual; abstract;
|
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); virtual; abstract;
|
||||||
procedure GetPrintHandler(var aHandler : ICefPrintHandler); virtual;
|
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; abstract;
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; abstract;
|
||||||
procedure GetDefaultClient(var aClient : ICefClient); virtual;
|
procedure GetDefaultClient(var aClient : ICefClient); virtual;
|
||||||
|
|
||||||
@ -75,12 +73,9 @@ type
|
|||||||
TCefCustomBrowserProcessHandler = class(TCefBrowserProcessHandlerOwn)
|
TCefCustomBrowserProcessHandler = class(TCefBrowserProcessHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FCefApp : TCefApplicationCore;
|
FCefApp : TCefApplicationCore;
|
||||||
FPrintHandler : ICefPrintHandler;
|
|
||||||
|
|
||||||
procedure GetCookieableSchemes(var schemes: TStringList; var include_defaults : boolean); override;
|
|
||||||
procedure OnContextInitialized; override;
|
procedure OnContextInitialized; override;
|
||||||
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); override;
|
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); override;
|
||||||
procedure GetPrintHandler(var aHandler : ICefPrintHandler); override;
|
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64); override;
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64); override;
|
||||||
procedure GetDefaultClient(var aClient : ICefClient); override;
|
procedure GetDefaultClient(var aClient : ICefClient); override;
|
||||||
|
|
||||||
@ -99,47 +94,7 @@ uses
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
SysUtils,
|
SysUtils,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFCommandLine, uCEFListValue, uCEFConstants, uCEFStringList,
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFCommandLine, uCEFListValue, uCEFConstants, uCEFStringList;
|
||||||
uCEFPrintHandler;
|
|
||||||
|
|
||||||
procedure cef_browser_process_handler_get_cookieable_schemes(self : PCefBrowserProcessHandler;
|
|
||||||
schemes : TCefStringList;
|
|
||||||
include_defaults : PInteger); stdcall;
|
|
||||||
var
|
|
||||||
TempSL : TStringList;
|
|
||||||
TempCefSL : ICefStringList;
|
|
||||||
TempObject : TObject;
|
|
||||||
TempIncDef : boolean;
|
|
||||||
begin
|
|
||||||
TempSL := nil;
|
|
||||||
|
|
||||||
try
|
|
||||||
try
|
|
||||||
TempObject := CefGetObject(self);
|
|
||||||
|
|
||||||
if (schemes <> nil) and (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
|
||||||
begin
|
|
||||||
TempIncDef := (include_defaults^ <> 0);
|
|
||||||
TempSL := TStringList.Create;
|
|
||||||
TempCefSL := TCefStringListRef.Create(schemes);
|
|
||||||
TempCefSL.CopyToStrings(TempSL);
|
|
||||||
|
|
||||||
TCefBrowserProcessHandlerOwn(TempObject).GetCookieableSchemes(TempSL, TempIncDef);
|
|
||||||
|
|
||||||
TempCefSL.Clear;
|
|
||||||
TempCefSL.AddStrings(TempSL);
|
|
||||||
|
|
||||||
include_defaults^ := ord(TempIncDef);
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('cef_browser_process_handler_get_cookieable_schemes', e) then raise;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
if (TempSL <> nil) then FreeAndNil(TempSL);
|
|
||||||
TempCefSL := nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure cef_browser_process_handler_on_context_initialized(self: PCefBrowserProcessHandler); stdcall;
|
procedure cef_browser_process_handler_on_context_initialized(self: PCefBrowserProcessHandler); stdcall;
|
||||||
var
|
var
|
||||||
@ -164,25 +119,6 @@ begin
|
|||||||
TCefBrowserProcessHandlerOwn(TempObject).OnBeforeChildProcessLaunch(TCefCommandLineRef.UnWrap(command_line));
|
TCefBrowserProcessHandlerOwn(TempObject).OnBeforeChildProcessLaunch(TCefCommandLineRef.UnWrap(command_line));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_browser_process_handler_get_print_handler(self: PCefBrowserProcessHandler): PCefPrintHandler; stdcall;
|
|
||||||
var
|
|
||||||
TempObject : TObject;
|
|
||||||
TempHandler : ICefPrintHandler;
|
|
||||||
begin
|
|
||||||
Result := nil;
|
|
||||||
TempObject := CefGetObject(self);
|
|
||||||
|
|
||||||
if (TempObject <> nil) and
|
|
||||||
(TempObject is TCefBrowserProcessHandlerOwn) then
|
|
||||||
try
|
|
||||||
TempHandler := nil;
|
|
||||||
TCefBrowserProcessHandlerOwn(TempObject).GetPrintHandler(TempHandler);
|
|
||||||
if (TempHandler <> nil) then Result := TempHandler.Wrap;
|
|
||||||
finally
|
|
||||||
TempHandler := nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure cef_browser_process_handler_on_schedule_message_pump_work(self : PCefBrowserProcessHandler;
|
procedure cef_browser_process_handler_on_schedule_message_pump_work(self : PCefBrowserProcessHandler;
|
||||||
delay_ms : Int64); stdcall;
|
delay_ms : Int64); stdcall;
|
||||||
var
|
var
|
||||||
@ -220,20 +156,13 @@ begin
|
|||||||
|
|
||||||
with PCefBrowserProcessHandler(FData)^ do
|
with PCefBrowserProcessHandler(FData)^ do
|
||||||
begin
|
begin
|
||||||
get_cookieable_schemes := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_get_cookieable_schemes;
|
|
||||||
on_context_initialized := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_on_context_initialized;
|
on_context_initialized := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_on_context_initialized;
|
||||||
on_before_child_process_launch := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_on_before_child_process_launch;
|
on_before_child_process_launch := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_on_before_child_process_launch;
|
||||||
get_print_handler := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_get_print_handler;
|
|
||||||
on_schedule_message_pump_work := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_on_schedule_message_pump_work;
|
on_schedule_message_pump_work := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_on_schedule_message_pump_work;
|
||||||
get_default_client := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_get_default_client;
|
get_default_client := {$IFDEF FPC}@{$ENDIF}cef_browser_process_handler_get_default_client;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefBrowserProcessHandlerOwn.GetPrintHandler(var aHandler : ICefPrintHandler);
|
|
||||||
begin
|
|
||||||
aHandler := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefBrowserProcessHandlerOwn.GetDefaultClient(var aClient : ICefClient);
|
procedure TCefBrowserProcessHandlerOwn.GetDefaultClient(var aClient : ICefClient);
|
||||||
begin
|
begin
|
||||||
aClient := nil;
|
aClient := nil;
|
||||||
@ -248,11 +177,6 @@ begin
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FCefApp := aCefApp;
|
FCefApp := aCefApp;
|
||||||
|
|
||||||
if (FCefApp <> nil) and FCefApp.MustCreatePrintHandler then
|
|
||||||
FPrintHandler := TCustomPrintHandler.Create(FCefApp)
|
|
||||||
else
|
|
||||||
FPrintHandler := nil;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefCustomBrowserProcessHandler.Destroy;
|
destructor TCefCustomBrowserProcessHandler.Destroy;
|
||||||
@ -261,25 +185,9 @@ begin
|
|||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.RemoveReferences;
|
procedure TCefCustomBrowserProcessHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
if (FPrintHandler <> nil) then
|
|
||||||
FPrintHandler.RemoveReferences;
|
|
||||||
|
|
||||||
FCefApp := nil;
|
FCefApp := nil;
|
||||||
FPrintHandler := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.GetCookieableSchemes(var schemes : TStringList;
|
|
||||||
var include_defaults : boolean);
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_GetCookieableSchemes(schemes, include_defaults);
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCefCustomBrowserProcessHandler.GetCookieableSchemes', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.OnContextInitialized;
|
procedure TCefCustomBrowserProcessHandler.OnContextInitialized;
|
||||||
@ -302,14 +210,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.GetPrintHandler(var aHandler : ICefPrintHandler);
|
|
||||||
begin
|
|
||||||
if (FPrintHandler <> nil) then
|
|
||||||
aHandler := FPrintHandler
|
|
||||||
else
|
|
||||||
inherited GetPrintHandler(aHandler);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.OnScheduleMessagePumpWork(const delayMs: Int64);
|
procedure TCefCustomBrowserProcessHandler.OnScheduleMessagePumpWork(const delayMs: Int64);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -60,6 +60,7 @@ type
|
|||||||
TCefBrowserViewRef = class(TCefViewRef, ICefBrowserView)
|
TCefBrowserViewRef = class(TCefViewRef, ICefBrowserView)
|
||||||
protected
|
protected
|
||||||
function GetBrowser : ICefBrowser;
|
function GetBrowser : ICefBrowser;
|
||||||
|
function GetChromeToolbar : ICefView;
|
||||||
procedure SetPreferAccelerators(prefer_accelerators: boolean);
|
procedure SetPreferAccelerators(prefer_accelerators: boolean);
|
||||||
|
|
||||||
public
|
public
|
||||||
@ -78,6 +79,11 @@ begin
|
|||||||
Result := TCefBrowserRef.UnWrap(PCefBrowserView(FData)^.get_browser(PCefBrowserView(FData)));
|
Result := TCefBrowserRef.UnWrap(PCefBrowserView(FData)^.get_browser(PCefBrowserView(FData)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCefBrowserViewRef.GetChromeToolbar : ICefView;
|
||||||
|
begin
|
||||||
|
Result := TCefViewRef.UnWrap(PCefBrowserView(FData)^.get_chrome_toolbar(PCefBrowserView(FData)));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefBrowserViewRef.SetPreferAccelerators(prefer_accelerators: boolean);
|
procedure TCefBrowserViewRef.SetPreferAccelerators(prefer_accelerators: boolean);
|
||||||
begin
|
begin
|
||||||
PCefBrowserView(FData)^.set_prefer_accelerators(PCefBrowserView(FData),
|
PCefBrowserView(FData)^.set_prefer_accelerators(PCefBrowserView(FData),
|
||||||
|
@ -71,6 +71,7 @@ type
|
|||||||
FOnBrowserDestroyed : TOnBrowserDestroyedEvent;
|
FOnBrowserDestroyed : TOnBrowserDestroyedEvent;
|
||||||
FOnGetDelegateForPopupBrowserView : TOnGetDelegateForPopupBrowserViewEvent;
|
FOnGetDelegateForPopupBrowserView : TOnGetDelegateForPopupBrowserViewEvent;
|
||||||
FOnPopupBrowserViewCreated : TOnPopupBrowserViewCreatedEvent;
|
FOnPopupBrowserViewCreated : TOnPopupBrowserViewCreatedEvent;
|
||||||
|
FOnGetChromeToolbarType : TOnGetChromeToolbarTypeEvent;
|
||||||
|
|
||||||
procedure DestroyView; override;
|
procedure DestroyView; override;
|
||||||
procedure Initialize; override;
|
procedure Initialize; override;
|
||||||
@ -85,6 +86,7 @@ type
|
|||||||
procedure doOnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
procedure doOnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
||||||
procedure doOnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
procedure doOnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
||||||
procedure doOnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
procedure doOnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
||||||
|
procedure doOnGetChromeToolbarType(var aChromeToolbarType: TCefChromeToolbarType);
|
||||||
|
|
||||||
public
|
public
|
||||||
function CreateBrowserView(const client: ICefClient; const url: ustring; const settings: TCefBrowserSettings; const extra_info: ICefDictionaryValue; const request_context: ICefRequestContext): boolean;
|
function CreateBrowserView(const client: ICefClient; const url: ustring; const settings: TCefBrowserSettings; const extra_info: ICefDictionaryValue; const request_context: ICefRequestContext): boolean;
|
||||||
@ -99,6 +101,7 @@ type
|
|||||||
property OnBrowserDestroyed : TOnBrowserDestroyedEvent read FOnBrowserDestroyed write FOnBrowserDestroyed;
|
property OnBrowserDestroyed : TOnBrowserDestroyedEvent read FOnBrowserDestroyed write FOnBrowserDestroyed;
|
||||||
property OnGetDelegateForPopupBrowserView : TOnGetDelegateForPopupBrowserViewEvent read FOnGetDelegateForPopupBrowserView write FOnGetDelegateForPopupBrowserView;
|
property OnGetDelegateForPopupBrowserView : TOnGetDelegateForPopupBrowserViewEvent read FOnGetDelegateForPopupBrowserView write FOnGetDelegateForPopupBrowserView;
|
||||||
property OnPopupBrowserViewCreated : TOnPopupBrowserViewCreatedEvent read FOnPopupBrowserViewCreated write FOnPopupBrowserViewCreated;
|
property OnPopupBrowserViewCreated : TOnPopupBrowserViewCreatedEvent read FOnPopupBrowserViewCreated write FOnPopupBrowserViewCreated;
|
||||||
|
property OnGetChromeToolbarType : TOnGetChromeToolbarTypeEvent read FOnGetChromeToolbarType write FOnGetChromeToolbarType;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
@ -147,6 +150,7 @@ begin
|
|||||||
FOnBrowserDestroyed := nil;
|
FOnBrowserDestroyed := nil;
|
||||||
FOnGetDelegateForPopupBrowserView := nil;
|
FOnGetDelegateForPopupBrowserView := nil;
|
||||||
FOnPopupBrowserViewCreated := nil;
|
FOnPopupBrowserViewCreated := nil;
|
||||||
|
FOnGetChromeToolbarType := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEFBrowserViewComponent.DestroyView;
|
procedure TCEFBrowserViewComponent.DestroyView;
|
||||||
@ -250,6 +254,12 @@ begin
|
|||||||
FOnPopupBrowserViewCreated(self, browser_view, popup_browser_view, is_devtools, aResult);
|
FOnPopupBrowserViewCreated(self, browser_view, popup_browser_view, is_devtools, aResult);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEFBrowserViewComponent.doOnGetChromeToolbarType(var aChromeToolbarType: TCefChromeToolbarType);
|
||||||
|
begin
|
||||||
|
if assigned(FOnGetChromeToolbarType) then
|
||||||
|
FOnGetChromeToolbarType(self, aChromeToolbarType);
|
||||||
|
end;
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
|
@ -63,6 +63,7 @@ type
|
|||||||
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
||||||
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
||||||
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
||||||
|
function GetChromeToolbarType: TCefChromeToolbarType;
|
||||||
|
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefBrowserViewDelegate;
|
class function UnWrap(data: Pointer): ICefBrowserViewDelegate;
|
||||||
@ -74,6 +75,7 @@ type
|
|||||||
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser); virtual;
|
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser); virtual;
|
||||||
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate); virtual;
|
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate); virtual;
|
||||||
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean); virtual;
|
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean); virtual;
|
||||||
|
function GetChromeToolbarType: TCefChromeToolbarType; virtual;
|
||||||
|
|
||||||
procedure InitializeCEFMethods; override;
|
procedure InitializeCEFMethods; override;
|
||||||
|
|
||||||
@ -92,6 +94,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -100,6 +103,7 @@ type
|
|||||||
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser); override;
|
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser); override;
|
||||||
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate); override;
|
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate); override;
|
||||||
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean); override;
|
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean); override;
|
||||||
|
function GetChromeToolbarType: TCefChromeToolbarType; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: ICefBrowserViewDelegateEvents); reintroduce;
|
constructor Create(const events: ICefBrowserViewDelegateEvents); reintroduce;
|
||||||
@ -108,7 +112,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
uCEFLibFunctions, uCEFMiscFunctions, uCEFBrowserView, uCEFBrowser, uCEFClient;
|
uCEFLibFunctions, uCEFMiscFunctions, uCEFBrowserView, uCEFBrowser, uCEFClient, uCEFConstants;
|
||||||
|
|
||||||
|
|
||||||
// **************************************************************
|
// **************************************************************
|
||||||
@ -155,6 +159,11 @@ begin
|
|||||||
ord(is_devtools)) <> 0);
|
ord(is_devtools)) <> 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCefBrowserViewDelegateRef.GetChromeToolbarType: TCefChromeToolbarType;
|
||||||
|
begin
|
||||||
|
Result := PCefBrowserViewDelegate(FData)^.get_chrome_toolbar_type(PCefBrowserViewDelegate(FData));
|
||||||
|
end;
|
||||||
|
|
||||||
class function TCefBrowserViewDelegateRef.UnWrap(data: Pointer): ICefBrowserViewDelegate;
|
class function TCefBrowserViewDelegateRef.UnWrap(data: Pointer): ICefBrowserViewDelegate;
|
||||||
begin
|
begin
|
||||||
if (data <> nil) then
|
if (data <> nil) then
|
||||||
@ -236,6 +245,17 @@ begin
|
|||||||
Result := ord(TempResult);
|
Result := ord(TempResult);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function cef_browserview_delegate_get_chrome_toolbar_type(self : PCefBrowserViewDelegate): TCefChromeToolbarType; stdcall;
|
||||||
|
var
|
||||||
|
TempObject : TObject;
|
||||||
|
begin
|
||||||
|
TempObject := CefGetObject(self);
|
||||||
|
Result := CEF_CTT_NONE;
|
||||||
|
|
||||||
|
if (TempObject <> nil) and (TempObject is TCefBrowserViewDelegateOwn) then
|
||||||
|
Result := TCefBrowserViewDelegateOwn(TempObject).GetChromeToolbarType();
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TCefBrowserViewDelegateOwn.Create;
|
constructor TCefBrowserViewDelegateOwn.Create;
|
||||||
begin
|
begin
|
||||||
inherited CreateData(SizeOf(TCefBrowserViewDelegate));
|
inherited CreateData(SizeOf(TCefBrowserViewDelegate));
|
||||||
@ -253,6 +273,7 @@ begin
|
|||||||
on_browser_destroyed := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_on_browser_destroyed;
|
on_browser_destroyed := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_on_browser_destroyed;
|
||||||
get_delegate_for_popup_browser_view := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_get_delegate_for_popup_browser_view;
|
get_delegate_for_popup_browser_view := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_get_delegate_for_popup_browser_view;
|
||||||
on_popup_browser_view_created := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_on_popup_browser_view_created;
|
on_popup_browser_view_created := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_on_popup_browser_view_created;
|
||||||
|
get_chrome_toolbar_type := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_get_chrome_toolbar_type;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -276,6 +297,11 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCefBrowserViewDelegateOwn.GetChromeToolbarType: TCefChromeToolbarType;
|
||||||
|
begin
|
||||||
|
Result := CEF_CTT_NONE;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// **************************************************************
|
// **************************************************************
|
||||||
// **************** TCustomBrowserViewDelegate ******************
|
// **************** TCustomBrowserViewDelegate ******************
|
||||||
@ -354,6 +380,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomBrowserViewDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefBrowserViewDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomBrowserViewDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomBrowserViewDelegate.OnFocus(const view: ICefView);
|
procedure TCustomBrowserViewDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
@ -420,6 +457,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomBrowserViewDelegate.GetChromeToolbarType: TCefChromeToolbarType;
|
||||||
|
begin
|
||||||
|
Result := inherited GetChromeToolbarType();
|
||||||
|
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefBrowserViewDelegateEvents(FEvents).doOnGetChromeToolbarType(Result);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomBrowserViewDelegate.GetChromeToolbarType', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -104,8 +104,8 @@ type
|
|||||||
function CreateBrowser(aParentHandle: TCefWindowHandle;
|
function CreateBrowser(aParentHandle: TCefWindowHandle;
|
||||||
aParentRect: TRect; const aWindowName: ustring = '';
|
aParentRect: TRect; const aWindowName: ustring = '';
|
||||||
const aContext: ICefRequestContext = nil;
|
const aContext: ICefRequestContext = nil;
|
||||||
const aExtraInfo: ICefDictionaryValue = nil): boolean; overload; override;
|
const aExtraInfo: ICefDictionaryValue = nil;
|
||||||
procedure CreateBrowser(const aWindowName: ustring); overload; override;
|
aForceAsPopup : boolean = False): boolean; overload; override;
|
||||||
function CreateBrowser(const aURL: ustring;
|
function CreateBrowser(const aURL: ustring;
|
||||||
const aBrowserViewComp: TCEFBrowserViewComponent;
|
const aBrowserViewComp: TCEFBrowserViewComponent;
|
||||||
const aContext: ICefRequestContext = nil;
|
const aContext: ICefRequestContext = nil;
|
||||||
@ -369,19 +369,12 @@ end;
|
|||||||
|
|
||||||
function TEmbeddedChromium.CreateBrowser(aParentHandle: TCefWindowHandle;
|
function TEmbeddedChromium.CreateBrowser(aParentHandle: TCefWindowHandle;
|
||||||
aParentRect: TRect; const aWindowName: ustring;
|
aParentRect: TRect; const aWindowName: ustring;
|
||||||
const aContext: ICefRequestContext; const aExtraInfo: ICefDictionaryValue): boolean;
|
const aContext: ICefRequestContext; const aExtraInfo: ICefDictionaryValue;
|
||||||
|
aForceAsPopup : boolean): boolean;
|
||||||
begin
|
begin
|
||||||
FState := csCreatingBrowser;
|
FState := csCreatingBrowser;
|
||||||
Result := inherited CreateBrowser(aParentHandle, aParentRect, aWindowName,
|
Result := inherited CreateBrowser(aParentHandle, aParentRect, aWindowName,
|
||||||
aContext, aExtraInfo);
|
aContext, aExtraInfo, aForceAsPopup);
|
||||||
if Initialized then
|
|
||||||
DoCreated(0);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TEmbeddedChromium.CreateBrowser(const aWindowName: ustring);
|
|
||||||
begin
|
|
||||||
FState := csCreatingBrowser;
|
|
||||||
inherited CreateBrowser(aWindowName);
|
|
||||||
if Initialized then
|
if Initialized then
|
||||||
DoCreated(0);
|
DoCreated(0);
|
||||||
end;
|
end;
|
||||||
|
@ -87,6 +87,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -258,6 +259,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomButtonDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefButtonDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomButtonDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomButtonDelegate.OnFocus(const view: ICefView);
|
procedure TCustomButtonDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -304,6 +304,14 @@ type
|
|||||||
FOnExtensionCanAccessBrowser : TOnCanAccessBrowserEvent;
|
FOnExtensionCanAccessBrowser : TOnCanAccessBrowserEvent;
|
||||||
FOnExtensionGetExtensionResource : TOnGetExtensionResourceEvent;
|
FOnExtensionGetExtensionResource : TOnGetExtensionResourceEvent;
|
||||||
|
|
||||||
|
// ICefPrintHandler
|
||||||
|
FOnPrintStart : TOnPrintStartEvent;
|
||||||
|
FOnPrintSettings : TOnPrintSettingsEvent;
|
||||||
|
FOnPrintDialog : TOnPrintDialogEvent;
|
||||||
|
FOnPrintJob : TOnPrintJobEvent;
|
||||||
|
FOnPrintReset : TOnPrintResetEvent;
|
||||||
|
FOnGetPDFPaperSize : TOnGetPDFPaperSizeEvent;
|
||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
FOnTextResultAvailable : TOnTextResultAvailableEvent;
|
FOnTextResultAvailable : TOnTextResultAvailableEvent;
|
||||||
FOnPdfPrintFinished : TOnPdfPrintFinishedEvent;
|
FOnPdfPrintFinished : TOnPdfPrintFinishedEvent;
|
||||||
@ -399,8 +407,6 @@ type
|
|||||||
procedure SetAcceptLanguageList(const aValue : ustring);
|
procedure SetAcceptLanguageList(const aValue : ustring);
|
||||||
procedure SetAcceptCookies(const aValue : TCefCookiePref);
|
procedure SetAcceptCookies(const aValue : TCefCookiePref);
|
||||||
procedure SetBlock3rdPartyCookies(const aValue : boolean);
|
procedure SetBlock3rdPartyCookies(const aValue : boolean);
|
||||||
procedure SetOnRequestContextInitialized(const aValue : TOnRequestContextInitialized);
|
|
||||||
procedure SetOnBeforePluginLoad(const aValue : TOnBeforePluginLoad);
|
|
||||||
procedure SetMultiBrowserMode(aValue : boolean);
|
procedure SetMultiBrowserMode(aValue : boolean);
|
||||||
procedure SetNetworkPredictions(aValue : TCefNetworkPredictionOptions);
|
procedure SetNetworkPredictions(aValue : TCefNetworkPredictionOptions);
|
||||||
procedure SetQuicAllowed(aValue : boolean);
|
procedure SetQuicAllowed(aValue : boolean);
|
||||||
@ -419,7 +425,6 @@ type
|
|||||||
procedure DestroyExtensionHandler;
|
procedure DestroyExtensionHandler;
|
||||||
procedure DestroyAllHandlersAndObservers;
|
procedure DestroyAllHandlersAndObservers;
|
||||||
|
|
||||||
procedure CreateReqContextHandler;
|
|
||||||
procedure CreateResourceRequestHandler;
|
procedure CreateResourceRequestHandler;
|
||||||
procedure CreateMediaObserver;
|
procedure CreateMediaObserver;
|
||||||
procedure CreateDevToolsMsgObserver;
|
procedure CreateDevToolsMsgObserver;
|
||||||
@ -622,6 +627,14 @@ type
|
|||||||
function doOnExtensionCanAccessBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser): boolean;
|
function doOnExtensionCanAccessBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser): boolean;
|
||||||
function doOnExtensionGetExtensionResource(const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback): boolean;
|
function doOnExtensionGetExtensionResource(const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback): boolean;
|
||||||
|
|
||||||
|
// ICefPrintHandler
|
||||||
|
procedure doOnPrintStart(const browser: ICefBrowser);
|
||||||
|
procedure doOnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
||||||
|
procedure doOnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
||||||
|
procedure doOnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
||||||
|
procedure doOnPrintReset(const browser: ICefBrowser);
|
||||||
|
procedure doOnGetPDFPaperSize(const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult : TCefSize);
|
||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
||||||
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
||||||
@ -666,9 +679,9 @@ type
|
|||||||
function MustCreateFindHandler : boolean; virtual;
|
function MustCreateFindHandler : boolean; virtual;
|
||||||
function MustCreateResourceRequestHandler : boolean; virtual;
|
function MustCreateResourceRequestHandler : boolean; virtual;
|
||||||
function MustCreateCookieAccessFilter : boolean; virtual;
|
function MustCreateCookieAccessFilter : boolean; virtual;
|
||||||
function MustCreateRequestContextHandler : boolean; virtual;
|
|
||||||
function MustCreateMediaObserver : boolean; virtual;
|
function MustCreateMediaObserver : boolean; virtual;
|
||||||
function MustCreateExtensionHandler : boolean; virtual;
|
function MustCreateExtensionHandler : boolean; virtual;
|
||||||
|
function MustCreatePrintHandler : boolean; virtual;
|
||||||
|
|
||||||
property ParentFormHandle : TCefWindowHandle read GetParentFormHandle;
|
property ParentFormHandle : TCefWindowHandle read GetParentFormHandle;
|
||||||
|
|
||||||
@ -690,9 +703,8 @@ type
|
|||||||
function SetNewBrowserParent(aNewParentHwnd : HWND) : boolean;
|
function SetNewBrowserParent(aNewParentHwnd : HWND) : boolean;
|
||||||
{$ENDIF MSWINDOWS}
|
{$ENDIF MSWINDOWS}
|
||||||
|
|
||||||
function CreateBrowser(aParentHandle : TCefWindowHandle; aParentRect : TRect; const aWindowName : ustring = ''; const aContext : ICefRequestContext = nil; const aExtraInfo : ICefDictionaryValue = nil) : boolean; overload; virtual;
|
function CreateBrowser(aParentHandle : TCefWindowHandle; aParentRect : TRect; const aWindowName : ustring = ''; const aContext : ICefRequestContext = nil; const aExtraInfo : ICefDictionaryValue = nil; aForceAsPopup : boolean = False) : boolean; overload; virtual;
|
||||||
function CreateBrowser(const aURL : ustring; const aBrowserViewComp : TCEFBrowserViewComponent; const aContext : ICefRequestContext = nil; const aExtraInfo : ICefDictionaryValue = nil) : boolean; overload; virtual;
|
function CreateBrowser(const aURL : ustring; const aBrowserViewComp : TCEFBrowserViewComponent; const aContext : ICefRequestContext = nil; const aExtraInfo : ICefDictionaryValue = nil) : boolean; overload; virtual;
|
||||||
procedure CreateBrowser(const aWindowName : ustring); overload; virtual;
|
|
||||||
|
|
||||||
procedure LoadURL(const aURL : ustring; const aFrameName : ustring = ''); overload;
|
procedure LoadURL(const aURL : ustring; const aFrameName : ustring = ''); overload;
|
||||||
procedure LoadURL(const aURL : ustring; const aFrame : ICefFrame); overload;
|
procedure LoadURL(const aURL : ustring; const aFrame : ICefFrame); overload;
|
||||||
@ -743,7 +755,6 @@ type
|
|||||||
function VisitURLCookies(const url : ustring; includeHttpOnly : boolean = False; aID : integer = 0) : boolean;
|
function VisitURLCookies(const url : ustring; includeHttpOnly : boolean = False; aID : integer = 0) : boolean;
|
||||||
function SetCookie(const url, name_, value, domain, path: ustring; secure, httponly, hasExpires: Boolean; const creation, lastAccess, expires: TDateTime; same_site : TCefCookieSameSite; priority : TCefCookiePriority; aSetImmediately : boolean = True; aID : integer = 0): Boolean;
|
function SetCookie(const url, name_, value, domain, path: ustring; secure, httponly, hasExpires: Boolean; const creation, lastAccess, expires: TDateTime; same_site : TCefCookieSameSite; priority : TCefCookiePriority; aSetImmediately : boolean = True; aID : integer = 0): Boolean;
|
||||||
function FlushCookieStore(aFlushImmediately : boolean = True) : boolean;
|
function FlushCookieStore(aFlushImmediately : boolean = True) : boolean;
|
||||||
procedure UpdateSupportedSchemes(const aSchemes : TStrings; aIncludeDefaults : boolean = True);
|
|
||||||
|
|
||||||
procedure ShowDevTools(const inspectElementAt: TPoint; aWindowInfo: PCefWindowInfo);
|
procedure ShowDevTools(const inspectElementAt: TPoint; aWindowInfo: PCefWindowInfo);
|
||||||
procedure CloseDevTools; overload;
|
procedure CloseDevTools; overload;
|
||||||
@ -1058,8 +1069,8 @@ type
|
|||||||
property OnFindResult : TOnFindResult read FOnFindResult write FOnFindResult;
|
property OnFindResult : TOnFindResult read FOnFindResult write FOnFindResult;
|
||||||
|
|
||||||
// ICefRequestContextHandler
|
// ICefRequestContextHandler
|
||||||
property OnRequestContextInitialized : TOnRequestContextInitialized read FOnRequestContextInitialized write SetOnRequestContextInitialized;
|
property OnRequestContextInitialized : TOnRequestContextInitialized read FOnRequestContextInitialized write FOnRequestContextInitialized;
|
||||||
property OnBeforePluginLoad : TOnBeforePluginLoad read FOnBeforePluginLoad write SetOnBeforePluginLoad;
|
property OnBeforePluginLoad : TOnBeforePluginLoad read FOnBeforePluginLoad write FOnBeforePluginLoad;
|
||||||
property OnGetResourceRequestHandler_ReqCtxHdlr : TOnGetResourceRequestHandler read FOnGetResourceRequestHandler_ReqCtxHdlr write FOnGetResourceRequestHandler_ReqCtxHdlr;
|
property OnGetResourceRequestHandler_ReqCtxHdlr : TOnGetResourceRequestHandler read FOnGetResourceRequestHandler_ReqCtxHdlr write FOnGetResourceRequestHandler_ReqCtxHdlr;
|
||||||
|
|
||||||
// ICefMediaObserver
|
// ICefMediaObserver
|
||||||
@ -1094,6 +1105,16 @@ type
|
|||||||
property OnExtensionGetActiveBrowser : TOnGetActiveBrowserEvent read FOnExtensionGetActiveBrowser write FOnExtensionGetActiveBrowser;
|
property OnExtensionGetActiveBrowser : TOnGetActiveBrowserEvent read FOnExtensionGetActiveBrowser write FOnExtensionGetActiveBrowser;
|
||||||
property OnExtensionCanAccessBrowser : TOnCanAccessBrowserEvent read FOnExtensionCanAccessBrowser write FOnExtensionCanAccessBrowser;
|
property OnExtensionCanAccessBrowser : TOnCanAccessBrowserEvent read FOnExtensionCanAccessBrowser write FOnExtensionCanAccessBrowser;
|
||||||
property OnExtensionGetExtensionResource : TOnGetExtensionResourceEvent read FOnExtensionGetExtensionResource write FOnExtensionGetExtensionResource;
|
property OnExtensionGetExtensionResource : TOnGetExtensionResourceEvent read FOnExtensionGetExtensionResource write FOnExtensionGetExtensionResource;
|
||||||
|
|
||||||
|
// ICefPrintHandler
|
||||||
|
{$IFDEF LINUX}
|
||||||
|
property OnPrintStart : TOnPrintStartEvent read FOnPrintStart write FOnPrintStart;
|
||||||
|
property OnPrintSettings : TOnPrintSettingsEvent read FOnPrintSettings write FOnPrintSettings;
|
||||||
|
property OnPrintDialog : TOnPrintDialogEvent read FOnPrintDialog write FOnPrintDialog;
|
||||||
|
property OnPrintJob : TOnPrintJobEvent read FOnPrintJob write FOnPrintJob;
|
||||||
|
property OnPrintReset : TOnPrintResetEvent read FOnPrintReset write FOnPrintReset;
|
||||||
|
property OnGetPDFPaperSize : TOnGetPDFPaperSizeEvent read FOnGetPDFPaperSize write FOnGetPDFPaperSize;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TBrowserInfo = class
|
TBrowserInfo = class
|
||||||
@ -1535,13 +1556,6 @@ begin
|
|||||||
DestroyClientHandler;
|
DestroyClientHandler;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.CreateReqContextHandler;
|
|
||||||
begin
|
|
||||||
if MustCreateRequestContextHandler and
|
|
||||||
(FReqContextHandler = nil) then
|
|
||||||
FReqContextHandler := TCustomRequestContextHandler.Create(self);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromiumCore.CreateMediaObserver;
|
procedure TChromiumCore.CreateMediaObserver;
|
||||||
begin
|
begin
|
||||||
if MustCreateMediaObserver and
|
if MustCreateMediaObserver and
|
||||||
@ -1586,6 +1600,7 @@ begin
|
|||||||
FPDFPrintOptions := TPDFPrintOptions.Create;
|
FPDFPrintOptions := TPDFPrintOptions.Create;
|
||||||
FZoomStepCS := TCriticalSection.Create;
|
FZoomStepCS := TCriticalSection.Create;
|
||||||
FBrowsersCS := TCriticalSection.Create;
|
FBrowsersCS := TCriticalSection.Create;
|
||||||
|
FReqContextHandler := TCustomRequestContextHandler.Create(self);
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
on e : exception do
|
on e : exception do
|
||||||
@ -1771,6 +1786,14 @@ begin
|
|||||||
FOnExtensionCanAccessBrowser := nil;
|
FOnExtensionCanAccessBrowser := nil;
|
||||||
FOnExtensionGetExtensionResource := nil;
|
FOnExtensionGetExtensionResource := nil;
|
||||||
|
|
||||||
|
// ICefPrintHandler
|
||||||
|
FOnPrintStart := nil;
|
||||||
|
FOnPrintSettings := nil;
|
||||||
|
FOnPrintDialog := nil;
|
||||||
|
FOnPrintJob := nil;
|
||||||
|
FOnPrintReset := nil;
|
||||||
|
FOnGetPDFPaperSize := nil;
|
||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
FOnTextResultAvailable := nil;
|
FOnTextResultAvailable := nil;
|
||||||
FOnPdfPrintFinished := nil;
|
FOnPdfPrintFinished := nil;
|
||||||
@ -1802,9 +1825,10 @@ function TChromiumCore.CreateBrowser( aParentHandle : TCefWindowHandle;
|
|||||||
aParentRect : TRect;
|
aParentRect : TRect;
|
||||||
const aWindowName : ustring;
|
const aWindowName : ustring;
|
||||||
const aContext : ICefRequestContext;
|
const aContext : ICefRequestContext;
|
||||||
const aExtraInfo : ICefDictionaryValue) : boolean;
|
const aExtraInfo : ICefDictionaryValue;
|
||||||
|
aForceAsPopup : boolean) : boolean;
|
||||||
var
|
var
|
||||||
TempNewContext, TempGlobalContext : ICefRequestContext;
|
TempNewContext, TempOldContext : ICefRequestContext;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
TempNewContext := nil;
|
TempNewContext := nil;
|
||||||
@ -1825,24 +1849,23 @@ begin
|
|||||||
CreateClientHandler(not(ValidCefWindowHandle(aParentHandle))) then
|
CreateClientHandler(not(ValidCefWindowHandle(aParentHandle))) then
|
||||||
begin
|
begin
|
||||||
GetSettings(FBrowserSettings);
|
GetSettings(FBrowserSettings);
|
||||||
|
|
||||||
|
if aForceAsPopup then
|
||||||
|
WindowInfoAsPopUp(FWindowInfo, aParentHandle, aWindowName)
|
||||||
|
else
|
||||||
InitializeWindowInfo(aParentHandle, aParentRect, aWindowName);
|
InitializeWindowInfo(aParentHandle, aParentRect, aWindowName);
|
||||||
|
|
||||||
CreateResourceRequestHandler;
|
CreateResourceRequestHandler;
|
||||||
CreateMediaObserver;
|
CreateMediaObserver;
|
||||||
CreateDevToolsMsgObserver;
|
CreateDevToolsMsgObserver;
|
||||||
CreateExtensionHandler;
|
CreateExtensionHandler;
|
||||||
|
|
||||||
if (aContext = nil) then
|
if (aContext = nil) then
|
||||||
begin
|
TempOldContext := TCefRequestContextRef.Global()
|
||||||
CreateReqContextHandler;
|
|
||||||
|
|
||||||
if (FReqContextHandler <> nil) then
|
|
||||||
begin
|
|
||||||
TempGlobalContext := TCefRequestContextRef.Global();
|
|
||||||
TempNewContext := TCefRequestContextRef.Shared(TempGlobalContext, FReqContextHandler);
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
TempNewContext := aContext;
|
TempOldContext := aContext;
|
||||||
|
|
||||||
|
TempNewContext := TCefRequestContextRef.Shared(TempOldContext, FReqContextHandler);
|
||||||
|
|
||||||
if GlobalCEFApp.MultiThreadedMessageLoop then
|
if GlobalCEFApp.MultiThreadedMessageLoop then
|
||||||
Result := CreateBrowserHost(@FWindowInfo, FDefaultUrl, @FBrowserSettings, aExtraInfo, TempNewContext)
|
Result := CreateBrowserHost(@FWindowInfo, FDefaultUrl, @FBrowserSettings, aExtraInfo, TempNewContext)
|
||||||
@ -1854,7 +1877,7 @@ begin
|
|||||||
if CustomExceptionHandler('TChromiumCore.CreateBrowser', e) then raise;
|
if CustomExceptionHandler('TChromiumCore.CreateBrowser', e) then raise;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
TempGlobalContext := nil;
|
TempOldContext := nil;
|
||||||
TempNewContext := nil;
|
TempNewContext := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1864,9 +1887,10 @@ function TChromiumCore.CreateBrowser(const aURL : ustring;
|
|||||||
const aContext : ICefRequestContext;
|
const aContext : ICefRequestContext;
|
||||||
const aExtraInfo : ICefDictionaryValue) : boolean;
|
const aExtraInfo : ICefDictionaryValue) : boolean;
|
||||||
var
|
var
|
||||||
TempNewContext, TempGlobalContext : ICefRequestContext;
|
TempNewContext, TempOldContext : ICefRequestContext;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
TempNewContext := nil;
|
||||||
|
|
||||||
try
|
try
|
||||||
try
|
try
|
||||||
@ -1891,17 +1915,11 @@ begin
|
|||||||
CreateExtensionHandler;
|
CreateExtensionHandler;
|
||||||
|
|
||||||
if (aContext = nil) then
|
if (aContext = nil) then
|
||||||
begin
|
TempOldContext := TCefRequestContextRef.Global()
|
||||||
CreateReqContextHandler;
|
|
||||||
|
|
||||||
if (FReqContextHandler <> nil) then
|
|
||||||
begin
|
|
||||||
TempGlobalContext := TCefRequestContextRef.Global();
|
|
||||||
TempNewContext := TCefRequestContextRef.Shared(TempGlobalContext, FReqContextHandler);
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
TempNewContext := aContext;
|
TempOldContext := aContext;
|
||||||
|
|
||||||
|
TempNewContext := TCefRequestContextRef.Shared(TempOldContext, FReqContextHandler);
|
||||||
|
|
||||||
Result := aBrowserViewComp.CreateBrowserView(FHandler, aURL, FBrowserSettings, aExtraInfo, TempNewContext);
|
Result := aBrowserViewComp.CreateBrowserView(FHandler, aURL, FBrowserSettings, aExtraInfo, TempNewContext);
|
||||||
end;
|
end;
|
||||||
@ -1910,42 +1928,11 @@ begin
|
|||||||
if CustomExceptionHandler('TChromiumCore.CreateBrowser', e) then raise;
|
if CustomExceptionHandler('TChromiumCore.CreateBrowser', e) then raise;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
TempGlobalContext := nil;
|
TempOldContext := nil;
|
||||||
TempNewContext := nil;
|
TempNewContext := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.CreateBrowser(const aWindowName : ustring);
|
|
||||||
var
|
|
||||||
TempHandle : TCefWindowHandle;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
|
|
||||||
// even if you use a custom request context.
|
|
||||||
// If you create a browser in the initialization of your app, make sure you call this
|
|
||||||
// function when GlobalCEFApp.GlobalContextInitialized is TRUE.
|
|
||||||
// Use the GlobalCEFApp.OnContextInitialized event to know when
|
|
||||||
// GlobalCEFApp.GlobalContextInitialized is set to TRUE.
|
|
||||||
if (BrowserId = 0) and
|
|
||||||
(GlobalCEFApp <> nil) and
|
|
||||||
GlobalCEFApp.GlobalContextInitialized and
|
|
||||||
CreateClientHandler(False) then
|
|
||||||
begin
|
|
||||||
GetSettings(FBrowserSettings);
|
|
||||||
InitializeWindowHandle(TempHandle);
|
|
||||||
WindowInfoAsPopUp(FWindowInfo, TempHandle, aWindowName);
|
|
||||||
CreateResourceRequestHandler;
|
|
||||||
CreateMediaObserver;
|
|
||||||
CreateDevToolsMsgObserver;
|
|
||||||
CreateExtensionHandler;
|
|
||||||
CreateBrowserHostSync(@FWindowInfo, FDefaultUrl, @FBrowserSettings, nil, nil);
|
|
||||||
end;
|
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TChromiumCore.CreateBrowser', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromiumCore.InitializeWindowInfo( aParentHandle : TCefWindowHandle;
|
procedure TChromiumCore.InitializeWindowInfo( aParentHandle : TCefWindowHandle;
|
||||||
aParentRect : TRect;
|
aParentRect : TRect;
|
||||||
const aWindowName : ustring);
|
const aWindowName : ustring);
|
||||||
@ -2330,7 +2317,6 @@ begin
|
|||||||
aSettings.plugins := FOptions.Plugins;
|
aSettings.plugins := FOptions.Plugins;
|
||||||
aSettings.universal_access_from_file_urls := FOptions.UniversalAccessFromFileUrls;
|
aSettings.universal_access_from_file_urls := FOptions.UniversalAccessFromFileUrls;
|
||||||
aSettings.file_access_from_file_urls := FOptions.FileAccessFromFileUrls;
|
aSettings.file_access_from_file_urls := FOptions.FileAccessFromFileUrls;
|
||||||
aSettings.web_security := FOptions.WebSecurity;
|
|
||||||
aSettings.image_loading := FOptions.ImageLoading;
|
aSettings.image_loading := FOptions.ImageLoading;
|
||||||
aSettings.image_shrink_standalone_to_fit := FOptions.ImageShrinkStandaloneToFit;
|
aSettings.image_shrink_standalone_to_fit := FOptions.ImageShrinkStandaloneToFit;
|
||||||
aSettings.text_area_resize := FOptions.TextAreaResize;
|
aSettings.text_area_resize := FOptions.TextAreaResize;
|
||||||
@ -2346,38 +2332,9 @@ end;
|
|||||||
|
|
||||||
procedure TChromiumCore.InitializeSettings(var aSettings : TCefBrowserSettings);
|
procedure TChromiumCore.InitializeSettings(var aSettings : TCefBrowserSettings);
|
||||||
begin
|
begin
|
||||||
|
FillChar(aSettings, SizeOf(TCefBrowserSettings), 0);
|
||||||
aSettings.size := SizeOf(TCefBrowserSettings);
|
aSettings.size := SizeOf(TCefBrowserSettings);
|
||||||
aSettings.windowless_frame_rate := 30;
|
aSettings.windowless_frame_rate := CEF_OSR_FRAMERATE_DEFAULT; // Use CEF_OSR_SHARED_TEXTURES_FRAMERATE_DEFAULT if the shared textures are enabled.
|
||||||
aSettings.standard_font_family := CefString('');
|
|
||||||
aSettings.fixed_font_family := CefString('');
|
|
||||||
aSettings.serif_font_family := CefString('');
|
|
||||||
aSettings.sans_serif_font_family := CefString('');
|
|
||||||
aSettings.cursive_font_family := CefString('');
|
|
||||||
aSettings.fantasy_font_family := CefString('');
|
|
||||||
aSettings.default_font_size := 0;
|
|
||||||
aSettings.default_fixed_font_size := 0;
|
|
||||||
aSettings.minimum_font_size := 0;
|
|
||||||
aSettings.minimum_logical_font_size := 0;
|
|
||||||
aSettings.remote_fonts := STATE_DEFAULT;
|
|
||||||
aSettings.default_encoding := CefString('');
|
|
||||||
aSettings.javascript := STATE_DEFAULT;
|
|
||||||
aSettings.javascript_close_windows := STATE_DEFAULT;
|
|
||||||
aSettings.javascript_access_clipboard := STATE_DEFAULT;
|
|
||||||
aSettings.javascript_dom_paste := STATE_DEFAULT;
|
|
||||||
aSettings.plugins := STATE_DEFAULT;
|
|
||||||
aSettings.universal_access_from_file_urls := STATE_DEFAULT;
|
|
||||||
aSettings.file_access_from_file_urls := STATE_DEFAULT;
|
|
||||||
aSettings.web_security := STATE_DEFAULT;
|
|
||||||
aSettings.image_loading := STATE_DEFAULT;
|
|
||||||
aSettings.image_shrink_standalone_to_fit := STATE_DEFAULT;
|
|
||||||
aSettings.text_area_resize := STATE_DEFAULT;
|
|
||||||
aSettings.tab_to_links := STATE_DEFAULT;
|
|
||||||
aSettings.local_storage := STATE_DEFAULT;
|
|
||||||
aSettings.databases := STATE_DEFAULT;
|
|
||||||
aSettings.application_cache := STATE_DEFAULT;
|
|
||||||
aSettings.webgl := STATE_DEFAULT;
|
|
||||||
aSettings.background_color := 0;
|
|
||||||
aSettings.accept_language_list := CefString('');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Leave aFrameName empty to load the URL in the main frame
|
// Leave aFrameName empty to load the URL in the main frame
|
||||||
@ -3281,20 +3238,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.SetOnRequestContextInitialized(const aValue : TOnRequestContextInitialized);
|
|
||||||
begin
|
|
||||||
FOnRequestContextInitialized := aValue;
|
|
||||||
|
|
||||||
CreateReqContextHandler;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromiumCore.SetOnBeforePluginLoad(const aValue : TOnBeforePluginLoad);
|
|
||||||
begin
|
|
||||||
FOnBeforePluginLoad := aValue;
|
|
||||||
|
|
||||||
CreateReqContextHandler;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TChromiumCore.UpdateHostZoomLevel(const aValue : double);
|
procedure TChromiumCore.UpdateHostZoomLevel(const aValue : double);
|
||||||
begin
|
begin
|
||||||
if Initialized then
|
if Initialized then
|
||||||
@ -3611,29 +3554,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.UpdateSupportedSchemes(const aSchemes : TStrings; aIncludeDefaults : boolean);
|
|
||||||
var
|
|
||||||
TempManager : ICefCookieManager;
|
|
||||||
TempContext : ICefRequestContext;
|
|
||||||
begin
|
|
||||||
if Initialized then
|
|
||||||
begin
|
|
||||||
TempContext := Browser.Host.RequestContext;
|
|
||||||
|
|
||||||
if (TempContext <> nil) then
|
|
||||||
begin
|
|
||||||
TempManager := TempContext.GetCookieManager(nil);
|
|
||||||
|
|
||||||
if (TempManager <> nil) then
|
|
||||||
try
|
|
||||||
TempManager.SetSupportedSchemes(aSchemes, aIncludeDefaults, nil);
|
|
||||||
finally
|
|
||||||
TempManager := nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// If aClearImmediately is false then OnCertificateExceptionsCleared is triggered when the exceptions are cleared
|
// If aClearImmediately is false then OnCertificateExceptionsCleared is triggered when the exceptions are cleared
|
||||||
function TChromiumCore.ClearCertificateExceptions(aClearImmediately : boolean) : boolean;
|
function TChromiumCore.ClearCertificateExceptions(aClearImmediately : boolean) : boolean;
|
||||||
var
|
var
|
||||||
@ -3960,7 +3880,7 @@ begin
|
|||||||
TempRequestContext := RequestContext;
|
TempRequestContext := RequestContext;
|
||||||
|
|
||||||
if (TempRequestContext <> nil) then
|
if (TempRequestContext <> nil) then
|
||||||
Result := TempRequestContext.MediaRouter
|
Result := TempRequestContext.GetMediaRouter(nil)
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
@ -4784,14 +4704,6 @@ begin
|
|||||||
assigned(FOnCanSaveCookie);
|
assigned(FOnCanSaveCookie);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChromiumCore.MustCreateRequestContextHandler : boolean;
|
|
||||||
begin
|
|
||||||
Result := assigned(FOnRequestContextInitialized) or
|
|
||||||
assigned(FOnBeforePluginLoad) or
|
|
||||||
assigned(FOnGetResourceRequestHandler_ReqCtxHdlr) or
|
|
||||||
MustCreateResourceRequestHandler;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TChromiumCore.MustCreateMediaObserver : boolean;
|
function TChromiumCore.MustCreateMediaObserver : boolean;
|
||||||
begin
|
begin
|
||||||
Result := assigned(FOnSinks) or
|
Result := assigned(FOnSinks) or
|
||||||
@ -4833,6 +4745,16 @@ begin
|
|||||||
assigned(FOnExtensionGetExtensionResource);
|
assigned(FOnExtensionGetExtensionResource);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TChromiumCore.MustCreatePrintHandler : boolean;
|
||||||
|
begin
|
||||||
|
Result := assigned(FOnPrintStart) or
|
||||||
|
assigned(FOnPrintSettings) or
|
||||||
|
assigned(FOnPrintDialog) or
|
||||||
|
assigned(FOnPrintJob) or
|
||||||
|
assigned(FOnPrintReset) or
|
||||||
|
assigned(FOnGetPDFPaperSize);
|
||||||
|
end;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
procedure TChromiumCore.PrefsAvailableMsg(aResultOK : boolean);
|
procedure TChromiumCore.PrefsAvailableMsg(aResultOK : boolean);
|
||||||
begin
|
begin
|
||||||
@ -4929,13 +4851,14 @@ begin
|
|||||||
if Initialized then
|
if Initialized then
|
||||||
begin
|
begin
|
||||||
InitializeSettings(FDevBrowserSettings);
|
InitializeSettings(FDevBrowserSettings);
|
||||||
if aWindowInfo = nil then
|
|
||||||
|
if (aWindowInfo = nil) then
|
||||||
begin
|
begin
|
||||||
InitializeWindowHandle(TempHandle);
|
InitializeWindowHandle(TempHandle);
|
||||||
DefaultInitializeDevToolsWindowInfo(TempHandle, Rect(0, 0, 0, 0), '');
|
DefaultInitializeDevToolsWindowInfo(TempHandle, Rect(0, 0, 0, 0), '');
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if aWindowInfo <> @FDevWindowInfo then
|
if (aWindowInfo <> @FDevWindowInfo) then
|
||||||
FDevWindowInfo := aWindowInfo^;
|
FDevWindowInfo := aWindowInfo^;
|
||||||
|
|
||||||
TempClient := TCustomClientHandler.Create(Self, True);
|
TempClient := TCustomClientHandler.Create(Self, True);
|
||||||
@ -5734,6 +5657,53 @@ begin
|
|||||||
FOnExtensionGetExtensionResource(self, extension, browser, file_, callback, Result);
|
FOnExtensionGetExtensionResource(self, extension, browser, file_, callback, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.doOnPrintStart(const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
if assigned(FOnPrintStart) then
|
||||||
|
FOnPrintStart(self, browser);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.doOnPrintSettings(const browser : ICefBrowser;
|
||||||
|
const settings : ICefPrintSettings;
|
||||||
|
getDefaults : boolean);
|
||||||
|
begin
|
||||||
|
if assigned(FOnPrintSettings) then
|
||||||
|
FOnPrintSettings(self, browser, settings, getDefaults);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.doOnPrintDialog(const browser : ICefBrowser;
|
||||||
|
hasSelection : boolean;
|
||||||
|
const callback : ICefPrintDialogCallback;
|
||||||
|
var aResult : boolean);
|
||||||
|
begin
|
||||||
|
if assigned(FOnPrintDialog) then
|
||||||
|
FOnPrintDialog(self, browser, hasSelection, callback, aResult);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.doOnPrintJob(const browser : ICefBrowser;
|
||||||
|
const documentName : ustring;
|
||||||
|
const PDFFilePath : ustring;
|
||||||
|
const callback : ICefPrintJobCallback;
|
||||||
|
var aResult : boolean);
|
||||||
|
begin
|
||||||
|
if assigned(FOnPrintJob) then
|
||||||
|
FOnPrintJob(self, browser, documentName, PDFFilePath, callback, aResult);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.doOnPrintReset(const browser: ICefBrowser);
|
||||||
|
begin
|
||||||
|
if assigned(FOnPrintReset) then
|
||||||
|
FOnPrintReset(self, browser);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.doOnGetPDFPaperSize(const browser : ICefBrowser;
|
||||||
|
deviceUnitsPerInch : Integer;
|
||||||
|
var aResult : TCefSize);
|
||||||
|
begin
|
||||||
|
if assigned(FOnGetPDFPaperSize) then
|
||||||
|
FOnGetPDFPaperSize(self, browser, deviceUnitsPerInch, aResult);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.doOnFullScreenModeChange(const browser : ICefBrowser;
|
procedure TChromiumCore.doOnFullScreenModeChange(const browser : ICefBrowser;
|
||||||
fullscreen : Boolean);
|
fullscreen : Boolean);
|
||||||
begin
|
begin
|
||||||
|
@ -200,6 +200,14 @@ type
|
|||||||
TOnCanAccessBrowserEvent = procedure(Sender: TObject; const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser; var aResult : boolean) of object;
|
TOnCanAccessBrowserEvent = procedure(Sender: TObject; const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser; var aResult : boolean) of object;
|
||||||
TOnGetExtensionResourceEvent = procedure(Sender: TObject; const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback; var aResult : boolean) of object;
|
TOnGetExtensionResourceEvent = procedure(Sender: TObject; const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback; var aResult : boolean) of object;
|
||||||
|
|
||||||
|
// ICefPrintHandler
|
||||||
|
TOnPrintStartEvent = procedure(Sender: TObject; const browser: ICefBrowser) of object;
|
||||||
|
TOnPrintSettingsEvent = procedure(Sender: TObject; const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean) of object;
|
||||||
|
TOnPrintDialogEvent = procedure(Sender: TObject; const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean) of object;
|
||||||
|
TOnPrintJobEvent = procedure(Sender: TObject; const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean) of object;
|
||||||
|
TOnPrintResetEvent = procedure(Sender: TObject; const browser: ICefBrowser) of object;
|
||||||
|
TOnGetPDFPaperSizeEvent = procedure(Sender: TObject; const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult : TCefSize) of object;
|
||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
TOnTextResultAvailableEvent = procedure(Sender: TObject; const aText : ustring) of object;
|
TOnTextResultAvailableEvent = procedure(Sender: TObject; const aText : ustring) of object;
|
||||||
TOnPdfPrintFinishedEvent = procedure(Sender: TObject; aResultOK : boolean) of object;
|
TOnPdfPrintFinishedEvent = procedure(Sender: TObject; aResultOK : boolean) of object;
|
||||||
|
@ -54,7 +54,7 @@ uses
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
Classes,
|
Classes,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFTypes;
|
uCEFTypes, uCEFConstants;
|
||||||
|
|
||||||
type
|
type
|
||||||
TChromiumOptions = class(TPersistent)
|
TChromiumOptions = class(TPersistent)
|
||||||
@ -67,7 +67,6 @@ type
|
|||||||
FPlugins : TCefState;
|
FPlugins : TCefState;
|
||||||
FUniversalAccessFromFileUrls : TCefState;
|
FUniversalAccessFromFileUrls : TCefState;
|
||||||
FFileAccessFromFileUrls : TCefState;
|
FFileAccessFromFileUrls : TCefState;
|
||||||
FWebSecurity : TCefState;
|
|
||||||
FImageLoading : TCefState;
|
FImageLoading : TCefState;
|
||||||
FImageShrinkStandaloneToFit : TCefState;
|
FImageShrinkStandaloneToFit : TCefState;
|
||||||
FTextAreaResize : TCefState;
|
FTextAreaResize : TCefState;
|
||||||
@ -90,7 +89,6 @@ type
|
|||||||
property Plugins : TCefState read FPlugins write FPlugins default STATE_DEFAULT;
|
property Plugins : TCefState read FPlugins write FPlugins default STATE_DEFAULT;
|
||||||
property UniversalAccessFromFileUrls : TCefState read FUniversalAccessFromFileUrls write FUniversalAccessFromFileUrls default STATE_DEFAULT;
|
property UniversalAccessFromFileUrls : TCefState read FUniversalAccessFromFileUrls write FUniversalAccessFromFileUrls default STATE_DEFAULT;
|
||||||
property FileAccessFromFileUrls : TCefState read FFileAccessFromFileUrls write FFileAccessFromFileUrls default STATE_DEFAULT;
|
property FileAccessFromFileUrls : TCefState read FFileAccessFromFileUrls write FFileAccessFromFileUrls default STATE_DEFAULT;
|
||||||
property WebSecurity : TCefState read FWebSecurity write FWebSecurity default STATE_DEFAULT;
|
|
||||||
property ImageLoading : TCefState read FImageLoading write FImageLoading default STATE_DEFAULT;
|
property ImageLoading : TCefState read FImageLoading write FImageLoading default STATE_DEFAULT;
|
||||||
property ImageShrinkStandaloneToFit : TCefState read FImageShrinkStandaloneToFit write FImageShrinkStandaloneToFit default STATE_DEFAULT;
|
property ImageShrinkStandaloneToFit : TCefState read FImageShrinkStandaloneToFit write FImageShrinkStandaloneToFit default STATE_DEFAULT;
|
||||||
property TextAreaResize : TCefState read FTextAreaResize write FTextAreaResize default STATE_DEFAULT;
|
property TextAreaResize : TCefState read FTextAreaResize write FTextAreaResize default STATE_DEFAULT;
|
||||||
@ -101,14 +99,15 @@ type
|
|||||||
property Webgl : TCefState read FWebgl write FWebgl default STATE_DEFAULT;
|
property Webgl : TCefState read FWebgl write FWebgl default STATE_DEFAULT;
|
||||||
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor default 0;
|
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor default 0;
|
||||||
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
|
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
|
||||||
property WindowlessFrameRate : Integer read FWindowlessFrameRate write FWindowlessFrameRate default 30;
|
property WindowlessFrameRate : Integer read FWindowlessFrameRate write FWindowlessFrameRate default CEF_OSR_FRAMERATE_DEFAULT;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
constructor TChromiumOptions.Create;
|
constructor TChromiumOptions.Create;
|
||||||
begin
|
begin
|
||||||
FWindowlessFrameRate := 30;
|
|
||||||
|
FWindowlessFrameRate := CEF_OSR_FRAMERATE_DEFAULT; // Use CEF_OSR_SHARED_TEXTURES_FRAMERATE_DEFAULT if the shared textures are enabled.
|
||||||
FJavascript := STATE_DEFAULT;
|
FJavascript := STATE_DEFAULT;
|
||||||
FJavascriptCloseWindows := STATE_DEFAULT;
|
FJavascriptCloseWindows := STATE_DEFAULT;
|
||||||
FJavascriptAccessClipboard := STATE_DEFAULT;
|
FJavascriptAccessClipboard := STATE_DEFAULT;
|
||||||
@ -116,7 +115,6 @@ begin
|
|||||||
FPlugins := STATE_DEFAULT;
|
FPlugins := STATE_DEFAULT;
|
||||||
FUniversalAccessFromFileUrls := STATE_DEFAULT;
|
FUniversalAccessFromFileUrls := STATE_DEFAULT;
|
||||||
FFileAccessFromFileUrls := STATE_DEFAULT;
|
FFileAccessFromFileUrls := STATE_DEFAULT;
|
||||||
FWebSecurity := STATE_DEFAULT;
|
|
||||||
FImageLoading := STATE_DEFAULT;
|
FImageLoading := STATE_DEFAULT;
|
||||||
FImageShrinkStandaloneToFit := STATE_DEFAULT;
|
FImageShrinkStandaloneToFit := STATE_DEFAULT;
|
||||||
FTextAreaResize := STATE_DEFAULT;
|
FTextAreaResize := STATE_DEFAULT;
|
||||||
|
@ -66,6 +66,7 @@ type
|
|||||||
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler); virtual;
|
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler); virtual;
|
||||||
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler); virtual;
|
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler); virtual;
|
||||||
procedure GetLoadHandler(var aHandler : ICefLoadHandler); virtual;
|
procedure GetLoadHandler(var aHandler : ICefLoadHandler); virtual;
|
||||||
|
procedure GetPrintHandler(var aHandler : ICefPrintHandler); virtual;
|
||||||
procedure GetRenderHandler(var aHandler : ICefRenderHandler); virtual;
|
procedure GetRenderHandler(var aHandler : ICefRenderHandler); virtual;
|
||||||
procedure GetRequestHandler(var aHandler : ICefRequestHandler); virtual;
|
procedure GetRequestHandler(var aHandler : ICefRequestHandler); virtual;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean; virtual;
|
||||||
@ -90,6 +91,7 @@ type
|
|||||||
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler); virtual;
|
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler); virtual;
|
||||||
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler); virtual;
|
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler); virtual;
|
||||||
procedure GetLoadHandler(var aHandler : ICefLoadHandler); virtual;
|
procedure GetLoadHandler(var aHandler : ICefLoadHandler); virtual;
|
||||||
|
procedure GetPrintHandler(var aHandler : ICefPrintHandler); virtual;
|
||||||
procedure GetRenderHandler(var aHandler : ICefRenderHandler); virtual;
|
procedure GetRenderHandler(var aHandler : ICefRenderHandler); virtual;
|
||||||
procedure GetRequestHandler(var aHandler : ICefRequestHandler); virtual;
|
procedure GetRequestHandler(var aHandler : ICefRequestHandler); virtual;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean; virtual;
|
||||||
@ -117,6 +119,7 @@ type
|
|||||||
FRequestHandler : ICefRequestHandler;
|
FRequestHandler : ICefRequestHandler;
|
||||||
FDragHandler : ICefDragHandler;
|
FDragHandler : ICefDragHandler;
|
||||||
FFindHandler : ICefFindHandler;
|
FFindHandler : ICefFindHandler;
|
||||||
|
FPrintHandler : ICefPrintHandler;
|
||||||
|
|
||||||
procedure GetAudioHandler(var aHandler : ICefAudioHandler); override;
|
procedure GetAudioHandler(var aHandler : ICefAudioHandler); override;
|
||||||
procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); override;
|
procedure GetContextMenuHandler(var aHandler : ICefContextMenuHandler); override;
|
||||||
@ -130,6 +133,7 @@ type
|
|||||||
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler); override;
|
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler); override;
|
||||||
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler); override;
|
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler); override;
|
||||||
procedure GetLoadHandler(var aHandler : ICefLoadHandler); override;
|
procedure GetLoadHandler(var aHandler : ICefLoadHandler); override;
|
||||||
|
procedure GetPrintHandler(var aHandler : ICefPrintHandler); override;
|
||||||
procedure GetRenderHandler(var aHandler : ICefRenderHandler); override;
|
procedure GetRenderHandler(var aHandler : ICefRenderHandler); override;
|
||||||
procedure GetRequestHandler(var aHandler : ICefRequestHandler); override;
|
procedure GetRequestHandler(var aHandler : ICefRequestHandler); override;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean; override;
|
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean; override;
|
||||||
@ -154,7 +158,8 @@ uses
|
|||||||
uCEFFocusHandler, uCEFContextMenuHandler, uCEFDialogHandler, uCEFKeyboardHandler,
|
uCEFFocusHandler, uCEFContextMenuHandler, uCEFDialogHandler, uCEFKeyboardHandler,
|
||||||
uCEFDisplayHandler, uCEFDownloadHandler, uCEFJsDialogHandler,
|
uCEFDisplayHandler, uCEFDownloadHandler, uCEFJsDialogHandler,
|
||||||
uCEFLifeSpanHandler, uCEFRequestHandler, uCEFRenderHandler, uCEFDragHandler,
|
uCEFLifeSpanHandler, uCEFRequestHandler, uCEFRenderHandler, uCEFDragHandler,
|
||||||
uCEFFindHandler, uCEFConstants, uCEFApplicationCore, uCEFFrame, uCEFAudioHandler;
|
uCEFFindHandler, uCEFConstants, uCEFApplicationCore, uCEFFrame, uCEFAudioHandler,
|
||||||
|
uCEFPrintHandler;
|
||||||
|
|
||||||
|
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
@ -229,6 +234,11 @@ begin
|
|||||||
aHandler := nil;
|
aHandler := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefClientRef.GetPrintHandler(var aHandler : ICefPrintHandler);
|
||||||
|
begin
|
||||||
|
aHandler := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefClientRef.GetRenderHandler(var aHandler : ICefRenderHandler);
|
procedure TCefClientRef.GetRenderHandler(var aHandler : ICefRenderHandler);
|
||||||
begin
|
begin
|
||||||
aHandler := nil;
|
aHandler := nil;
|
||||||
@ -459,7 +469,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_client_own_get_get_render_handler(self: PCefClient): PCefRenderHandler; stdcall;
|
function cef_client_own_get_render_handler(self: PCefClient): PCefRenderHandler; stdcall;
|
||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
TempHandler : ICefRenderHandler;
|
TempHandler : ICefRenderHandler;
|
||||||
@ -493,6 +503,24 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function cef_client_own_get_print_handler(self: PCefClient): PCefPrintHandler; stdcall;
|
||||||
|
var
|
||||||
|
TempObject : TObject;
|
||||||
|
TempHandler : ICefPrintHandler;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
|
if (TempObject <> nil) and (TempObject is TCefClientOwn) then
|
||||||
|
try
|
||||||
|
TempHandler := nil;
|
||||||
|
TCefClientOwn(TempObject).GetPrintHandler(TempHandler);
|
||||||
|
if (TempHandler <> nil) then Result := TempHandler.Wrap;
|
||||||
|
finally
|
||||||
|
TempHandler := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function cef_client_own_on_process_message_received(self : PCefClient;
|
function cef_client_own_on_process_message_received(self : PCefClient;
|
||||||
browser : PCefBrowser;
|
browser : PCefBrowser;
|
||||||
frame : PCefFrame;
|
frame : PCefFrame;
|
||||||
@ -529,7 +557,8 @@ begin
|
|||||||
get_keyboard_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_keyboard_handler;
|
get_keyboard_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_keyboard_handler;
|
||||||
get_life_span_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_life_span_handler;
|
get_life_span_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_life_span_handler;
|
||||||
get_load_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_load_handler;
|
get_load_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_load_handler;
|
||||||
get_render_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_get_render_handler;
|
get_print_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_print_handler;
|
||||||
|
get_render_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_render_handler;
|
||||||
get_request_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_request_handler;
|
get_request_handler := {$IFDEF FPC}@{$ENDIF}cef_client_own_get_request_handler;
|
||||||
on_process_message_received := {$IFDEF FPC}@{$ENDIF}cef_client_own_on_process_message_received;
|
on_process_message_received := {$IFDEF FPC}@{$ENDIF}cef_client_own_on_process_message_received;
|
||||||
end;
|
end;
|
||||||
@ -595,6 +624,11 @@ begin
|
|||||||
aHandler := nil;
|
aHandler := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefClientOwn.GetPrintHandler(var aHandler : ICefPrintHandler);
|
||||||
|
begin
|
||||||
|
aHandler := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefClientOwn.GetRenderHandler(var aHandler : ICefRenderHandler);
|
procedure TCefClientOwn.GetRenderHandler(var aHandler : ICefRenderHandler);
|
||||||
begin
|
begin
|
||||||
aHandler := nil;
|
aHandler := nil;
|
||||||
@ -654,6 +688,7 @@ begin
|
|||||||
if events.MustCreateRequestHandler then FRequestHandler := TCustomRequestHandler.Create(events);
|
if events.MustCreateRequestHandler then FRequestHandler := TCustomRequestHandler.Create(events);
|
||||||
if events.MustCreateDragHandler then FDragHandler := TCustomDragHandler.Create(events);
|
if events.MustCreateDragHandler then FDragHandler := TCustomDragHandler.Create(events);
|
||||||
if events.MustCreateFindHandler then FFindHandler := TCustomFindHandler.Create(events);
|
if events.MustCreateFindHandler then FFindHandler := TCustomFindHandler.Create(events);
|
||||||
|
if events.MustCreatePrintHandler then FPrintHandler := TCustomPrintHandler.Create(events);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -683,6 +718,7 @@ begin
|
|||||||
if (FRenderHandler <> nil) then FRenderHandler.RemoveReferences;
|
if (FRenderHandler <> nil) then FRenderHandler.RemoveReferences;
|
||||||
if (FDragHandler <> nil) then FDragHandler.RemoveReferences;
|
if (FDragHandler <> nil) then FDragHandler.RemoveReferences;
|
||||||
if (FFindHandler <> nil) then FFindHandler.RemoveReferences;
|
if (FFindHandler <> nil) then FFindHandler.RemoveReferences;
|
||||||
|
if (FPrintHandler <> nil) then FPrintHandler.RemoveReferences;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomClientHandler.InitializeVars;
|
procedure TCustomClientHandler.InitializeVars;
|
||||||
@ -701,6 +737,7 @@ begin
|
|||||||
FRenderHandler := nil;
|
FRenderHandler := nil;
|
||||||
FDragHandler := nil;
|
FDragHandler := nil;
|
||||||
FFindHandler := nil;
|
FFindHandler := nil;
|
||||||
|
FPrintHandler := nil;
|
||||||
FEvents := nil;
|
FEvents := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -800,6 +837,14 @@ begin
|
|||||||
aHandler := nil;
|
aHandler := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomClientHandler.GetPrintHandler(var aHandler : ICefPrintHandler);
|
||||||
|
begin
|
||||||
|
if (FPrintHandler <> nil) then
|
||||||
|
aHandler := FPrintHandler
|
||||||
|
else
|
||||||
|
aHandler := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomClientHandler.GetRenderHandler(var aHandler : ICefRenderHandler);
|
procedure TCustomClientHandler.GetRenderHandler(var aHandler : ICefRenderHandler);
|
||||||
begin
|
begin
|
||||||
if (FRenderHandler <> nil) then
|
if (FRenderHandler <> nil) then
|
||||||
|
@ -552,6 +552,11 @@ const
|
|||||||
CEF_TFC_DELETE = 5;
|
CEF_TFC_DELETE = 5;
|
||||||
CEF_TFC_SELECT_ALL = 6;
|
CEF_TFC_SELECT_ALL = 6;
|
||||||
|
|
||||||
|
// /include/internal/cef_types.h (cef_chrome_toolbar_type_t)
|
||||||
|
CEF_CTT_NONE = 1;
|
||||||
|
CEF_CTT_NORMAL = 2;
|
||||||
|
CEF_CTT_LOCATION = 3;
|
||||||
|
|
||||||
// /include/cef_api_hash.h (used as "cef_api_hash" parameters)
|
// /include/cef_api_hash.h (used as "cef_api_hash" parameters)
|
||||||
CEF_API_HASH_PLATFORM = 0;
|
CEF_API_HASH_PLATFORM = 0;
|
||||||
CEF_API_HASH_UNIVERSAL = 1;
|
CEF_API_HASH_UNIVERSAL = 1;
|
||||||
@ -638,9 +643,14 @@ const
|
|||||||
WM_POINTERUP = $0247;
|
WM_POINTERUP = $0247;
|
||||||
{$IFEND}
|
{$IFEND}
|
||||||
|
|
||||||
|
// Default values for the Windowsless framerate setting in TChromiumOptions
|
||||||
|
// The values are frames per second.
|
||||||
|
CEF_OSR_FRAMERATE_DEFAULT = 30; // Used when the shared textures are disabled.
|
||||||
|
CEF_OSR_SHARED_TEXTURES_FRAMERATE_DEFAULT = 60; // Used when the shared textures are enabled.
|
||||||
|
|
||||||
CEF_TIMER_MINIMUM = $0000000A;
|
CEF_TIMER_MINIMUM = $0000000A;
|
||||||
CEF_TIMER_MAXIMUM = $7FFFFFFF;
|
CEF_TIMER_MAXIMUM = $7FFFFFFF;
|
||||||
CEF_TIMER_MAXDELAY = 1000 div 30; // 30fps
|
CEF_TIMER_MAXDELAY = 1000 div CEF_OSR_FRAMERATE_DEFAULT;
|
||||||
CEF_TIMER_DEPLETEWORK_CYCLES = 10;
|
CEF_TIMER_DEPLETEWORK_CYCLES = 10;
|
||||||
CEF_TIMER_DEPLETEWORK_DELAY = 50;
|
CEF_TIMER_DEPLETEWORK_DELAY = 50;
|
||||||
|
|
||||||
|
@ -79,7 +79,6 @@ type
|
|||||||
function IsSpellCheckEnabled: Boolean;
|
function IsSpellCheckEnabled: Boolean;
|
||||||
function GetEditStateFlags: TCefContextMenuEditStateFlags;
|
function GetEditStateFlags: TCefContextMenuEditStateFlags;
|
||||||
function IsCustomMenu: Boolean;
|
function IsCustomMenu: Boolean;
|
||||||
function IsPepperMenu: Boolean;
|
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefContextMenuParams;
|
class function UnWrap(data: Pointer): ICefContextMenuParams;
|
||||||
end;
|
end;
|
||||||
@ -193,11 +192,6 @@ begin
|
|||||||
Result := PCefContextMenuParams(FData)^.is_editable(PCefContextMenuParams(FData)) <> 0;
|
Result := PCefContextMenuParams(FData)^.is_editable(PCefContextMenuParams(FData)) <> 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefContextMenuParamsRef.IsPepperMenu: Boolean;
|
|
||||||
begin
|
|
||||||
Result := PCefContextMenuParams(FData)^.is_pepper_menu(PCefContextMenuParams(FData)) <> 0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCefContextMenuParamsRef.IsSpellCheckEnabled: Boolean;
|
function TCefContextMenuParamsRef.IsSpellCheckEnabled: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := PCefContextMenuParams(FData)^.is_spell_check_enabled(PCefContextMenuParams(FData)) <> 0;
|
Result := PCefContextMenuParams(FData)^.is_spell_check_enabled(PCefContextMenuParams(FData)) <> 0;
|
||||||
|
@ -59,8 +59,6 @@ uses
|
|||||||
type
|
type
|
||||||
TCefCookieManagerRef = class(TCefBaseRefCountedRef, ICefCookieManager)
|
TCefCookieManagerRef = class(TCefBaseRefCountedRef, ICefCookieManager)
|
||||||
protected
|
protected
|
||||||
procedure SetSupportedSchemes(const schemes: TStrings; include_defaults: boolean; const callback: ICefCompletionCallback);
|
|
||||||
procedure SetSupportedSchemesProc(const schemes: TStrings; include_defaults: boolean; const callback: TCefCompletionCallbackProc);
|
|
||||||
function VisitAllCookies(const visitor: ICefCookieVisitor): Boolean;
|
function VisitAllCookies(const visitor: ICefCookieVisitor): Boolean;
|
||||||
function VisitAllCookiesProc(const visitor: TCefCookieVisitorProc): Boolean;
|
function VisitAllCookiesProc(const visitor: TCefCookieVisitorProc): Boolean;
|
||||||
function VisitUrlCookies(const url: ustring; includeHttpOnly: Boolean; const visitor: ICefCookieVisitor): Boolean;
|
function VisitUrlCookies(const url: ustring; includeHttpOnly: Boolean; const visitor: ICefCookieVisitor): Boolean;
|
||||||
@ -173,39 +171,6 @@ begin
|
|||||||
TCefFastSetCookieCallback.Create(callback));
|
TCefFastSetCookieCallback.Create(callback));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCookieManagerRef.SetSupportedSchemes(const schemes : TStrings;
|
|
||||||
include_defaults : boolean;
|
|
||||||
const callback : ICefCompletionCallback);
|
|
||||||
var
|
|
||||||
TempSL : ICefStringList;
|
|
||||||
TempHandle : TCefStringList;
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
if (schemes <> nil) and (schemes.count > 0) then
|
|
||||||
begin
|
|
||||||
TempSL := TCefStringListOwn.Create;
|
|
||||||
TempSL.AddStrings(schemes);
|
|
||||||
TempHandle := TempSL.Handle;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
TempHandle := nil;
|
|
||||||
|
|
||||||
PCefCookieManager(FData)^.set_supported_schemes(PCefCookieManager(FData),
|
|
||||||
TempHandle,
|
|
||||||
ord(include_defaults),
|
|
||||||
CefGetData(callback));
|
|
||||||
finally
|
|
||||||
TempSL := nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCefCookieManagerRef.SetSupportedSchemesProc(const schemes : TStrings;
|
|
||||||
include_defaults : boolean;
|
|
||||||
const callback : TCefCompletionCallbackProc);
|
|
||||||
begin
|
|
||||||
SetSupportedSchemes(schemes, include_defaults, TCefFastCompletionCallback.Create(callback));
|
|
||||||
end;
|
|
||||||
|
|
||||||
class function TCefCookieManagerRef.UnWrap(data: Pointer): ICefCookieManager;
|
class function TCefCookieManagerRef.UnWrap(data: Pointer): ICefCookieManager;
|
||||||
begin
|
begin
|
||||||
if (data <> nil) then
|
if (data <> nil) then
|
||||||
|
@ -146,7 +146,8 @@ procedure TCustomFindHandler.OnFindResult(const browser : ICefBrowser
|
|||||||
activeMatchOrdinal : Integer;
|
activeMatchOrdinal : Integer;
|
||||||
finalUpdate : Boolean);
|
finalUpdate : Boolean);
|
||||||
begin
|
begin
|
||||||
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnFindResult(browser, identifier, count, selectionRect, activeMatchOrdinal, finalUpdate);
|
if (FEvents <> nil) then
|
||||||
|
IChromiumEvents(FEvents).doOnFindResult(browser, identifier, count, selectionRect, activeMatchOrdinal, finalUpdate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -220,12 +220,8 @@ type
|
|||||||
TOnRenderLoadEnd = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
TOnRenderLoadEnd = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
||||||
TOnRenderLoadError = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
TOnRenderLoadError = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
||||||
TOnRenderLoadingStateChange = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
TOnRenderLoadingStateChange = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
||||||
TOnPrintStartEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
|
||||||
TOnPrintSettingsEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
|
||||||
TOnPrintDialogEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
|
||||||
TOnPrintJobEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
|
||||||
TOnPrintResetEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser: ICefBrowser) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
|
||||||
TOnGetPDFPaperSizeEvent = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(deviceUnitsPerInch: Integer; var aResult : TCefSize) {$IFNDEF DELPHI12_UP}{$IFNDEF FPC}of object{$ENDIF}{$ENDIF};
|
|
||||||
|
|
||||||
// *******************************************
|
// *******************************************
|
||||||
// **** Callback procedures and functions ****
|
// **** Callback procedures and functions ****
|
||||||
@ -458,6 +454,14 @@ type
|
|||||||
function doOnExtensionCanAccessBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser): boolean;
|
function doOnExtensionCanAccessBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser): boolean;
|
||||||
function doOnExtensionGetExtensionResource(const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback): boolean;
|
function doOnExtensionGetExtensionResource(const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback): boolean;
|
||||||
|
|
||||||
|
// ICefPrintHandler
|
||||||
|
procedure doOnPrintStart(const browser: ICefBrowser);
|
||||||
|
procedure doOnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean);
|
||||||
|
procedure doOnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult : boolean);
|
||||||
|
procedure doOnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean);
|
||||||
|
procedure doOnPrintReset(const browser: ICefBrowser);
|
||||||
|
procedure doOnGetPDFPaperSize(const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult : TCefSize);
|
||||||
|
|
||||||
// Custom
|
// Custom
|
||||||
procedure doCookiesDeleted(numDeleted : integer);
|
procedure doCookiesDeleted(numDeleted : integer);
|
||||||
procedure doPdfPrintFinished(aResultOK : boolean);
|
procedure doPdfPrintFinished(aResultOK : boolean);
|
||||||
@ -501,8 +505,8 @@ type
|
|||||||
function MustCreateFindHandler : boolean;
|
function MustCreateFindHandler : boolean;
|
||||||
function MustCreateResourceRequestHandler : boolean;
|
function MustCreateResourceRequestHandler : boolean;
|
||||||
function MustCreateCookieAccessFilter : boolean;
|
function MustCreateCookieAccessFilter : boolean;
|
||||||
function MustCreateRequestContextHandler : boolean;
|
|
||||||
function MustCreateMediaObserver : boolean;
|
function MustCreateMediaObserver : boolean;
|
||||||
|
function MustCreatePrintHandler : boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
IServerEvents = interface
|
IServerEvents = interface
|
||||||
@ -1438,10 +1442,8 @@ type
|
|||||||
// /include/capi/cef_browser_process_handler_capi.h (cef_browser_process_handler_t)
|
// /include/capi/cef_browser_process_handler_capi.h (cef_browser_process_handler_t)
|
||||||
ICefBrowserProcessHandler = interface(ICefBaseRefCounted)
|
ICefBrowserProcessHandler = interface(ICefBaseRefCounted)
|
||||||
['{27291B7A-C0AE-4EE0-9115-15C810E22F6C}']
|
['{27291B7A-C0AE-4EE0-9115-15C810E22F6C}']
|
||||||
procedure GetCookieableSchemes(var schemes: TStringList; var include_defaults : boolean);
|
|
||||||
procedure OnContextInitialized;
|
procedure OnContextInitialized;
|
||||||
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine);
|
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine);
|
||||||
procedure GetPrintHandler(var aHandler : ICefPrintHandler);
|
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64);
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64);
|
||||||
procedure GetDefaultClient(var aClient : ICefClient);
|
procedure GetDefaultClient(var aClient : ICefClient);
|
||||||
|
|
||||||
@ -1503,8 +1505,6 @@ type
|
|||||||
// /include/capi/cef_cookie_capi.h (cef_cookie_manager_t)
|
// /include/capi/cef_cookie_capi.h (cef_cookie_manager_t)
|
||||||
ICefCookieManager = Interface(ICefBaseRefCounted)
|
ICefCookieManager = Interface(ICefBaseRefCounted)
|
||||||
['{CC1749E6-9AD3-4283-8430-AF6CBF3E8785}']
|
['{CC1749E6-9AD3-4283-8430-AF6CBF3E8785}']
|
||||||
procedure SetSupportedSchemes(const schemes: TStrings; include_defaults: boolean; const callback: ICefCompletionCallback);
|
|
||||||
procedure SetSupportedSchemesProc(const schemes: TStrings; include_defaults: boolean; const callback: TCefCompletionCallbackProc);
|
|
||||||
function VisitAllCookies(const visitor: ICefCookieVisitor): Boolean;
|
function VisitAllCookies(const visitor: ICefCookieVisitor): Boolean;
|
||||||
function VisitAllCookiesProc(const visitor: TCefCookieVisitorProc): Boolean;
|
function VisitAllCookiesProc(const visitor: TCefCookieVisitorProc): Boolean;
|
||||||
function VisitUrlCookies(const url: ustring; includeHttpOnly: Boolean; const visitor: ICefCookieVisitor): Boolean;
|
function VisitUrlCookies(const url: ustring; includeHttpOnly: Boolean; const visitor: ICefCookieVisitor): Boolean;
|
||||||
@ -1613,7 +1613,6 @@ type
|
|||||||
function IsSpellCheckEnabled: Boolean;
|
function IsSpellCheckEnabled: Boolean;
|
||||||
function GetEditStateFlags: TCefContextMenuEditStateFlags;
|
function GetEditStateFlags: TCefContextMenuEditStateFlags;
|
||||||
function IsCustomMenu: Boolean;
|
function IsCustomMenu: Boolean;
|
||||||
function IsPepperMenu: Boolean;
|
|
||||||
|
|
||||||
property XCoord : Integer read GetXCoord;
|
property XCoord : Integer read GetXCoord;
|
||||||
property YCoord : Integer read GetYCoord;
|
property YCoord : Integer read GetYCoord;
|
||||||
@ -2091,6 +2090,7 @@ type
|
|||||||
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler);
|
procedure GetKeyboardHandler(var aHandler : ICefKeyboardHandler);
|
||||||
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler);
|
procedure GetLifeSpanHandler(var aHandler : ICefLifeSpanHandler);
|
||||||
procedure GetLoadHandler(var aHandler : ICefLoadHandler);
|
procedure GetLoadHandler(var aHandler : ICefLoadHandler);
|
||||||
|
procedure GetPrintHandler(var aHandler : ICefPrintHandler);
|
||||||
procedure GetRenderHandler(var aHandler : ICefRenderHandler);
|
procedure GetRenderHandler(var aHandler : ICefRenderHandler);
|
||||||
procedure GetRequestHandler(var aHandler : ICefRequestHandler);
|
procedure GetRequestHandler(var aHandler : ICefRequestHandler);
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean;
|
function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage): Boolean;
|
||||||
@ -2261,11 +2261,10 @@ type
|
|||||||
function HasExtension(const extension_id: ustring): boolean;
|
function HasExtension(const extension_id: ustring): boolean;
|
||||||
function GetExtensions(const extension_ids: TStringList): boolean;
|
function GetExtensions(const extension_ids: TStringList): boolean;
|
||||||
function GetExtension(const extension_id: ustring): ICefExtension;
|
function GetExtension(const extension_id: ustring): ICefExtension;
|
||||||
function GetMediaRouter: ICefMediaRouter;
|
function GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter;
|
||||||
|
|
||||||
property CachePath : ustring read GetCachePath;
|
property CachePath : ustring read GetCachePath;
|
||||||
property IsGlobalContext : boolean read IsGlobal;
|
property IsGlobalContext : boolean read IsGlobal;
|
||||||
property MediaRouter : ICefMediaRouter read GetMediaRouter;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefPrintSettings
|
// TCefPrintSettings
|
||||||
@ -2329,7 +2328,7 @@ type
|
|||||||
procedure OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean);
|
procedure OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean);
|
||||||
procedure OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean);
|
procedure OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean);
|
||||||
procedure OnPrintReset(const browser: ICefBrowser);
|
procedure OnPrintReset(const browser: ICefBrowser);
|
||||||
procedure GetPDFPaperSize(deviceUnitsPerInch: integer; var aResult: TCefSize);
|
procedure GetPDFPaperSize(const browser: ICefBrowser; deviceUnitsPerInch: integer; var aResult: TCefSize);
|
||||||
|
|
||||||
procedure RemoveReferences; // custom procedure to clear all references
|
procedure RemoveReferences; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
@ -2631,6 +2630,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer);
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer);
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
procedure OnFocus(const view: ICefView);
|
procedure OnFocus(const view: ICefView);
|
||||||
procedure OnBlur(const view: ICefView);
|
procedure OnBlur(const view: ICefView);
|
||||||
end;
|
end;
|
||||||
@ -2644,6 +2644,7 @@ type
|
|||||||
procedure doOnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer);
|
procedure doOnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer);
|
||||||
procedure doOnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
|
procedure doOnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
|
||||||
procedure doOnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
|
procedure doOnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
|
||||||
|
procedure doOnWindowChanged(const view: ICefView; added: boolean);
|
||||||
procedure doOnFocus(const view: ICefView);
|
procedure doOnFocus(const view: ICefView);
|
||||||
procedure doOnBlur(const view: ICefView);
|
procedure doOnBlur(const view: ICefView);
|
||||||
|
|
||||||
@ -2764,6 +2765,7 @@ type
|
|||||||
ICefBrowserView = interface(ICefView)
|
ICefBrowserView = interface(ICefView)
|
||||||
['{A617EE5D-B933-4E14-9FC0-7E88E9B6C051}']
|
['{A617EE5D-B933-4E14-9FC0-7E88E9B6C051}']
|
||||||
function GetBrowser : ICefBrowser;
|
function GetBrowser : ICefBrowser;
|
||||||
|
function GetChromeToolbar : ICefView;
|
||||||
procedure SetPreferAccelerators(prefer_accelerators: boolean);
|
procedure SetPreferAccelerators(prefer_accelerators: boolean);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2775,6 +2777,9 @@ type
|
|||||||
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
procedure OnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
||||||
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
||||||
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
||||||
|
function GetChromeToolbarType: TCefChromeToolbarType;
|
||||||
|
|
||||||
|
property ChromeToolbarType: TCefChromeToolbarType read GetChromeToolbarType;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefBrowserViewDelegateEvents = interface(ICefViewDelegateEvents)
|
ICefBrowserViewDelegateEvents = interface(ICefViewDelegateEvents)
|
||||||
@ -2783,6 +2788,7 @@ type
|
|||||||
procedure doOnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
procedure doOnBrowserDestroyed(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
||||||
procedure doOnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
procedure doOnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
|
||||||
procedure doOnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
procedure doOnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
|
||||||
|
procedure doOnGetChromeToolbarType(var aChromeToolbarType: TCefChromeToolbarType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefButton
|
// TCefButton
|
||||||
|
@ -115,7 +115,7 @@ var
|
|||||||
cef_image_create : function : PCefImage; cdecl;
|
cef_image_create : function : PCefImage; cdecl;
|
||||||
|
|
||||||
// /include/capi/cef_media_router_capi.h
|
// /include/capi/cef_media_router_capi.h
|
||||||
cef_media_router_get_global : function : PCefMediaRouter; cdecl;
|
cef_media_router_get_global : function(callback: PCefCompletionCallback) : PCefMediaRouter; cdecl;
|
||||||
|
|
||||||
// /include/capi/cef_menu_model_capi.h
|
// /include/capi/cef_menu_model_capi.h
|
||||||
cef_menu_model_create : function(delegate: PCefMenuModelDelegate): PCefMenuModel; cdecl;
|
cef_menu_model_create : function(delegate: PCefMenuModelDelegate): PCefMenuModel; cdecl;
|
||||||
|
@ -115,7 +115,7 @@ end;
|
|||||||
|
|
||||||
class function TCefMediaRouterRef.Global: ICefMediaRouter;
|
class function TCefMediaRouterRef.Global: ICefMediaRouter;
|
||||||
begin
|
begin
|
||||||
Result := UnWrap(cef_media_router_get_global());
|
Result := UnWrap(cef_media_router_get_global(nil));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -85,6 +85,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -247,6 +248,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomMenuButtonDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefMenuButtonDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomMenuButtonDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomMenuButtonDelegate.OnFocus(const view: ICefView);
|
procedure TCustomMenuButtonDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -212,7 +212,7 @@ function SplitLongString(aSrcString : string) : string;
|
|||||||
function GetAbsoluteDirPath(const aSrcPath : string; var aRsltPath : string) : boolean;
|
function GetAbsoluteDirPath(const aSrcPath : string; var aRsltPath : string) : boolean;
|
||||||
function CheckSubprocessPath(const aSubprocessPath : string; var aMissingFiles : string) : boolean;
|
function CheckSubprocessPath(const aSubprocessPath : string; var aMissingFiles : string) : boolean;
|
||||||
function CheckLocales(const aLocalesDirPath : string; var aMissingFiles : string; const aLocalesRequired : string = '') : boolean;
|
function CheckLocales(const aLocalesDirPath : string; var aMissingFiles : string; const aLocalesRequired : string = '') : boolean;
|
||||||
function CheckResources(const aResourcesDirPath : string; var aMissingFiles : string; aCheckDevResources: boolean = True; aCheckExtensions: boolean = True) : boolean;
|
function CheckResources(const aResourcesDirPath : string; var aMissingFiles : string) : boolean;
|
||||||
function CheckDLLs(const aFrameworkDirPath : string; var aMissingFiles : string) : boolean;
|
function CheckDLLs(const aFrameworkDirPath : string; var aMissingFiles : string) : boolean;
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
function CheckDLLVersion(const aDLLFile : ustring; aMajor, aMinor, aRelease, aBuild : uint16) : boolean;
|
function CheckDLLVersion(const aDLLFile : ustring; aMajor, aMinor, aRelease, aBuild : uint16) : boolean;
|
||||||
@ -1141,7 +1141,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CheckResources(const aResourcesDirPath : string; var aMissingFiles : string; aCheckDevResources, aCheckExtensions: boolean) : boolean;
|
function CheckResources(const aResourcesDirPath : string; var aMissingFiles : string) : boolean;
|
||||||
var
|
var
|
||||||
TempDir : string;
|
TempDir : string;
|
||||||
TempList : TStringList;
|
TempList : TStringList;
|
||||||
@ -1156,12 +1156,9 @@ begin
|
|||||||
TempList := TStringList.Create;
|
TempList := TStringList.Create;
|
||||||
TempList.Add(TempDir + 'snapshot_blob.bin');
|
TempList.Add(TempDir + 'snapshot_blob.bin');
|
||||||
TempList.Add(TempDir + 'v8_context_snapshot.bin');
|
TempList.Add(TempDir + 'v8_context_snapshot.bin');
|
||||||
TempList.Add(TempDir + 'cef.pak');
|
TempList.Add(TempDir + 'resources.pak');
|
||||||
TempList.Add(TempDir + 'cef_100_percent.pak');
|
TempList.Add(TempDir + 'chrome_100_percent.pak');
|
||||||
TempList.Add(TempDir + 'cef_200_percent.pak');
|
TempList.Add(TempDir + 'chrome_200_percent.pak');
|
||||||
|
|
||||||
if aCheckExtensions then TempList.Add(TempDir + 'cef_extensions.pak');
|
|
||||||
if aCheckDevResources then TempList.Add(TempDir + 'devtools_resources.pak');
|
|
||||||
|
|
||||||
if TempExists then
|
if TempExists then
|
||||||
Result := CheckFilesExist(TempList, aMissingFiles)
|
Result := CheckFilesExist(TempList, aMissingFiles)
|
||||||
|
@ -78,6 +78,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -190,6 +191,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomPanelDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefPanelDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomPanelDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomPanelDelegate.OnFocus(const view: ICefView);
|
procedure TCustomPanelDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -59,7 +59,7 @@ type
|
|||||||
procedure OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean); virtual;
|
procedure OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean); virtual;
|
||||||
procedure OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean); virtual;
|
procedure OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean); virtual;
|
||||||
procedure OnPrintReset(const browser: ICefBrowser); virtual; abstract;
|
procedure OnPrintReset(const browser: ICefBrowser); virtual; abstract;
|
||||||
procedure GetPDFPaperSize(deviceUnitsPerInch: Integer; var aResult: TCefSize); virtual;
|
procedure GetPDFPaperSize(const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult: TCefSize); virtual;
|
||||||
|
|
||||||
procedure RemoveReferences; virtual; abstract;
|
procedure RemoveReferences; virtual; abstract;
|
||||||
|
|
||||||
@ -69,19 +69,19 @@ type
|
|||||||
|
|
||||||
TCustomPrintHandler = class(TCefPrintHandlerOwn)
|
TCustomPrintHandler = class(TCefPrintHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FCefApp : TCefApplicationCore;
|
FEvents : Pointer;
|
||||||
|
|
||||||
procedure OnPrintStart(const browser: ICefBrowser); override;
|
procedure OnPrintStart(const browser: ICefBrowser); override;
|
||||||
procedure OnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean); override;
|
procedure OnPrintSettings(const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean); override;
|
||||||
procedure OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean); override;
|
procedure OnPrintDialog(const browser: ICefBrowser; hasSelection: boolean; const callback: ICefPrintDialogCallback; var aResult: boolean); override;
|
||||||
procedure OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean); override;
|
procedure OnPrintJob(const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean); override;
|
||||||
procedure OnPrintReset(const browser: ICefBrowser); override;
|
procedure OnPrintReset(const browser: ICefBrowser); override;
|
||||||
procedure GetPDFPaperSize(deviceUnitsPerInch: Integer; var aResult: TCefSize); override;
|
procedure GetPDFPaperSize(const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult: TCefSize); override;
|
||||||
|
|
||||||
procedure RemoveReferences; override;
|
procedure RemoveReferences; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplicationCore); reintroduce; virtual;
|
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -178,6 +178,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_print_handler_get_pdf_paper_size(self : PCefPrintHandler;
|
function cef_print_handler_get_pdf_paper_size(self : PCefPrintHandler;
|
||||||
|
browser : PCefBrowser;
|
||||||
device_units_per_inch : Integer): TCefSize; stdcall;
|
device_units_per_inch : Integer): TCefSize; stdcall;
|
||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
@ -188,7 +189,9 @@ begin
|
|||||||
TempSize.Height := 0;
|
TempSize.Height := 0;
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefPrintHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefPrintHandlerOwn) then
|
||||||
TCefPrintHandlerOwn(TempObject).GetPDFPaperSize(device_units_per_inch, TempSize);
|
TCefPrintHandlerOwn(TempObject).GetPDFPaperSize(TCefBrowserRef.UnWrap(browser),
|
||||||
|
device_units_per_inch,
|
||||||
|
TempSize);
|
||||||
|
|
||||||
Result := TempSize;
|
Result := TempSize;
|
||||||
end;
|
end;
|
||||||
@ -218,7 +221,7 @@ begin
|
|||||||
aResult := False;
|
aResult := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefPrintHandlerOwn.GetPDFPaperSize(deviceUnitsPerInch: Integer; var aResult: TCefSize);
|
procedure TCefPrintHandlerOwn.GetPDFPaperSize(const browser: ICefBrowser; deviceUnitsPerInch: Integer; var aResult: TCefSize);
|
||||||
begin
|
begin
|
||||||
aResult.Width := 0;
|
aResult.Width := 0;
|
||||||
aResult.Height := 0;
|
aResult.Height := 0;
|
||||||
@ -227,11 +230,11 @@ end;
|
|||||||
|
|
||||||
// TCustomPrintHandler
|
// TCustomPrintHandler
|
||||||
|
|
||||||
constructor TCustomPrintHandler.Create(const aCefApp : TCefApplicationCore);
|
constructor TCustomPrintHandler.Create(const events : IChromiumEvents);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FCefApp := aCefApp;
|
FEvents := Pointer(events);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomPrintHandler.Destroy;
|
destructor TCustomPrintHandler.Destroy;
|
||||||
@ -243,29 +246,21 @@ end;
|
|||||||
|
|
||||||
procedure TCustomPrintHandler.RemoveReferences;
|
procedure TCustomPrintHandler.RemoveReferences;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
FEvents := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPrintHandler.OnPrintStart(const browser : ICefBrowser);
|
procedure TCustomPrintHandler.OnPrintStart(const browser : ICefBrowser);
|
||||||
begin
|
begin
|
||||||
try
|
if (FEvents <> nil) then
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnPrintStart(browser);
|
IChromiumEvents(FEvents).doOnPrintStart(browser);
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCustomPrintHandler.OnPrintStart', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPrintHandler.OnPrintSettings(const browser : ICefBrowser;
|
procedure TCustomPrintHandler.OnPrintSettings(const browser : ICefBrowser;
|
||||||
const settings : ICefPrintSettings;
|
const settings : ICefPrintSettings;
|
||||||
getDefaults : boolean);
|
getDefaults : boolean);
|
||||||
begin
|
begin
|
||||||
try
|
if (FEvents <> nil) then
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnPrintSettings(browser, settings, getDefaults);
|
IChromiumEvents(FEvents).doOnPrintSettings(browser, settings, getDefaults);
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCustomPrintHandler.OnPrintSettings', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPrintHandler.OnPrintDialog(const browser : ICefBrowser;
|
procedure TCustomPrintHandler.OnPrintDialog(const browser : ICefBrowser;
|
||||||
@ -273,12 +268,8 @@ procedure TCustomPrintHandler.OnPrintDialog(const browser : ICefBrowser;
|
|||||||
const callback : ICefPrintDialogCallback;
|
const callback : ICefPrintDialogCallback;
|
||||||
var aResult : boolean);
|
var aResult : boolean);
|
||||||
begin
|
begin
|
||||||
try
|
if (FEvents <> nil) then
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnPrintDialog(browser, hasSelection, callback, aResult);
|
IChromiumEvents(FEvents).doOnPrintDialog(browser, hasSelection, callback, aResult);
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCustomPrintHandler.OnPrintDialog', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPrintHandler.OnPrintJob(const browser : ICefBrowser;
|
procedure TCustomPrintHandler.OnPrintJob(const browser : ICefBrowser;
|
||||||
@ -287,33 +278,22 @@ procedure TCustomPrintHandler.OnPrintJob(const browser : ICefBrowser;
|
|||||||
const callback : ICefPrintJobCallback;
|
const callback : ICefPrintJobCallback;
|
||||||
var aResult : boolean);
|
var aResult : boolean);
|
||||||
begin
|
begin
|
||||||
try
|
if (FEvents <> nil) then
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnPrintJob(browser, documentName, PDFFilePath, callback, aResult);
|
IChromiumEvents(FEvents).doOnPrintJob(browser, documentName, PDFFilePath, callback, aResult);
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCustomPrintHandler.OnPrintJob', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPrintHandler.OnPrintReset(const browser : ICefBrowser);
|
procedure TCustomPrintHandler.OnPrintReset(const browser : ICefBrowser);
|
||||||
begin
|
begin
|
||||||
try
|
if (FEvents <> nil) then
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnPrintReset(browser);
|
IChromiumEvents(FEvents).doOnPrintReset(browser);
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCustomPrintHandler.OnPrintReset', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomPrintHandler.GetPDFPaperSize( deviceUnitsPerInch : Integer;
|
procedure TCustomPrintHandler.GetPDFPaperSize(const browser : ICefBrowser;
|
||||||
|
deviceUnitsPerInch : Integer;
|
||||||
var aResult : TCefSize);
|
var aResult : TCefSize);
|
||||||
begin
|
begin
|
||||||
try
|
if (FEvents <> nil) then
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnGetPDFPaperSize(deviceUnitsPerInch, aResult);
|
IChromiumEvents(FEvents).doOnGetPDFPaperSize(browser, deviceUnitsPerInch, aResult);
|
||||||
except
|
|
||||||
on e : exception do
|
|
||||||
if CustomExceptionHandler('TCustomPrintHandler.GetPDFPaperSize', e) then raise;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -83,13 +83,13 @@ type
|
|||||||
function HasExtension(const extension_id: ustring): boolean;
|
function HasExtension(const extension_id: ustring): boolean;
|
||||||
function GetExtensions(const extension_ids: TStringList): boolean;
|
function GetExtensions(const extension_ids: TStringList): boolean;
|
||||||
function GetExtension(const extension_id: ustring): ICefExtension;
|
function GetExtension(const extension_id: ustring): ICefExtension;
|
||||||
function GetMediaRouter: ICefMediaRouter;
|
function GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter;
|
||||||
|
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefRequestContext;
|
class function UnWrap(data: Pointer): ICefRequestContext;
|
||||||
class function Global: ICefRequestContext;
|
class function Global: ICefRequestContext;
|
||||||
class function New(const settings: PCefRequestContextSettings; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload;
|
class function New(const settings: PCefRequestContextSettings; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload;
|
||||||
class function New(const aCache, aAcceptLanguageList : ustring; aPersistSessionCookies, aPersistUserPreferences, aIgnoreCertificateErrors : boolean; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload;
|
class function New(const aCache, aAcceptLanguageList, aCookieableSchemesList : ustring; aCookieableSchemesExcludeDefaults, aPersistSessionCookies, aPersistUserPreferences, aIgnoreCertificateErrors : boolean; const handler: ICefRequestContextHandler = nil): ICefRequestContext; overload;
|
||||||
class function Shared(const other: ICefRequestContext; const handler: ICefRequestContextHandler): ICefRequestContext;
|
class function Shared(const other: ICefRequestContext; const handler: ICefRequestContextHandler): ICefRequestContext;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -175,6 +175,8 @@ end;
|
|||||||
|
|
||||||
class function TCefRequestContextRef.New(const aCache : ustring;
|
class function TCefRequestContextRef.New(const aCache : ustring;
|
||||||
const aAcceptLanguageList : ustring;
|
const aAcceptLanguageList : ustring;
|
||||||
|
const aCookieableSchemesList : ustring;
|
||||||
|
aCookieableSchemesExcludeDefaults : boolean;
|
||||||
aPersistSessionCookies : boolean;
|
aPersistSessionCookies : boolean;
|
||||||
aPersistUserPreferences : boolean;
|
aPersistUserPreferences : boolean;
|
||||||
aIgnoreCertificateErrors : boolean;
|
aIgnoreCertificateErrors : boolean;
|
||||||
@ -188,6 +190,8 @@ begin
|
|||||||
TempSettings.persist_user_preferences := Ord(aPersistUserPreferences);
|
TempSettings.persist_user_preferences := Ord(aPersistUserPreferences);
|
||||||
TempSettings.ignore_certificate_errors := Ord(aIgnoreCertificateErrors);
|
TempSettings.ignore_certificate_errors := Ord(aIgnoreCertificateErrors);
|
||||||
TempSettings.accept_language_list := CefString(aAcceptLanguageList);
|
TempSettings.accept_language_list := CefString(aAcceptLanguageList);
|
||||||
|
TempSettings.cookieable_schemes_list := CefString(aCookieableSchemesList);
|
||||||
|
TempSettings.cookieable_schemes_exclude_defaults := Ord(aCookieableSchemesExcludeDefaults);
|
||||||
|
|
||||||
Result := UnWrap(cef_request_context_create_context(@TempSettings, CefGetData(handler)));
|
Result := UnWrap(cef_request_context_create_context(@TempSettings, CefGetData(handler)));
|
||||||
end;
|
end;
|
||||||
@ -309,9 +313,9 @@ begin
|
|||||||
Result := TCefExtensionRef.UnWrap(PCefRequestContext(FData)^.get_extension(PCefRequestContext(FData), @TempID));
|
Result := TCefExtensionRef.UnWrap(PCefRequestContext(FData)^.get_extension(PCefRequestContext(FData), @TempID));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefRequestContextRef.GetMediaRouter: ICefMediaRouter;
|
function TCefRequestContextRef.GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter;
|
||||||
begin
|
begin
|
||||||
Result := TCefMediaRouterRef.UnWrap(PCefRequestContext(FData)^.get_media_router(PCefRequestContext(FData)));
|
Result := TCefMediaRouterRef.UnWrap(PCefRequestContext(FData)^.get_media_router(PCefRequestContext(FData), CefGetData(callback)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefRequestContextRef.RegisterSchemeHandlerFactory(const schemeName : ustring;
|
function TCefRequestContextRef.RegisterSchemeHandlerFactory(const schemeName : ustring;
|
||||||
|
@ -88,6 +88,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -267,6 +268,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomTextfieldDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefTextfieldDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomTextfieldDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomTextfieldDelegate.OnFocus(const view: ICefView);
|
procedure TCustomTextfieldDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -322,6 +322,7 @@ type
|
|||||||
TCefMediaRouterCreateResult = Integer; // /include/internal/cef_types.h (cef_media_route_create_result_t)
|
TCefMediaRouterCreateResult = Integer; // /include/internal/cef_types.h (cef_media_route_create_result_t)
|
||||||
TCefCookiePriority = Integer; // /include/internal/cef_types.h (cef_cookie_priority_t)
|
TCefCookiePriority = Integer; // /include/internal/cef_types.h (cef_cookie_priority_t)
|
||||||
TCefTextFieldCommands = Integer; // /include/internal/cef_types.h (cef_text_field_commands_t)
|
TCefTextFieldCommands = Integer; // /include/internal/cef_types.h (cef_text_field_commands_t)
|
||||||
|
TCefChromeToolbarType = Integer; // /include/internal/cef_types.h (cef_chrome_toolbar_type_t)
|
||||||
|
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
@ -1235,6 +1236,8 @@ type
|
|||||||
ignore_certificate_errors : Integer;
|
ignore_certificate_errors : Integer;
|
||||||
background_color : TCefColor;
|
background_color : TCefColor;
|
||||||
accept_language_list : TCefString;
|
accept_language_list : TCefString;
|
||||||
|
cookieable_schemes_list : TCefString;
|
||||||
|
cookieable_schemes_exclude_defaults : integer;
|
||||||
application_client_id_for_file_scanning : TCefString;
|
application_client_id_for_file_scanning : TCefString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1341,7 +1344,6 @@ type
|
|||||||
plugins : TCefState;
|
plugins : TCefState;
|
||||||
universal_access_from_file_urls : TCefState;
|
universal_access_from_file_urls : TCefState;
|
||||||
file_access_from_file_urls : TCefState;
|
file_access_from_file_urls : TCefState;
|
||||||
web_security : TCefState;
|
|
||||||
image_loading : TCefState;
|
image_loading : TCefState;
|
||||||
image_shrink_standalone_to_fit : TCefState;
|
image_shrink_standalone_to_fit : TCefState;
|
||||||
text_area_resize : TCefState;
|
text_area_resize : TCefState;
|
||||||
@ -1372,6 +1374,8 @@ type
|
|||||||
persist_user_preferences : Integer;
|
persist_user_preferences : Integer;
|
||||||
ignore_certificate_errors : Integer;
|
ignore_certificate_errors : Integer;
|
||||||
accept_language_list : TCefString;
|
accept_language_list : TCefString;
|
||||||
|
cookieable_schemes_list : TCefString;
|
||||||
|
cookieable_schemes_exclude_defaults : integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/internal/cef_types.h (cef_cookie_t)
|
// /include/internal/cef_types.h (cef_cookie_t)
|
||||||
@ -2136,7 +2140,7 @@ type
|
|||||||
has_extension : function(self: PCefRequestContext; const extension_id: PCefString): Integer; stdcall;
|
has_extension : function(self: PCefRequestContext; const extension_id: PCefString): Integer; stdcall;
|
||||||
get_extensions : function(self: PCefRequestContext; extension_ids: TCefStringList): Integer; stdcall;
|
get_extensions : function(self: PCefRequestContext; extension_ids: TCefStringList): Integer; stdcall;
|
||||||
get_extension : function(self: PCefRequestContext; const extension_id: PCefString): PCefExtension; stdcall;
|
get_extension : function(self: PCefRequestContext; const extension_id: PCefString): PCefExtension; stdcall;
|
||||||
get_media_router : function(self: PCefRequestContext): PCefMediaRouter; stdcall;
|
get_media_router : function(self: PCefRequestContext; callback: PCefCompletionCallback): PCefMediaRouter; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/cef_request_context_handler_capi.h (cef_request_context_handler_t)
|
// /include/capi/cef_request_context_handler_capi.h (cef_request_context_handler_t)
|
||||||
@ -2156,7 +2160,6 @@ type
|
|||||||
// /include/capi/cef_cookie_capi.h (cef_cookie_manager_t)
|
// /include/capi/cef_cookie_capi.h (cef_cookie_manager_t)
|
||||||
TCefCookieManager = record
|
TCefCookieManager = record
|
||||||
base : TCefBaseRefCounted;
|
base : TCefBaseRefCounted;
|
||||||
set_supported_schemes : procedure(self: PCefCookieManager; schemes: TCefStringList; include_defaults: Integer; callback: PCefCompletionCallback); stdcall;
|
|
||||||
visit_all_cookies : function(self: PCefCookieManager; visitor: PCefCookieVisitor): Integer; stdcall;
|
visit_all_cookies : function(self: PCefCookieManager; visitor: PCefCookieVisitor): Integer; stdcall;
|
||||||
visit_url_cookies : function(self: PCefCookieManager; const url: PCefString; includeHttpOnly: Integer; visitor: PCefCookieVisitor): Integer; stdcall;
|
visit_url_cookies : function(self: PCefCookieManager; const url: PCefString; includeHttpOnly: Integer; visitor: PCefCookieVisitor): Integer; stdcall;
|
||||||
set_cookie : function(self: PCefCookieManager; const url: PCefString; const cookie: PCefCookie; callback: PCefSetCookieCallback): Integer; stdcall;
|
set_cookie : function(self: PCefCookieManager; const url: PCefString; const cookie: PCefCookie; callback: PCefSetCookieCallback): Integer; stdcall;
|
||||||
@ -2308,7 +2311,7 @@ type
|
|||||||
on_print_dialog : function(self: PCefPrintHandler; browser: PCefBrowser; has_selection: Integer; callback: PCefPrintDialogCallback): Integer; stdcall;
|
on_print_dialog : function(self: PCefPrintHandler; browser: PCefBrowser; has_selection: Integer; callback: PCefPrintDialogCallback): Integer; stdcall;
|
||||||
on_print_job : function(self: PCefPrintHandler; browser: PCefBrowser; const document_name, pdf_file_path: PCefString; callback: PCefPrintJobCallback): Integer; stdcall;
|
on_print_job : function(self: PCefPrintHandler; browser: PCefBrowser; const document_name, pdf_file_path: PCefString; callback: PCefPrintJobCallback): Integer; stdcall;
|
||||||
on_print_reset : procedure(self: PCefPrintHandler; browser: PCefBrowser); stdcall;
|
on_print_reset : procedure(self: PCefPrintHandler; browser: PCefBrowser); stdcall;
|
||||||
get_pdf_paper_size : function(self: PCefPrintHandler; device_units_per_inch: Integer): TCefSize; stdcall;
|
get_pdf_paper_size : function(self: PCefPrintHandler; browser: PCefBrowser; device_units_per_inch: Integer): TCefSize; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/cef_drag_data_capi.h (cef_drag_data_t)
|
// /include/capi/cef_drag_data_capi.h (cef_drag_data_t)
|
||||||
@ -2632,7 +2635,6 @@ type
|
|||||||
is_spell_check_enabled : function(self: PCefContextMenuParams): Integer; stdcall;
|
is_spell_check_enabled : function(self: PCefContextMenuParams): Integer; stdcall;
|
||||||
get_edit_state_flags : function(self: PCefContextMenuParams): TCefContextMenuEditStateFlags; stdcall;
|
get_edit_state_flags : function(self: PCefContextMenuParams): TCefContextMenuEditStateFlags; stdcall;
|
||||||
is_custom_menu : function(self: PCefContextMenuParams): Integer; stdcall;
|
is_custom_menu : function(self: PCefContextMenuParams): Integer; stdcall;
|
||||||
is_pepper_menu : function(self: PCefContextMenuParams): Integer; stdcall;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/cef_download_item_capi.h (cef_download_item_t)
|
// /include/capi/cef_download_item_capi.h (cef_download_item_t)
|
||||||
@ -2891,6 +2893,7 @@ type
|
|||||||
get_keyboard_handler : function(self: PCefClient): PCefKeyboardHandler; stdcall;
|
get_keyboard_handler : function(self: PCefClient): PCefKeyboardHandler; stdcall;
|
||||||
get_life_span_handler : function(self: PCefClient): PCefLifeSpanHandler; stdcall;
|
get_life_span_handler : function(self: PCefClient): PCefLifeSpanHandler; stdcall;
|
||||||
get_load_handler : function(self: PCefClient): PCefLoadHandler; stdcall;
|
get_load_handler : function(self: PCefClient): PCefLoadHandler; stdcall;
|
||||||
|
get_print_handler : function(self: PCefClient): PCefPrintHandler; stdcall;
|
||||||
get_render_handler : function(self: PCefClient): PCefRenderHandler; stdcall;
|
get_render_handler : function(self: PCefClient): PCefRenderHandler; stdcall;
|
||||||
get_request_handler : function(self: PCefClient): PCefRequestHandler; stdcall;
|
get_request_handler : function(self: PCefClient): PCefRequestHandler; stdcall;
|
||||||
on_process_message_received : function(self: PCefClient; browser: PCefBrowser; frame: PCefFrame; source_process: TCefProcessId; message_: PCefProcessMessage): Integer; stdcall;
|
on_process_message_received : function(self: PCefClient; browser: PCefBrowser; frame: PCefFrame; source_process: TCefProcessId; message_: PCefProcessMessage): Integer; stdcall;
|
||||||
@ -2997,10 +3000,8 @@ type
|
|||||||
// /include/capi/cef_browser_process_handler_capi.h (cef_browser_process_handler_t)
|
// /include/capi/cef_browser_process_handler_capi.h (cef_browser_process_handler_t)
|
||||||
TCefBrowserProcessHandler = record
|
TCefBrowserProcessHandler = record
|
||||||
base : TCefBaseRefCounted;
|
base : TCefBaseRefCounted;
|
||||||
get_cookieable_schemes : procedure(self: PCefBrowserProcessHandler; schemes: TCefStringList; include_defaults: PInteger); stdcall;
|
|
||||||
on_context_initialized : procedure(self: PCefBrowserProcessHandler); stdcall;
|
on_context_initialized : procedure(self: PCefBrowserProcessHandler); stdcall;
|
||||||
on_before_child_process_launch : procedure(self: PCefBrowserProcessHandler; command_line: PCefCommandLine); stdcall;
|
on_before_child_process_launch : procedure(self: PCefBrowserProcessHandler; command_line: PCefCommandLine); stdcall;
|
||||||
get_print_handler : function(self: PCefBrowserProcessHandler): PCefPrintHandler; stdcall;
|
|
||||||
on_schedule_message_pump_work : procedure(self: PCefBrowserProcessHandler; delay_ms: Int64); stdcall;
|
on_schedule_message_pump_work : procedure(self: PCefBrowserProcessHandler; delay_ms: Int64); stdcall;
|
||||||
get_default_client : function(self: PCefBrowserProcessHandler): PCefClient; stdcall;
|
get_default_client : function(self: PCefBrowserProcessHandler): PCefClient; stdcall;
|
||||||
end;
|
end;
|
||||||
@ -3179,6 +3180,7 @@ type
|
|||||||
get_height_for_width : function(self: PCefViewDelegate; view: PCefView; width: Integer): Integer; stdcall;
|
get_height_for_width : function(self: PCefViewDelegate; view: PCefView; width: Integer): Integer; stdcall;
|
||||||
on_parent_view_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer; parent: PCefView); stdcall;
|
on_parent_view_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer; parent: PCefView); stdcall;
|
||||||
on_child_view_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer; child: PCefView); stdcall;
|
on_child_view_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer; child: PCefView); stdcall;
|
||||||
|
on_window_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer); stdcall;
|
||||||
on_focus : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
on_focus : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||||
on_blur : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
on_blur : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||||
end;
|
end;
|
||||||
@ -3264,6 +3266,7 @@ type
|
|||||||
TCefBrowserView = record
|
TCefBrowserView = record
|
||||||
base : TCefView;
|
base : TCefView;
|
||||||
get_browser : function(self: PCefBrowserView): PCefBrowser; stdcall;
|
get_browser : function(self: PCefBrowserView): PCefBrowser; stdcall;
|
||||||
|
get_chrome_toolbar : function(self: PCefBrowserView): PCefView; stdcall;
|
||||||
set_prefer_accelerators : procedure(self: PCefBrowserView; prefer_accelerators: Integer); stdcall;
|
set_prefer_accelerators : procedure(self: PCefBrowserView; prefer_accelerators: Integer); stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3274,6 +3277,7 @@ type
|
|||||||
on_browser_destroyed : procedure(self: PCefBrowserViewDelegate; browser_view: PCefBrowserView; browser: PCefBrowser); stdcall;
|
on_browser_destroyed : procedure(self: PCefBrowserViewDelegate; browser_view: PCefBrowserView; browser: PCefBrowser); stdcall;
|
||||||
get_delegate_for_popup_browser_view : function(self: PCefBrowserViewDelegate; browser_view: PCefBrowserView; const settings: PCefBrowserSettings; client: PCefClient; is_devtools: Integer): PCefBrowserViewDelegate; stdcall;
|
get_delegate_for_popup_browser_view : function(self: PCefBrowserViewDelegate; browser_view: PCefBrowserView; const settings: PCefBrowserSettings; client: PCefClient; is_devtools: Integer): PCefBrowserViewDelegate; stdcall;
|
||||||
on_popup_browser_view_created : function(self: PCefBrowserViewDelegate; browser_view, popup_browser_view: PCefBrowserView; is_devtools: Integer): Integer; stdcall;
|
on_popup_browser_view_created : function(self: PCefBrowserViewDelegate; browser_view, popup_browser_view: PCefBrowserView; is_devtools: Integer): Integer; stdcall;
|
||||||
|
get_chrome_toolbar_type : function(self: PCefBrowserViewDelegate): TCefChromeToolbarType; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/views/cef_button_capi.h (cef_button_t)
|
// /include/capi/views/cef_button_capi.h (cef_button_t)
|
||||||
|
@ -69,6 +69,7 @@ type
|
|||||||
FOnGetHeightForWidth : TOnGetHeightForWidthEvent;
|
FOnGetHeightForWidth : TOnGetHeightForWidthEvent;
|
||||||
FOnParentViewChanged : TOnParentViewChangedEvent;
|
FOnParentViewChanged : TOnParentViewChangedEvent;
|
||||||
FOnChildViewChanged : TOnChildViewChangedEvent;
|
FOnChildViewChanged : TOnChildViewChangedEvent;
|
||||||
|
FOnWindowChanged : TOnWindowChangedEvent;
|
||||||
FOnFocus : TOnFocusEvent;
|
FOnFocus : TOnFocusEvent;
|
||||||
FOnBlur : TOnBlurEvent;
|
FOnBlur : TOnBlurEvent;
|
||||||
|
|
||||||
@ -124,6 +125,7 @@ type
|
|||||||
procedure doOnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); virtual;
|
procedure doOnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); virtual;
|
||||||
procedure doOnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); virtual;
|
procedure doOnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); virtual;
|
||||||
procedure doOnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); virtual;
|
procedure doOnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); virtual;
|
||||||
|
procedure doOnWindowChanged(const view: ICefView; added: boolean); virtual;
|
||||||
procedure doOnFocus(const view: ICefView); virtual;
|
procedure doOnFocus(const view: ICefView); virtual;
|
||||||
procedure doOnBlur(const view: ICefView); virtual;
|
procedure doOnBlur(const view: ICefView); virtual;
|
||||||
procedure doCreateCustomView; virtual;
|
procedure doCreateCustomView; virtual;
|
||||||
@ -183,6 +185,7 @@ type
|
|||||||
property OnGetHeightForWidth : TOnGetHeightForWidthEvent read FOnGetHeightForWidth write FOnGetHeightForWidth;
|
property OnGetHeightForWidth : TOnGetHeightForWidthEvent read FOnGetHeightForWidth write FOnGetHeightForWidth;
|
||||||
property OnParentViewChanged : TOnParentViewChangedEvent read FOnParentViewChanged write FOnParentViewChanged;
|
property OnParentViewChanged : TOnParentViewChangedEvent read FOnParentViewChanged write FOnParentViewChanged;
|
||||||
property OnChildViewChanged : TOnChildViewChangedEvent read FOnChildViewChanged write FOnChildViewChanged;
|
property OnChildViewChanged : TOnChildViewChangedEvent read FOnChildViewChanged write FOnChildViewChanged;
|
||||||
|
property OnWindowChanged : TOnWindowChangedEvent read FOnWindowChanged write FOnWindowChanged;
|
||||||
property OnFocus : TOnFocusEvent read FOnFocus write FOnFocus;
|
property OnFocus : TOnFocusEvent read FOnFocus write FOnFocus;
|
||||||
property OnBlur : TOnBlurEvent read FOnBlur write FOnBlur;
|
property OnBlur : TOnBlurEvent read FOnBlur write FOnBlur;
|
||||||
end;
|
end;
|
||||||
@ -241,6 +244,7 @@ begin
|
|||||||
FOnGetHeightForWidth := nil;
|
FOnGetHeightForWidth := nil;
|
||||||
FOnParentViewChanged := nil;
|
FOnParentViewChanged := nil;
|
||||||
FOnChildViewChanged := nil;
|
FOnChildViewChanged := nil;
|
||||||
|
FOnWindowChanged := nil;
|
||||||
FOnFocus := nil;
|
FOnFocus := nil;
|
||||||
FOnBlur := nil;
|
FOnBlur := nil;
|
||||||
end;
|
end;
|
||||||
@ -694,6 +698,13 @@ begin
|
|||||||
FOnChildViewChanged(self, view, added, child);
|
FOnChildViewChanged(self, view, added, child);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEFViewComponent.doOnWindowChanged(const view : ICefView;
|
||||||
|
added : boolean);
|
||||||
|
begin
|
||||||
|
if assigned(FOnWindowChanged) then
|
||||||
|
FOnWindowChanged(self, view, added);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCEFViewComponent.doOnFocus(const view: ICefView);
|
procedure TCEFViewComponent.doOnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
if assigned(FOnFocus) then
|
if assigned(FOnFocus) then
|
||||||
|
@ -65,6 +65,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer);
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer);
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
procedure OnFocus(const view: ICefView);
|
procedure OnFocus(const view: ICefView);
|
||||||
procedure OnBlur(const view: ICefView);
|
procedure OnBlur(const view: ICefView);
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); virtual;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); virtual;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); virtual;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); virtual;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); virtual;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); virtual;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); virtual;
|
||||||
procedure OnFocus(const view: ICefView); virtual;
|
procedure OnFocus(const view: ICefView); virtual;
|
||||||
procedure OnBlur(const view: ICefView); virtual;
|
procedure OnBlur(const view: ICefView); virtual;
|
||||||
|
|
||||||
@ -98,6 +100,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -157,6 +160,13 @@ begin
|
|||||||
CefGetData(child));
|
CefGetData(child));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefViewDelegateRef.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
PCefViewDelegate(FData)^.on_window_changed(PCefViewDelegate(FData),
|
||||||
|
CefGetData(view),
|
||||||
|
ord(added));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefViewDelegateRef.OnFocus(const view: ICefView);
|
procedure TCefViewDelegateRef.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
PCefViewDelegate(FData)^.on_focus(PCefViewDelegate(FData),
|
PCefViewDelegate(FData)^.on_focus(PCefViewDelegate(FData),
|
||||||
@ -271,6 +281,17 @@ begin
|
|||||||
TCefViewRef.UnWrap(child));
|
TCefViewRef.UnWrap(child));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure cef_view_delegate_on_window_changed(self: PCefViewDelegate; view: PCefView; added: Integer); stdcall;
|
||||||
|
var
|
||||||
|
TempObject : TObject;
|
||||||
|
begin
|
||||||
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
|
if (TempObject <> nil) and (TempObject is TCefViewDelegateOwn) then
|
||||||
|
TCefViewDelegateOwn(TempObject).OnWindowChanged(TCefViewRef.UnWrap(view),
|
||||||
|
added <> 0);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure cef_view_delegate_on_focus(self: PCefViewDelegate; view: PCefView); stdcall;
|
procedure cef_view_delegate_on_focus(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
@ -308,6 +329,7 @@ begin
|
|||||||
get_height_for_width := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_get_height_for_width;
|
get_height_for_width := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_get_height_for_width;
|
||||||
on_parent_view_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_parent_view_changed;
|
on_parent_view_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_parent_view_changed;
|
||||||
on_child_view_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_child_view_changed;
|
on_child_view_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_child_view_changed;
|
||||||
|
on_window_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_window_changed;
|
||||||
on_focus := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_focus;
|
on_focus := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_focus;
|
||||||
on_blur := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_blur;
|
on_blur := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_blur;
|
||||||
end;
|
end;
|
||||||
@ -343,6 +365,11 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefViewDelegateOwn.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefViewDelegateOwn.OnFocus(const view: ICefView);
|
procedure TCefViewDelegateOwn.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
//
|
//
|
||||||
@ -438,6 +465,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomViewDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefViewDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomViewDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomViewDelegate.OnFocus(const view: ICefView);
|
procedure TCustomViewDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -64,6 +64,7 @@ type
|
|||||||
TOnGetHeightForWidthEvent = procedure(const Sender: TObject; const view: ICefView; width: Integer; var aResult: Integer) of object;
|
TOnGetHeightForWidthEvent = procedure(const Sender: TObject; const view: ICefView; width: Integer; var aResult: Integer) of object;
|
||||||
TOnParentViewChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean; const parent: ICefView) of object;
|
TOnParentViewChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean; const parent: ICefView) of object;
|
||||||
TOnChildViewChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean; const child: ICefView) of object;
|
TOnChildViewChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean; const child: ICefView) of object;
|
||||||
|
TOnWindowChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean) of object;
|
||||||
TOnFocusEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
TOnFocusEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
||||||
TOnBlurEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
TOnBlurEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
||||||
|
|
||||||
@ -78,6 +79,7 @@ type
|
|||||||
TOnBrowserDestroyedEvent = procedure(const Sender: TObject; const browser_view: ICefBrowserView; const browser: ICefBrowser) of object;
|
TOnBrowserDestroyedEvent = procedure(const Sender: TObject; const browser_view: ICefBrowserView; const browser: ICefBrowser) of object;
|
||||||
TOnGetDelegateForPopupBrowserViewEvent = procedure(const Sender: TObject; const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate) of object;
|
TOnGetDelegateForPopupBrowserViewEvent = procedure(const Sender: TObject; const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate) of object;
|
||||||
TOnPopupBrowserViewCreatedEvent = procedure(const Sender: TObject; const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean) of object;
|
TOnPopupBrowserViewCreatedEvent = procedure(const Sender: TObject; const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean) of object;
|
||||||
|
TOnGetChromeToolbarTypeEvent = procedure(const Sender: TObject; var aChromeToolbarType: TCefChromeToolbarType) of object;
|
||||||
|
|
||||||
// ICefButtonDelegate
|
// ICefButtonDelegate
|
||||||
TOnButtonPressedEvent = procedure(const Sender: TObject; const button: ICefButton) of object;
|
TOnButtonPressedEvent = procedure(const Sender: TObject; const button: ICefButton) of object;
|
||||||
|
@ -106,6 +106,7 @@ type
|
|||||||
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override;
|
||||||
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
|
||||||
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
|
||||||
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
|
||||||
procedure OnFocus(const view: ICefView); override;
|
procedure OnFocus(const view: ICefView); override;
|
||||||
procedure OnBlur(const view: ICefView); override;
|
procedure OnBlur(const view: ICefView); override;
|
||||||
|
|
||||||
@ -544,6 +545,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomWindowDelegate.OnWindowChanged(const view: ICefView; added: boolean);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then
|
||||||
|
ICefWindowDelegateEvents(FEvents).doOnWindowChanged(view, added);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCustomWindowDelegate.OnWindowChanged', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomWindowDelegate.OnFocus(const view: ICefView);
|
procedure TCustomWindowDelegate.OnFocus(const view: ICefView);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 274,
|
"InternalVersion" : 275,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "89.0.18.0"
|
"Version" : "90.5.4.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpdatePackageData" : {
|
"UpdatePackageData" : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user