mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-15 07:45:56 +01:00
Update to CEF 124.3.1
Removed the demos in Delphi_VCL\Extensions
This commit is contained in:
parent
4d80d82588
commit
36c99d107c
14
README.md
14
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 LICENSE.md file.
|
||||
|
||||
CEF4Delphi uses CEF 123.0.13 which includes Chromium 123.0.6312.124.
|
||||
CEF4Delphi uses CEF 124.3.1 which includes Chromium 124.0.6367.60.
|
||||
|
||||
The CEF binaries used by CEF4Delphi are available for download at Spotify :
|
||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_123.0.13%2Bgfc703fb%2Bchromium-123.0.6312.124_windows32.tar.bz2)
|
||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_123.0.13%2Bgfc703fb%2Bchromium-123.0.6312.124_windows64.tar.bz2)
|
||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_123.0.13%2Bgfc703fb%2Bchromium-123.0.6312.124_linux64.tar.bz2)
|
||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_123.0.13%2Bgfc703fb%2Bchromium-123.0.6312.124_linuxarm.tar.bz2)
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_123.0.13%2Bgfc703fb%2Bchromium-123.0.6312.124_linuxarm64.tar.bz2)
|
||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_123.0.13%2Bgfc703fb%2Bchromium-123.0.6312.124_macosx64.tar.bz2)
|
||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_124.3.1%2Bg6d871a1%2Bchromium-124.0.6367.60_windows32.tar.bz2)
|
||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_124.3.1%2Bg6d871a1%2Bchromium-124.0.6367.60_windows64.tar.bz2)
|
||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_124.3.1%2Bg6d871a1%2Bchromium-124.0.6367.60_linux64.tar.bz2)
|
||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_124.3.1%2Bg6d871a1%2Bchromium-124.0.6367.60_linuxarm.tar.bz2)
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_124.3.1%2Bg6d871a1%2Bchromium-124.0.6367.60_linuxarm64.tar.bz2)
|
||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_124.3.1%2Bg6d871a1%2Bchromium-124.0.6367.60_macosx64.tar.bz2)
|
||||
|
||||
CEF4Delphi was developed and tested on Delphi 12.1 and it has been tested in Delphi 6, Delphi XE, Delphi 10, Delphi 11 and Lazarus 3.2/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
del /s /q *.dcu
|
||||
del /s /q *.exe
|
||||
del /s /q *.res
|
||||
del /s /q *.rsm
|
||||
del /s /q *.log
|
||||
del /s /q *.dsk
|
||||
del /s /q *.identcache
|
||||
del /s /q *.stat
|
||||
del /s /q *.local
|
||||
del /s /q *.~*
|
||||
rmdir Win32\Debug
|
||||
rmdir Win32\Release
|
||||
rmdir Win32
|
||||
rmdir Win64\Debug
|
||||
rmdir Win64\Release
|
||||
rmdir Win64
|
||||
rmdir __history
|
||||
rmdir __recovery
|
@ -1,36 +0,0 @@
|
||||
program HelloWorldExt;
|
||||
|
||||
{$I ..\..\..\..\source\cef.inc}
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
Vcl.Forms,
|
||||
{$ELSE}
|
||||
Forms,
|
||||
{$ENDIF }
|
||||
uCEFApplication,
|
||||
uHelloWorldExt in 'uHelloWorldExt.pas' {Form1};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
const
|
||||
IMAGE_FILE_LARGE_ADDRESS_AWARE = $0020;
|
||||
|
||||
// CEF needs to set the LARGEADDRESSAWARE ($20) flag which allows 32-bit processes to use up to 3GB of RAM.
|
||||
{$IFDEF WIN32}{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}{$ENDIF}
|
||||
|
||||
begin
|
||||
CreateGlobalCEFApp;
|
||||
|
||||
if GlobalCEFApp.StartMainProcess then
|
||||
begin
|
||||
Application.Initialize;
|
||||
{$IFDEF DELPHI11_UP}
|
||||
Application.MainFormOnTaskbar := True;
|
||||
{$ENDIF}
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end;
|
||||
|
||||
DestroyGlobalCEFApp;
|
||||
end.
|
File diff suppressed because it is too large
Load Diff
@ -1,161 +0,0 @@
|
||||
object Form1: TForm1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'Initializing browser. Please wait...'
|
||||
ClientHeight = 624
|
||||
ClientWidth = 1088
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
Position = poScreenCenter
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
TextHeight = 13
|
||||
object AddressPnl: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1088
|
||||
Height = 30
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
Enabled = False
|
||||
Padding.Left = 5
|
||||
Padding.Top = 5
|
||||
Padding.Right = 5
|
||||
Padding.Bottom = 5
|
||||
TabOrder = 0
|
||||
object AddressEdt: TEdit
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 1047
|
||||
Height = 20
|
||||
Margins.Right = 5
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
Text = 'http://www.google.com'
|
||||
ExplicitHeight = 21
|
||||
end
|
||||
object GoBtn: TButton
|
||||
Left = 1052
|
||||
Top = 5
|
||||
Width = 31
|
||||
Height = 20
|
||||
Margins.Left = 5
|
||||
Align = alRight
|
||||
Caption = 'Go'
|
||||
TabOrder = 1
|
||||
OnClick = GoBtnClick
|
||||
end
|
||||
end
|
||||
object CEFWindowParent1: TCEFWindowParent
|
||||
Left = 0
|
||||
Top = 30
|
||||
Width = 824
|
||||
Height = 594
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
end
|
||||
object ExtensionPnl: TPanel
|
||||
Left = 824
|
||||
Top = 30
|
||||
Width = 264
|
||||
Height = 594
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
Padding.Left = 5
|
||||
Padding.Top = 5
|
||||
Padding.Right = 5
|
||||
Padding.Bottom = 5
|
||||
TabOrder = 2
|
||||
object ExtensionMem: TMemo
|
||||
Left = 5
|
||||
Top = 97
|
||||
Width = 254
|
||||
Height = 222
|
||||
Align = alTop
|
||||
ReadOnly = True
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 0
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 254
|
||||
Height = 92
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
Padding.Bottom = 5
|
||||
TabOrder = 1
|
||||
object LoadExtensionBtn: TButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 254
|
||||
Height = 25
|
||||
Align = alTop
|
||||
Caption = '1. Load extension'
|
||||
TabOrder = 0
|
||||
OnClick = LoadExtensionBtnClick
|
||||
end
|
||||
object UnloadExtensionBtn: TButton
|
||||
Left = 0
|
||||
Top = 62
|
||||
Width = 254
|
||||
Height = 25
|
||||
Align = alBottom
|
||||
Caption = '3. Unload extension'
|
||||
Enabled = False
|
||||
TabOrder = 2
|
||||
OnClick = UnloadExtensionBtnClick
|
||||
end
|
||||
object LoadPopupPageBtn: TButton
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 254
|
||||
Height = 25
|
||||
Caption = '2. Load popup page'
|
||||
TabOrder = 1
|
||||
OnClick = LoadPopupPageBtnClick
|
||||
end
|
||||
end
|
||||
object CEFWindowParent2: TCEFWindowParent
|
||||
Left = 5
|
||||
Top = 319
|
||||
Width = 254
|
||||
Height = 270
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object Timer1: TTimer
|
||||
Enabled = False
|
||||
Interval = 300
|
||||
OnTimer = Timer1Timer
|
||||
Left = 56
|
||||
Top = 88
|
||||
end
|
||||
object Chromium1: TChromium
|
||||
OnBeforePopup = Chromium1BeforePopup
|
||||
OnAfterCreated = Chromium1AfterCreated
|
||||
OnBeforeClose = Chromium1BeforeClose
|
||||
OnClose = Chromium1Close
|
||||
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
|
||||
Left = 56
|
||||
Top = 152
|
||||
end
|
||||
object ExtensionChr: TChromium
|
||||
OnLoadEnd = ExtensionChrLoadEnd
|
||||
OnLoadError = ExtensionChrLoadError
|
||||
OnBeforeClose = ExtensionChrBeforeClose
|
||||
OnClose = ExtensionChrClose
|
||||
OnExtensionLoadFailed = ExtensionChrExtensionLoadFailed
|
||||
OnExtensionLoaded = ExtensionChrExtensionLoaded
|
||||
OnExtensionUnloaded = ExtensionChrExtensionUnloaded
|
||||
Left = 944
|
||||
Top = 392
|
||||
end
|
||||
end
|
@ -1,422 +0,0 @@
|
||||
unit uHelloWorldExt;
|
||||
|
||||
{$I ..\..\..\..\source\cef.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
|
||||
{$ELSE}
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
||||
{$ENDIF}
|
||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes,
|
||||
uCEFWinControl, uCEFChromiumCore;
|
||||
|
||||
const
|
||||
CEF_EXT_LOADED = WM_APP + $B01;
|
||||
CEF_EXT_UNLOADED = WM_APP + $B02;
|
||||
CEF_EXT_ERROR = WM_APP + $B03;
|
||||
CEF_EXT_POPUP_LOADED = WM_APP + $B04;
|
||||
CEF_EXT_POPUP_ERROR = WM_APP + $B05;
|
||||
|
||||
DESTROY_MAIN_WINDOWPARENT = 1;
|
||||
DESTROY_EXT_WINDOWPARENT = 2;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
AddressPnl: TPanel;
|
||||
AddressEdt: TEdit;
|
||||
GoBtn: TButton;
|
||||
Timer1: TTimer;
|
||||
Chromium1: TChromium;
|
||||
CEFWindowParent1: TCEFWindowParent;
|
||||
ExtensionChr: TChromium;
|
||||
ExtensionPnl: TPanel;
|
||||
ExtensionMem: TMemo;
|
||||
Panel1: TPanel;
|
||||
LoadExtensionBtn: TButton;
|
||||
UnloadExtensionBtn: TButton;
|
||||
CEFWindowParent2: TCEFWindowParent;
|
||||
LoadPopupPageBtn: TButton;
|
||||
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
|
||||
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium1BeforePopup(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, Result: Boolean);
|
||||
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||
|
||||
procedure ExtensionChrExtensionLoaded(Sender: TObject; const extension: ICefExtension);
|
||||
procedure ExtensionChrExtensionLoadFailed(Sender: TObject; result: TCefErrorcode);
|
||||
procedure ExtensionChrExtensionUnloaded(Sender: TObject; const extension: ICefExtension);
|
||||
procedure ExtensionChrLoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
||||
procedure ExtensionChrLoadError(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring);
|
||||
procedure ExtensionChrClose(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
||||
procedure ExtensionChrBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
|
||||
procedure GoBtnClick(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
procedure LoadExtensionBtnClick(Sender: TObject);
|
||||
procedure UnloadExtensionBtnClick(Sender: TObject);
|
||||
procedure LoadPopupPageBtnClick(Sender: TObject);
|
||||
|
||||
protected
|
||||
FCanClose : boolean;
|
||||
FClosing : boolean;
|
||||
FExtension : ICefExtension;
|
||||
|
||||
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
|
||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||
|
||||
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||
procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
|
||||
procedure ExtensionLoadedMsg(var aMessage : TMessage); message CEF_EXT_LOADED;
|
||||
procedure ExtensionUnloadedMsg(var aMessage : TMessage); message CEF_EXT_UNLOADED;
|
||||
procedure ExtensionErrorMsg(var aMessage : TMessage); message CEF_EXT_ERROR;
|
||||
procedure ExtensionPopupLoadedMsg(var aMessage : TMessage); message CEF_EXT_POPUP_LOADED;
|
||||
procedure ExtensionPopupErrorMsg(var aMessage : TMessage); message CEF_EXT_POPUP_ERROR;
|
||||
|
||||
procedure UpdateButtons;
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uCEFApplication, uCefMiscFunctions, uCEFJson;
|
||||
|
||||
// This is a simple demo showing how to load, unload and show the popup page
|
||||
// from a chrome extension.
|
||||
|
||||
// This demo only allows to load the extension once.
|
||||
|
||||
// The extension loaded is called "Hello World" and it's located in the
|
||||
// CEF4Delphi\bin\hello directory. It only has a browser action popup html with
|
||||
// the "Hello World" message and no other functionality.
|
||||
|
||||
// It's necessary to unload the extension before you close the form. Notice that
|
||||
// both TChromium components must be properly destroyed before allowing the form
|
||||
// to close.
|
||||
|
||||
// This demo is just a template for other demos and it has a browser loading
|
||||
// google.com but in this case the extension doesn't use that browser.
|
||||
|
||||
// Load chrome://extensions-support/ to get a list of supported APIs
|
||||
|
||||
// Destruction steps
|
||||
// =================
|
||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser in both
|
||||
// browsers which triggers the TChromium.OnClose event.
|
||||
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy
|
||||
// CEFWindowParent1 and CEFWindowParent2 in the main thread, which triggers
|
||||
// the TChromium.OnBeforeClose event.
|
||||
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
begin
|
||||
GlobalCEFApp := TCefApplication.Create;
|
||||
GlobalCEFApp.LogFile := 'debug.log';
|
||||
GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
if (FExtension <> nil) then
|
||||
begin
|
||||
CanClose := False;
|
||||
showmessage('Unload the extension before closing this demo');
|
||||
exit;
|
||||
end;
|
||||
|
||||
CanClose := FCanClose and
|
||||
(CEFWindowParent1 = nil) and
|
||||
((CEFWindowParent2 = nil) or not(ExtensionChr.Initialized));
|
||||
|
||||
if not(FClosing) then
|
||||
begin
|
||||
FClosing := True;
|
||||
Visible := False;
|
||||
Chromium1.CloseBrowser(True);
|
||||
ExtensionChr.CloseBrowser(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FCanClose := False;
|
||||
FClosing := False;
|
||||
FExtension := nil;
|
||||
Chromium1.DefaultURL := AddressEdt.Text;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FExtension := nil;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormShow(Sender: TObject);
|
||||
begin
|
||||
if not(Chromium1.CreateBrowser(CEFWindowParent1)) then
|
||||
Timer1.Enabled := True;
|
||||
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1BeforePopup(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, Result: Boolean);
|
||||
begin
|
||||
// For simplicity, this demo blocks all popup windows and new tabs
|
||||
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1Close(Sender: TObject;
|
||||
const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
begin
|
||||
PostMessage(Handle, CEF_DESTROY, DESTROY_MAIN_WINDOWPARENT, 0);
|
||||
aAction := cbaDelay;
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1OpenUrlFromTab(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame;
|
||||
const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition;
|
||||
userGesture: Boolean; out Result: Boolean);
|
||||
begin
|
||||
// For simplicity, this demo blocks all popup windows and new tabs
|
||||
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrBeforeClose(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrClose(Sender: TObject; const browser: ICefBrowser;
|
||||
var aAction: TCefCloseBrowserAction);
|
||||
begin
|
||||
PostMessage(Handle, CEF_DESTROY, DESTROY_EXT_WINDOWPARENT, 0);
|
||||
aAction := cbaDelay;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionLoaded(Sender: TObject; const extension: ICefExtension);
|
||||
begin
|
||||
FExtension := extension;
|
||||
|
||||
PostMessage(Handle, CEF_EXT_LOADED, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionLoadFailed(Sender: TObject; result: TCefErrorcode);
|
||||
begin
|
||||
PostMessage(Handle, CEF_EXT_ERROR, 0, result);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionUnloaded(Sender: TObject; const extension: ICefExtension);
|
||||
begin
|
||||
if (extension <> nil) and (FExtension <> nil) and extension.IsSame(FExtension) then
|
||||
begin
|
||||
FExtension := nil;
|
||||
PostMessage(Handle, CEF_EXT_UNLOADED, 0, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrLoadEnd(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
||||
begin
|
||||
PostMessage(Handle, CEF_EXT_POPUP_LOADED, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrLoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode;
|
||||
const errorText, failedUrl: ustring);
|
||||
begin
|
||||
PostMessage(Handle, CEF_EXT_POPUP_ERROR, 0, errorCode);
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
Caption := 'Hello World Extension Demo';
|
||||
AddressPnl.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserDestroyMsg(var aMessage : TMessage);
|
||||
begin
|
||||
case aMessage.WParam of
|
||||
DESTROY_MAIN_WINDOWPARENT : FreeAndNil(CEFWindowParent1);
|
||||
DESTROY_EXT_WINDOWPARENT : FreeAndNil(CEFWindowParent2);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.GoBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.LoadURL(AddressEdt.Text);
|
||||
end;
|
||||
|
||||
procedure TForm1.UpdateButtons;
|
||||
begin
|
||||
// This demo only allows to load the extension once.
|
||||
|
||||
if ExtensionChr.Initialized then
|
||||
begin
|
||||
LoadExtensionBtn.Enabled := False;
|
||||
UnloadExtensionBtn.Enabled := (FExtension <> nil);
|
||||
LoadPopupPageBtn.Enabled := False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
LoadExtensionBtn.Enabled := (FExtension = nil);
|
||||
UnloadExtensionBtn.Enabled := (FExtension <> nil);
|
||||
LoadPopupPageBtn.Enabled := (FExtension <> nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionLoadedMsg(var aMessage : TMessage);
|
||||
var
|
||||
TempManifest : TStringList;
|
||||
begin
|
||||
if (FExtension = nil) then exit;
|
||||
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension loaded successfully!');
|
||||
ExtensionMem.Lines.Add('Identifier: ' + FExtension.Identifier);
|
||||
ExtensionMem.Lines.Add('Path: ' + FExtension.Path);
|
||||
ExtensionMem.Lines.Add('IsLoaded: ' + BoolToStr(FExtension.IsLoaded, True));
|
||||
ExtensionMem.Lines.Add('Popup: ' + FExtension.BrowserActionPopup);
|
||||
ExtensionMem.Lines.Add('Icon: ' + FExtension.BrowserActionIcon);
|
||||
ExtensionMem.Lines.Add('URL: ' + FExtension.URL);
|
||||
|
||||
TempManifest := TStringList.Create;
|
||||
|
||||
if TCEFJson.Write(FExtension.Manifest, TempManifest) then
|
||||
begin
|
||||
ExtensionMem.Lines.Add('Manifest: ' + FExtension.Path);
|
||||
ExtensionMem.Lines.AddStrings(TempManifest);
|
||||
end;
|
||||
|
||||
TempManifest.Free;
|
||||
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionUnloadedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension unloaded successfully!');
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionErrorMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension load failed. Result : ' + inttostr(aMessage.LParam));
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionPopupLoadedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension PopUp page loaded successfully!');
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionPopupErrorMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension PopUp page load failed. Error code : ' + inttostr(aMessage.LParam));
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadExtensionBtnClick(Sender: TObject);
|
||||
var
|
||||
TempExtensionDirectoryPath : ustring;
|
||||
begin
|
||||
if (FExtension = nil) then
|
||||
begin
|
||||
TempExtensionDirectoryPath := GetModulePath + 'hello';
|
||||
ExtensionChr.LoadExtension(TempExtensionDirectoryPath);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadPopupPageBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (FExtension = nil) or ExtensionChr.Initialized then exit;
|
||||
|
||||
ExtensionChr.DefaultURL := FExtension.URL + FExtension.BrowserActionPopup;
|
||||
ExtensionChr.CreateBrowser(CEFWindowParent2);
|
||||
end;
|
||||
|
||||
procedure TForm1.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
Timer1.Enabled := False;
|
||||
if not(Chromium1.CreateBrowser(CEFWindowParent1)) and not(Chromium1.Initialized) then
|
||||
Timer1.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.UnloadExtensionBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (FExtension <> nil) then
|
||||
FExtension.Unload;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMMove(var aMessage : TWMMove);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMMoving(var aMessage : TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMEnterMenuLoop(var aMessage: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then
|
||||
GlobalCEFApp.OsmodalLoop := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMExitMenuLoop(var aMessage: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then
|
||||
GlobalCEFApp.OsmodalLoop := False;
|
||||
end;
|
||||
|
||||
end.
|
@ -1,18 +0,0 @@
|
||||
del /s /q *.dcu
|
||||
del /s /q *.exe
|
||||
del /s /q *.res
|
||||
del /s /q *.rsm
|
||||
del /s /q *.log
|
||||
del /s /q *.dsk
|
||||
del /s /q *.identcache
|
||||
del /s /q *.stat
|
||||
del /s /q *.local
|
||||
del /s /q *.~*
|
||||
rmdir Win32\Debug
|
||||
rmdir Win32\Release
|
||||
rmdir Win32
|
||||
rmdir Win64\Debug
|
||||
rmdir Win64\Release
|
||||
rmdir Win64
|
||||
rmdir __history
|
||||
rmdir __recovery
|
@ -1,36 +0,0 @@
|
||||
program PageColorExt;
|
||||
|
||||
{$I ..\..\..\..\source\cef.inc}
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
Vcl.Forms,
|
||||
{$ELSE}
|
||||
Forms,
|
||||
{$ENDIF }
|
||||
uCEFApplication,
|
||||
uPageColorExt in 'uPageColorExt.pas' {Form1};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
const
|
||||
IMAGE_FILE_LARGE_ADDRESS_AWARE = $0020;
|
||||
|
||||
// CEF needs to set the LARGEADDRESSAWARE ($20) flag which allows 32-bit processes to use up to 3GB of RAM.
|
||||
{$IFDEF WIN32}{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}{$ENDIF}
|
||||
|
||||
begin
|
||||
CreateGlobalCEFApp;
|
||||
|
||||
if GlobalCEFApp.StartMainProcess then
|
||||
begin
|
||||
Application.Initialize;
|
||||
{$IFDEF DELPHI11_UP}
|
||||
Application.MainFormOnTaskbar := True;
|
||||
{$ENDIF}
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end;
|
||||
|
||||
DestroyGlobalCEFApp;
|
||||
end.
|
File diff suppressed because it is too large
Load Diff
@ -1,162 +0,0 @@
|
||||
object Form1: TForm1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'Initializing browser. Please wait...'
|
||||
ClientHeight = 624
|
||||
ClientWidth = 1088
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
Position = poScreenCenter
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
TextHeight = 13
|
||||
object AddressPnl: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1088
|
||||
Height = 30
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
Enabled = False
|
||||
Padding.Left = 5
|
||||
Padding.Top = 5
|
||||
Padding.Right = 5
|
||||
Padding.Bottom = 5
|
||||
TabOrder = 0
|
||||
object AddressEdt: TEdit
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 1047
|
||||
Height = 20
|
||||
Margins.Right = 5
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
Text = 'http://www.google.com'
|
||||
ExplicitHeight = 21
|
||||
end
|
||||
object GoBtn: TButton
|
||||
Left = 1052
|
||||
Top = 5
|
||||
Width = 31
|
||||
Height = 20
|
||||
Margins.Left = 5
|
||||
Align = alRight
|
||||
Caption = 'Go'
|
||||
TabOrder = 1
|
||||
OnClick = GoBtnClick
|
||||
end
|
||||
end
|
||||
object CEFWindowParent1: TCEFWindowParent
|
||||
Left = 0
|
||||
Top = 30
|
||||
Width = 824
|
||||
Height = 594
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
end
|
||||
object ExtensionPnl: TPanel
|
||||
Left = 824
|
||||
Top = 30
|
||||
Width = 264
|
||||
Height = 594
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
Padding.Left = 5
|
||||
Padding.Top = 5
|
||||
Padding.Right = 5
|
||||
Padding.Bottom = 5
|
||||
TabOrder = 2
|
||||
object ExtensionMem: TMemo
|
||||
Left = 5
|
||||
Top = 97
|
||||
Width = 254
|
||||
Height = 222
|
||||
Align = alTop
|
||||
ReadOnly = True
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 0
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 254
|
||||
Height = 92
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
Padding.Bottom = 5
|
||||
TabOrder = 1
|
||||
object LoadExtensionBtn: TButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 254
|
||||
Height = 25
|
||||
Align = alTop
|
||||
Caption = '1. Load extension'
|
||||
TabOrder = 0
|
||||
OnClick = LoadExtensionBtnClick
|
||||
end
|
||||
object UnloadExtensionBtn: TButton
|
||||
Left = 0
|
||||
Top = 62
|
||||
Width = 254
|
||||
Height = 25
|
||||
Align = alBottom
|
||||
Caption = '3. Unload extension'
|
||||
Enabled = False
|
||||
TabOrder = 2
|
||||
OnClick = UnloadExtensionBtnClick
|
||||
end
|
||||
object LoadPopupPageBtn: TButton
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 254
|
||||
Height = 25
|
||||
Caption = '2. Load popup page'
|
||||
TabOrder = 1
|
||||
OnClick = LoadPopupPageBtnClick
|
||||
end
|
||||
end
|
||||
object CEFWindowParent2: TCEFWindowParent
|
||||
Left = 5
|
||||
Top = 319
|
||||
Width = 254
|
||||
Height = 270
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object Timer1: TTimer
|
||||
Enabled = False
|
||||
Interval = 300
|
||||
OnTimer = Timer1Timer
|
||||
Left = 56
|
||||
Top = 88
|
||||
end
|
||||
object Chromium1: TChromium
|
||||
OnBeforePopup = Chromium1BeforePopup
|
||||
OnAfterCreated = Chromium1AfterCreated
|
||||
OnBeforeClose = Chromium1BeforeClose
|
||||
OnClose = Chromium1Close
|
||||
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
|
||||
Left = 56
|
||||
Top = 152
|
||||
end
|
||||
object ExtensionChr: TChromium
|
||||
OnLoadEnd = ExtensionChrLoadEnd
|
||||
OnLoadError = ExtensionChrLoadError
|
||||
OnBeforeClose = ExtensionChrBeforeClose
|
||||
OnClose = ExtensionChrClose
|
||||
OnExtensionLoadFailed = ExtensionChrExtensionLoadFailed
|
||||
OnExtensionLoaded = ExtensionChrExtensionLoaded
|
||||
OnExtensionUnloaded = ExtensionChrExtensionUnloaded
|
||||
OnExtensionGetActiveBrowser = ExtensionChrExtensionGetActiveBrowser
|
||||
Left = 944
|
||||
Top = 392
|
||||
end
|
||||
end
|
@ -1,451 +0,0 @@
|
||||
unit uPageColorExt;
|
||||
|
||||
{$I ..\..\..\..\source\cef.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
|
||||
{$ELSE}
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
|
||||
{$ENDIF}
|
||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes,
|
||||
uCEFWinControl, uCEFChromiumCore;
|
||||
|
||||
const
|
||||
CEF_EXT_LOADED = WM_APP + $B01;
|
||||
CEF_EXT_UNLOADED = WM_APP + $B02;
|
||||
CEF_EXT_ERROR = WM_APP + $B03;
|
||||
CEF_EXT_POPUP_LOADED = WM_APP + $B04;
|
||||
CEF_EXT_POPUP_ERROR = WM_APP + $B05;
|
||||
CEF_EXT_CHECK_EXTENSION = WM_APP + $B06;
|
||||
|
||||
DESTROY_MAIN_WINDOWPARENT = 1;
|
||||
DESTROY_EXT_WINDOWPARENT = 2;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
AddressPnl: TPanel;
|
||||
AddressEdt: TEdit;
|
||||
GoBtn: TButton;
|
||||
Timer1: TTimer;
|
||||
Chromium1: TChromium;
|
||||
CEFWindowParent1: TCEFWindowParent;
|
||||
ExtensionChr: TChromium;
|
||||
ExtensionPnl: TPanel;
|
||||
ExtensionMem: TMemo;
|
||||
Panel1: TPanel;
|
||||
LoadExtensionBtn: TButton;
|
||||
UnloadExtensionBtn: TButton;
|
||||
CEFWindowParent2: TCEFWindowParent;
|
||||
LoadPopupPageBtn: TButton;
|
||||
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
|
||||
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium1BeforePopup(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, Result: Boolean);
|
||||
procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||
|
||||
procedure ExtensionChrExtensionLoaded(Sender: TObject; const extension: ICefExtension);
|
||||
procedure ExtensionChrExtensionLoadFailed(Sender: TObject; result: TCefErrorCode);
|
||||
procedure ExtensionChrExtensionUnloaded(Sender: TObject; const extension: ICefExtension);
|
||||
procedure ExtensionChrLoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
||||
procedure ExtensionChrLoadError(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring);
|
||||
procedure ExtensionChrClose(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
|
||||
procedure ExtensionChrBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure ExtensionChrExtensionGetActiveBrowser(Sender: TObject; const extension: ICefExtension; const browser: ICefBrowser; include_incognito: Boolean; var aRsltBrowser: ICefBrowser);
|
||||
|
||||
procedure GoBtnClick(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
procedure LoadExtensionBtnClick(Sender: TObject);
|
||||
procedure UnloadExtensionBtnClick(Sender: TObject);
|
||||
procedure LoadPopupPageBtnClick(Sender: TObject);
|
||||
|
||||
protected
|
||||
FCanClose : boolean;
|
||||
FClosing : boolean;
|
||||
FExtension : ICefExtension;
|
||||
|
||||
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
|
||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||
|
||||
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||
procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
|
||||
procedure ExtensionLoadedMsg(var aMessage : TMessage); message CEF_EXT_LOADED;
|
||||
procedure ExtensionUnloadedMsg(var aMessage : TMessage); message CEF_EXT_UNLOADED;
|
||||
procedure ExtensionErrorMsg(var aMessage : TMessage); message CEF_EXT_ERROR;
|
||||
procedure ExtensionPopupLoadedMsg(var aMessage : TMessage); message CEF_EXT_POPUP_LOADED;
|
||||
procedure ExtensionPopupErrorMsg(var aMessage : TMessage); message CEF_EXT_POPUP_ERROR;
|
||||
procedure CheckExtensionMsg(var aMessage : TMessage); message CEF_EXT_CHECK_EXTENSION;
|
||||
|
||||
procedure UpdateButtons;
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uCEFApplication, uCefMiscFunctions, uCEFJson;
|
||||
|
||||
// This demo shows how to load an extension that modifies the background color
|
||||
// of the active browser.
|
||||
|
||||
// This demo only allows to load the extension once.
|
||||
|
||||
// The extension loaded is called "Set Page Color" and it's located in the
|
||||
// CEF4Delphi\bin\set_page_color directory. It only has a browser action popup
|
||||
// html that allows you to select the page background color.
|
||||
|
||||
// It's necessary to unload the extension before you close the form. Notice that
|
||||
// both TChromium components must be properly destroyed before allowing the form
|
||||
// to close.
|
||||
|
||||
// Load chrome://extensions-support/ to get a list of supported APIs
|
||||
|
||||
// Destruction steps
|
||||
// =================
|
||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser in both
|
||||
// browsers which triggers the TChromium.OnClose event.
|
||||
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy
|
||||
// CEFWindowParent1 and CEFWindowParent2 in the main thread, which triggers
|
||||
// the TChromium.OnBeforeClose event.
|
||||
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
begin
|
||||
GlobalCEFApp := TCefApplication.Create;
|
||||
GlobalCEFApp.LogFile := 'debug.log';
|
||||
GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
if (FExtension <> nil) and FExtension.IsLoaded then
|
||||
begin
|
||||
CanClose := False;
|
||||
showmessage('Unload the extension before closing this demo');
|
||||
exit;
|
||||
end
|
||||
else
|
||||
FExtension := nil;
|
||||
|
||||
CanClose := FCanClose and
|
||||
(CEFWindowParent1 = nil) and
|
||||
((CEFWindowParent2 = nil) or not(ExtensionChr.Initialized));
|
||||
|
||||
if not(FClosing) then
|
||||
begin
|
||||
FClosing := True;
|
||||
Visible := False;
|
||||
Chromium1.CloseBrowser(True);
|
||||
ExtensionChr.CloseBrowser(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FCanClose := False;
|
||||
FClosing := False;
|
||||
FExtension := nil;
|
||||
Chromium1.DefaultURL := AddressEdt.Text;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FExtension := nil;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormShow(Sender: TObject);
|
||||
begin
|
||||
if not(Chromium1.CreateBrowser(CEFWindowParent1)) then
|
||||
Timer1.Enabled := True;
|
||||
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1BeforePopup(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, Result: Boolean);
|
||||
begin
|
||||
// For simplicity, this demo blocks all popup windows and new tabs
|
||||
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1Close(Sender: TObject;
|
||||
const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
begin
|
||||
PostMessage(Handle, CEF_DESTROY, DESTROY_MAIN_WINDOWPARENT, 0);
|
||||
aAction := cbaDelay;
|
||||
end;
|
||||
|
||||
procedure TForm1.Chromium1OpenUrlFromTab(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame;
|
||||
const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition;
|
||||
userGesture: Boolean; out Result: Boolean);
|
||||
begin
|
||||
// For simplicity, this demo blocks all popup windows and new tabs
|
||||
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrBeforeClose(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
if FClosing then
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end
|
||||
else
|
||||
PostMessage(Handle, CEF_EXT_CHECK_EXTENSION, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrClose(Sender: TObject; const browser: ICefBrowser;
|
||||
var aAction: TCefCloseBrowserAction);
|
||||
begin
|
||||
PostMessage(Handle, CEF_DESTROY, DESTROY_EXT_WINDOWPARENT, 0);
|
||||
aAction := cbaDelay;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionGetActiveBrowser(Sender: TObject;
|
||||
const extension: ICefExtension; const browser: ICefBrowser;
|
||||
include_incognito: Boolean; var aRsltBrowser: ICefBrowser);
|
||||
begin
|
||||
if (Chromium1 <> nil) and Chromium1.Initialized then
|
||||
aRsltBrowser := Chromium1.Browser;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionLoaded(Sender: TObject; const extension: ICefExtension);
|
||||
begin
|
||||
FExtension := extension;
|
||||
|
||||
PostMessage(Handle, CEF_EXT_LOADED, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionLoadFailed(Sender: TObject; result: TCefErrorCode);
|
||||
begin
|
||||
PostMessage(Handle, CEF_EXT_ERROR, 0, result);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrExtensionUnloaded(Sender: TObject; const extension: ICefExtension);
|
||||
begin
|
||||
if (extension <> nil) and (FExtension <> nil) and extension.IsSame(FExtension) then
|
||||
begin
|
||||
FExtension := nil;
|
||||
PostMessage(Handle, CEF_EXT_UNLOADED, 0, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrLoadEnd(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
||||
begin
|
||||
PostMessage(Handle, CEF_EXT_POPUP_LOADED, 0, 0);
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionChrLoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode;
|
||||
const errorText, failedUrl: ustring);
|
||||
begin
|
||||
PostMessage(Handle, CEF_EXT_POPUP_ERROR, 0, errorCode);
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
Caption := 'Set Page Color Extension Demo';
|
||||
AddressPnl.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.BrowserDestroyMsg(var aMessage : TMessage);
|
||||
begin
|
||||
case aMessage.WParam of
|
||||
DESTROY_MAIN_WINDOWPARENT : FreeAndNil(CEFWindowParent1);
|
||||
DESTROY_EXT_WINDOWPARENT : FreeAndNil(CEFWindowParent2);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.GoBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.LoadURL(AddressEdt.Text);
|
||||
end;
|
||||
|
||||
procedure TForm1.UpdateButtons;
|
||||
begin
|
||||
// This demo only allows to load the extension once.
|
||||
|
||||
if ExtensionChr.Initialized then
|
||||
begin
|
||||
LoadExtensionBtn.Enabled := False;
|
||||
UnloadExtensionBtn.Enabled := (FExtension <> nil);
|
||||
LoadPopupPageBtn.Enabled := False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
LoadExtensionBtn.Enabled := (FExtension = nil) and (CEFWindowParent2 <> nil);
|
||||
UnloadExtensionBtn.Enabled := (FExtension <> nil);
|
||||
LoadPopupPageBtn.Enabled := (FExtension <> nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionLoadedMsg(var aMessage : TMessage);
|
||||
var
|
||||
TempManifest : TStringList;
|
||||
begin
|
||||
if (FExtension = nil) then exit;
|
||||
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension loaded successfully!');
|
||||
ExtensionMem.Lines.Add('Identifier: ' + FExtension.Identifier);
|
||||
ExtensionMem.Lines.Add('Path: ' + FExtension.Path);
|
||||
ExtensionMem.Lines.Add('IsLoaded: ' + BoolToStr(FExtension.IsLoaded, True));
|
||||
ExtensionMem.Lines.Add('Popup: ' + FExtension.BrowserActionPopup);
|
||||
ExtensionMem.Lines.Add('Icon: ' + FExtension.BrowserActionIcon);
|
||||
ExtensionMem.Lines.Add('URL: ' + FExtension.URL);
|
||||
|
||||
TempManifest := TStringList.Create;
|
||||
|
||||
if TCEFJson.Write(FExtension.Manifest, TempManifest) then
|
||||
begin
|
||||
ExtensionMem.Lines.Add('Manifest: ' + FExtension.Path);
|
||||
ExtensionMem.Lines.AddStrings(TempManifest);
|
||||
end;
|
||||
|
||||
TempManifest.Free;
|
||||
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionUnloadedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension unloaded successfully!');
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionErrorMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension load failed. Result : ' + inttostr(aMessage.LParam));
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionPopupLoadedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension PopUp page loaded successfully!');
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.ExtensionPopupErrorMsg(var aMessage : TMessage);
|
||||
begin
|
||||
ExtensionMem.Lines.Add('--------------------------------');
|
||||
ExtensionMem.Lines.Add('Extension PopUp page load failed. Error code : ' + inttostr(aMessage.LParam));
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TForm1.CheckExtensionMsg(var aMessage : TMessage);
|
||||
begin
|
||||
if (FExtension <> nil) and not(FExtension.IsLoaded) then
|
||||
begin
|
||||
FExtension := nil;
|
||||
UpdateButtons;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadExtensionBtnClick(Sender: TObject);
|
||||
var
|
||||
TempExtensionDirectoryPath : ustring;
|
||||
begin
|
||||
if (FExtension = nil) then
|
||||
begin
|
||||
TempExtensionDirectoryPath := GetModulePath + 'set_page_color';
|
||||
ExtensionChr.LoadExtension(TempExtensionDirectoryPath);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadPopupPageBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (FExtension = nil) or ExtensionChr.Initialized then exit;
|
||||
|
||||
ExtensionChr.DefaultURL := FExtension.URL + FExtension.BrowserActionPopup;
|
||||
ExtensionChr.CreateBrowser(CEFWindowParent2);
|
||||
end;
|
||||
|
||||
procedure TForm1.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
Timer1.Enabled := False;
|
||||
if not(Chromium1.CreateBrowser(CEFWindowParent1)) and not(Chromium1.Initialized) then
|
||||
Timer1.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.UnloadExtensionBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (FExtension <> nil) and FExtension.IsLoaded then
|
||||
FExtension.Unload
|
||||
else
|
||||
begin
|
||||
FExtension := nil;
|
||||
UpdateButtons;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMMove(var aMessage : TWMMove);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMMoving(var aMessage : TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (Chromium1 <> nil) then Chromium1.NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMEnterMenuLoop(var aMessage: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then
|
||||
GlobalCEFApp.OsmodalLoop := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.WMExitMenuLoop(var aMessage: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then
|
||||
GlobalCEFApp.OsmodalLoop := False;
|
||||
end;
|
||||
|
||||
end.
|
@ -235,7 +235,8 @@ contains
|
||||
uCEFPreferenceManager in '..\source\uCEFPreferenceManager.pas',
|
||||
uCEFApplicationEvents in '..\source\uCEFApplicationEvents.pas',
|
||||
uCEFBrowserBitmap in '..\source\uCEFBrowserBitmap.pas',
|
||||
uCEFComponentIdList in '..\source\uCEFComponentIdList.pas';
|
||||
uCEFComponentIdList in '..\source\uCEFComponentIdList.pas',
|
||||
uCEFUnresponsiveProcessCallback in '..\source\uCEFUnresponsiveProcessCallback.pas';
|
||||
|
||||
end.
|
||||
|
||||
|
@ -235,7 +235,8 @@ contains
|
||||
uCEFPreferenceManager in '..\source\uCEFPreferenceManager.pas',
|
||||
uCEFApplicationEvents in '..\source\uCEFApplicationEvents.pas',
|
||||
uCEFBrowserBitmap in '..\source\uCEFBrowserBitmap.pas',
|
||||
uCEFComponentIdList in '..\source\uCEFComponentIdList.pas';
|
||||
uCEFComponentIdList in '..\source\uCEFComponentIdList.pas',
|
||||
uCEFUnresponsiveProcessCallback in '..\source\uCEFUnresponsiveProcessCallback.pas';
|
||||
|
||||
end.
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
</CompilerOptions>
|
||||
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
|
||||
<License Value="MPL 1.1"/>
|
||||
<Version Major="123" Release="13"/>
|
||||
<Version Major="124" Minor="3" Release="1"/>
|
||||
<Files Count="215">
|
||||
<Item1>
|
||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||
|
@ -160,6 +160,7 @@ type
|
||||
FRemoteAllowOrigins : ustring;
|
||||
FAutoAcceptCamAndMicCapture : boolean;
|
||||
FUIColorMode : TCefUIColorMode;
|
||||
FDisableHangMonitor : boolean;
|
||||
|
||||
|
||||
// Fields used during the CEF initialization
|
||||
@ -263,6 +264,7 @@ type
|
||||
function GetApiHashUniversal : ustring;
|
||||
function GetApiHashPlatform : ustring;
|
||||
function GetApiHashCommit : ustring;
|
||||
function GetExitCode : TCefResultCode;
|
||||
{$IFDEF LINUX}
|
||||
function GetXDisplay : PXDisplay;
|
||||
function GetArgc : longint;
|
||||
@ -1232,6 +1234,13 @@ type
|
||||
/// </remarks>
|
||||
property UIColorMode : TCefUIColorMode read FUIColorMode write FUIColorMode;
|
||||
/// <summary>
|
||||
/// Suppresses hang monitor dialogs in renderer processes. This may allow slow unload handlers on a page to prevent the tab from closing, but the Task Manager can be used to terminate the offending process in this case.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://peter.sh/experiments/chromium-command-line-switches/">Uses the following command line switch: --disable-hang-monitor</see></para>
|
||||
/// </remarks>
|
||||
property DisableHangMonitor : boolean read FDisableHangMonitor write FDisableHangMonitor;
|
||||
/// <summary>
|
||||
/// Ignores certificate-related errors.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@ -1409,6 +1418,16 @@ type
|
||||
/// </summary>
|
||||
property ApiHashCommit : ustring read GetApiHashCommit;
|
||||
/// <summary>
|
||||
/// This property can optionally be read on the main application thread after
|
||||
/// CefInitialize to retrieve the initialization exit code. When CefInitialize
|
||||
/// returns true (1) the exit code will be 0 (CEF_RESULT_CODE_NORMAL_EXIT).
|
||||
/// Otherwise, see TCefResultCode for possible exit code values including
|
||||
/// browser process initialization errors and normal early exit conditions (such
|
||||
/// as CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED for process singleton
|
||||
/// relaunch behavior).
|
||||
/// </summary>
|
||||
property ExitCode : TCefResultCode read GetExitCode;
|
||||
/// <summary>
|
||||
/// Last error message that is usually shown when CEF finds a problem at initialization.
|
||||
/// </summary>
|
||||
property LastErrorMessage : ustring read FLastErrorMessage;
|
||||
@ -1886,6 +1905,7 @@ begin
|
||||
FRemoteAllowOrigins := '';
|
||||
FAutoAcceptCamAndMicCapture := False;
|
||||
FUIColorMode := uicmSystemDefault;
|
||||
FDisableHangMonitor := False;
|
||||
|
||||
// Fields used during the CEF initialization
|
||||
FWindowsSandboxInfo := nil;
|
||||
@ -3361,6 +3381,9 @@ begin
|
||||
uicmForceLight : ReplaceSwitch(aKeys, aValues, '--force-light-mode');
|
||||
end;
|
||||
|
||||
if FDisableHangMonitor then
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-hang-monitor');
|
||||
|
||||
if FNetLogEnabled then
|
||||
begin
|
||||
ReplaceSwitch(aKeys, aValues, '--log-net-log', FNetLogFile);
|
||||
@ -3658,6 +3681,14 @@ begin
|
||||
Result := ustring(AnsiString(TempHash));
|
||||
end;
|
||||
|
||||
function TCefApplicationCore.GetExitCode : TCefResultCode;
|
||||
begin
|
||||
if FLibLoaded then
|
||||
Result := cef_get_exit_code()
|
||||
else
|
||||
Result := CEF_RESULT_CODE_NORMAL_EXIT;
|
||||
end;
|
||||
|
||||
{$IFDEF LINUX}
|
||||
function TCefApplicationCore.GetXDisplay : PXDisplay;
|
||||
begin
|
||||
@ -3823,6 +3854,7 @@ end;
|
||||
function TCefApplicationCore.Load_cef_app_capi_h : boolean;
|
||||
begin
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_initialize{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_initialize');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_get_exit_code{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_get_exit_code');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_shutdown{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_shutdown');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_execute_process{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_execute_process');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_do_message_loop_work{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_do_message_loop_work');
|
||||
@ -3830,6 +3862,7 @@ begin
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_quit_message_loop{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_quit_message_loop');
|
||||
|
||||
Result := assigned(cef_initialize) and
|
||||
assigned(cef_get_exit_code) and
|
||||
assigned(cef_shutdown) and
|
||||
assigned(cef_execute_process) and
|
||||
assigned(cef_do_message_loop_work) and
|
||||
|
@ -120,6 +120,7 @@ type
|
||||
procedure ExitFullscreen(will_cause_resize: boolean);
|
||||
function CanExecuteChromeCommand(command_id: integer): boolean;
|
||||
procedure ExecuteChromeCommand(command_id: integer; disposition: TCefWindowOpenDisposition);
|
||||
function IsRenderProcessUnresponsive : boolean;
|
||||
|
||||
public
|
||||
class function UnWrap(data: Pointer): ICefBrowserHost;
|
||||
@ -373,6 +374,11 @@ begin
|
||||
PCefBrowserHost(FData)^.execute_chrome_command(PCefBrowserHost(FData), command_id, disposition);
|
||||
end;
|
||||
|
||||
function TCefBrowserHostRef.IsRenderProcessUnresponsive : boolean;
|
||||
begin
|
||||
Result := PCefBrowserHost(FData)^.is_render_process_unresponsive(PCefBrowserHost(FData)) <> 0;
|
||||
end;
|
||||
|
||||
procedure TCefBrowserHostRef.DragTargetDragEnter(const dragData: ICefDragData; const event: PCefMouseEvent; allowedOps: TCefDragOperations);
|
||||
begin
|
||||
PCefBrowserHost(FData)^.drag_target_drag_enter(PCefBrowserHost(FData), CefGetData(dragData), event, allowedOps);
|
||||
|
@ -126,6 +126,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
// ICefBrowserViewDelegate
|
||||
procedure OnBrowserCreated(const browser_view: ICefBrowserView; const browser: ICefBrowser); override;
|
||||
@ -527,6 +528,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomBrowserViewDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefBrowserViewDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomBrowserViewDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomBrowserViewDelegate.OnBrowserCreated(const browser_view: ICefBrowserView; const browser: ICefBrowser);
|
||||
begin
|
||||
try
|
||||
|
@ -77,6 +77,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
// ICefButtonDelegate
|
||||
procedure OnButtonPressed(const button: ICefButton); override;
|
||||
@ -301,6 +302,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomButtonDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefButtonDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomButtonDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomButtonDelegate.OnButtonPressed(const button: ICefButton);
|
||||
begin
|
||||
try
|
||||
|
@ -197,6 +197,8 @@ type
|
||||
FOnCertificateError : TOnCertificateError;
|
||||
FOnSelectClientCertificate : TOnSelectClientCertificate;
|
||||
FOnRenderViewReady : TOnRenderViewReady;
|
||||
FOnRenderProcessUnresponsive : TOnRenderProcessUnresponsive;
|
||||
FOnRenderProcessResponsive : TOnRenderProcessResponsive;
|
||||
FOnRenderProcessTerminated : TOnRenderProcessTerminated;
|
||||
FOnGetResourceRequestHandler_ReqHdlr : TOnGetResourceRequestHandler;
|
||||
FOnDocumentAvailableInMainFrame : TOnDocumentAvailableInMainFrame;
|
||||
@ -362,8 +364,12 @@ type
|
||||
function GetFrameCount : NativeUInt;
|
||||
function GetRequestContextCache : ustring;
|
||||
function GetRequestContextIsGlobal : boolean;
|
||||
function GetChromeColorSchemeMode: TCefColorVariant;
|
||||
function GetChromeColorSchemeColor: TCefColor;
|
||||
function GetChromeColorSchemeVariant: TCefColorVariant;
|
||||
function GetAudioMuted : boolean;
|
||||
function GetFullscreen : boolean;
|
||||
function GetIsRenderProcessUnresponsive : boolean;
|
||||
function GetParentFormHandle : TCefWindowHandle; virtual;
|
||||
function GetRequestContext : ICefRequestContext;
|
||||
function GetMediaRouter : ICefMediaRouter;
|
||||
@ -561,7 +567,9 @@ type
|
||||
function doOnCertificateError(const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback): Boolean; virtual;
|
||||
function doOnSelectClientCertificate(const browser: ICefBrowser; isProxy: boolean; const host: ustring; port: integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback): boolean; virtual;
|
||||
procedure doOnRenderViewReady(const browser: ICefBrowser); virtual;
|
||||
procedure doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); virtual;
|
||||
function doOnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean; virtual;
|
||||
procedure doOnRenderProcessResponsive(const browser: ICefBrowser); virtual;
|
||||
procedure doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring); virtual;
|
||||
procedure doOnDocumentAvailableInMainFrame(const browser: ICefBrowser); virtual;
|
||||
|
||||
// ICefResourceRequestHandler
|
||||
@ -589,7 +597,7 @@ type
|
||||
procedure doOnPopupShow(const browser: ICefBrowser; show: Boolean); virtual;
|
||||
procedure doOnPopupSize(const browser: ICefBrowser; const rect: PCefRect); virtual;
|
||||
procedure doOnPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); virtual;
|
||||
procedure doOnAcceleratedPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer); virtual;
|
||||
procedure doOnAcceleratedPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo); virtual;
|
||||
procedure doGetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize); virtual;
|
||||
procedure doOnTouchHandleStateChanged(const browser: ICefBrowser; const state: TCefTouchHandleState); virtual;
|
||||
function doOnStartDragging(const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer): Boolean; virtual;
|
||||
@ -697,6 +705,7 @@ type
|
||||
procedure doSetAudioMuted(aValue : boolean); virtual;
|
||||
procedure doToggleAudioMuted; virtual;
|
||||
procedure doEnableFocus; virtual;
|
||||
|
||||
function MustCreateAudioHandler : boolean; virtual;
|
||||
function MustCreateCommandHandler : boolean; virtual;
|
||||
function MustCreateDevToolsMessageObserver : boolean; virtual;
|
||||
@ -1680,6 +1689,14 @@ type
|
||||
/// </summary>
|
||||
procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
|
||||
/// <summary>
|
||||
/// Sets the Chrome color scheme for all browsers that share this request
|
||||
/// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
|
||||
/// color mode (e.g. light vs dark). Other |variant| values determine how
|
||||
/// |user_color| will be applied in the current color mode. If |user_color| is
|
||||
/// transparent (0) the default color will be used.
|
||||
/// </summary>
|
||||
procedure SetChromeColorScheme(variant: TCefColorVariant; user_color: TCefColor);
|
||||
/// <summary>
|
||||
/// First URL loaded by the browser after its creation.
|
||||
/// </summary>
|
||||
property DefaultUrl : ustring read FDefaultUrl write SetDefaultUrl;
|
||||
@ -1848,6 +1865,21 @@ type
|
||||
/// </summary>
|
||||
property RequestContextIsGlobal : boolean read GetRequestContextIsGlobal;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
|
||||
/// be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
property ChromeColorSchemeMode : TCefColorVariant read GetChromeColorSchemeMode;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme color, or transparent (0) for the
|
||||
/// default color. Must be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
property ChromeColorSchemeColor : TCefColor read GetChromeColorSchemeColor;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme variant. Must be called on the
|
||||
/// browser process UI thread.
|
||||
/// </summary>
|
||||
property ChromeColorSchemeVariant : TCefColorVariant read GetChromeColorSchemeVariant;
|
||||
/// <summary>
|
||||
/// Returns the URL of the main frame.
|
||||
/// </summary>
|
||||
property DocumentURL : ustring read GetDocumentURL;
|
||||
@ -1953,6 +1985,17 @@ type
|
||||
/// </summary>
|
||||
property Fullscreen : boolean read GetFullscreen;
|
||||
/// <summary>
|
||||
/// Returns true (1) if the render process associated with this browser is
|
||||
/// currently unresponsive as indicated by a lack of input event processing
|
||||
/// for at least 15 seconds. To receive associated state change notifications
|
||||
/// and optionally handle an unresponsive render process implement
|
||||
/// ICefRequestHandler.OnRenderProcessUnresponsive.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This property can only be read on the CEF UI thread.</para>
|
||||
/// </remarks>
|
||||
property IsRenderProcessUnresponsive : boolean read GetIsRenderProcessUnresponsive;
|
||||
/// <summary>
|
||||
/// Forces the Google safesearch in the browser preferences.
|
||||
/// </summary>
|
||||
property SafeSearch : boolean read FSafeSearch write SetSafeSearch;
|
||||
@ -2841,8 +2884,46 @@ type
|
||||
/// </remarks>
|
||||
property OnRenderViewReady : TOnRenderViewReady read FOnRenderViewReady write FOnRenderViewReady;
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the render process is
|
||||
/// unresponsive as indicated by a lack of input event processing for at least
|
||||
/// 15 seconds. Return false (0) for the default behavior which is an
|
||||
/// indefinite wait with the Alloy runtime or display of the "Page
|
||||
/// unresponsive" dialog with the Chrome runtime. Return true (1) and don't
|
||||
/// execute the callback for an indefinite wait without display of the Chrome
|
||||
/// runtime dialog. Return true (1) and call
|
||||
/// ICefUnresponsiveProcessCallback.Wait either in this function or at a
|
||||
/// later time to reset the wait timer, potentially triggering another call to
|
||||
/// this function if the process remains unresponsive. Return true (1) and
|
||||
/// call ICefUnresponsiveProcessCallback.Terminate either in this
|
||||
/// function or at a later time to terminate the unresponsive process,
|
||||
/// resulting in a call to OnRenderProcessTerminated.
|
||||
/// OnRenderProcessResponsive will be called if the process becomes responsive
|
||||
/// after this function is called. This functionality depends on the hang
|
||||
/// monitor which can be disabled by passing the `--disable-hang-monitor`
|
||||
/// command-line flag or setting GlobalCEFApp.DisableHangMonitor to True.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This event will be called on the browser process CEF UI thread.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_handler_capi.h">CEF source file: /include/capi/cef_request_handler_capi.h (cef_request_handler_t)</see></para>
|
||||
/// </remarks>
|
||||
property OnRenderProcessUnresponsive : TOnRenderProcessUnresponsive read FOnRenderProcessUnresponsive write FOnRenderProcessUnresponsive;
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the render process becomes
|
||||
/// responsive after previously being unresponsive. See documentation on
|
||||
/// OnRenderProcessUnresponsive.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This event will be called on the browser process CEF UI thread.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_handler_capi.h">CEF source file: /include/capi/cef_request_handler_capi.h (cef_request_handler_t)</see></para>
|
||||
/// </remarks>
|
||||
property OnRenderProcessResponsive : TOnRenderProcessResponsive read FOnRenderProcessResponsive write FOnRenderProcessResponsive;
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the render process terminates
|
||||
/// unexpectedly. |status| indicates how the process terminated.
|
||||
/// unexpectedly. |status| indicates how the process terminated. |error_code|
|
||||
/// and |error_string| represent the error that would be displayed in Chrome's
|
||||
/// "Aw, Snap!" view. Possible |error_code| values include TCefResultCode
|
||||
/// non-normal exit values and platform-specific crash values (for example, a
|
||||
/// Posix signal or Windows hardware exception).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This event will be called on the browser process CEF UI thread.</para>
|
||||
@ -3120,13 +3201,21 @@ type
|
||||
/// </remarks>
|
||||
property OnPaint : TOnPaint read FOnPaint write FOnPaint;
|
||||
/// <summary>
|
||||
/// Called when an element has been rendered to the shared texture handle.
|
||||
/// <para>Called when an element has been rendered to the shared texture handle.
|
||||
/// |type| indicates whether the element is the view or the popup widget.
|
||||
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
|
||||
/// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
|
||||
/// can be accessed via ID3D11Device using the OpenSharedResource function.
|
||||
/// This function is only called when TCefWindowInfo.shared_texture_enabled
|
||||
/// is set to true (1), and is currently only supported on Windows.
|
||||
/// to be repainted. |info| contains the shared handle; on Windows it is a
|
||||
/// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
|
||||
/// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
|
||||
/// and on Linux it contains several planes, each with an fd to the underlying
|
||||
/// system native buffer.</para>
|
||||
/// <para>The underlying implementation uses a pool to deliver frames. As a result,
|
||||
/// the handle may differ every frame depending on how many frames are in-
|
||||
/// progress. The handle's resource cannot be cached and cannot be accessed
|
||||
/// outside of this callback. It should be reopened each time this callback is
|
||||
/// executed and the contents should be copied to a texture owned by the
|
||||
/// client application. The contents of |info| will be released back to the
|
||||
/// pool after this callback returns.</para>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This event will be called on the browser process CEF UI thread.</para>
|
||||
@ -4495,6 +4584,8 @@ begin
|
||||
FOnCertificateError := nil;
|
||||
FOnSelectClientCertificate := nil;
|
||||
FOnRenderViewReady := nil;
|
||||
FOnRenderProcessUnresponsive := nil;
|
||||
FOnRenderProcessResponsive := nil;
|
||||
FOnRenderProcessTerminated := nil;
|
||||
FOnGetResourceRequestHandler_ReqHdlr := nil;
|
||||
FOnDocumentAvailableInMainFrame := nil;
|
||||
@ -5508,6 +5599,30 @@ begin
|
||||
Result := Initialized and Browser.host.RequestContext.IsGlobal;
|
||||
end;
|
||||
|
||||
function TChromiumCore.GetChromeColorSchemeMode: TCefColorVariant;
|
||||
begin
|
||||
if Initialized then
|
||||
Result := Browser.host.RequestContext.ChromeColorSchemeMode
|
||||
else
|
||||
Result := CEF_COLOR_VARIANT_SYSTEM;
|
||||
end;
|
||||
|
||||
function TChromiumCore.GetChromeColorSchemeColor: TCefColor;
|
||||
begin
|
||||
if Initialized then
|
||||
Result := Browser.host.RequestContext.ChromeColorSchemeColor
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TChromiumCore.GetChromeColorSchemeVariant: TCefColorVariant;
|
||||
begin
|
||||
if Initialized then
|
||||
Result := Browser.host.RequestContext.ChromeColorSchemeVariant
|
||||
else
|
||||
Result := CEF_COLOR_VARIANT_SYSTEM;
|
||||
end;
|
||||
|
||||
function TChromiumCore.GetAudioMuted : boolean;
|
||||
begin
|
||||
Result := Initialized and Browser.host.IsAudioMuted;
|
||||
@ -5518,6 +5633,11 @@ begin
|
||||
Result := Initialized and Browser.host.IsFullscreen;
|
||||
end;
|
||||
|
||||
function TChromiumCore.GetIsRenderProcessUnresponsive : boolean;
|
||||
begin
|
||||
Result := Initialized and Browser.host.IsRenderProcessUnresponsive;
|
||||
end;
|
||||
|
||||
function TChromiumCore.GetParentFormHandle : TCefWindowHandle;
|
||||
begin
|
||||
InitializeWindowHandle(Result);
|
||||
@ -8980,10 +9100,10 @@ procedure TChromiumCore.doOnAcceleratedPaint(const browser : ICefBrowser
|
||||
type_ : TCefPaintElementType;
|
||||
dirtyRectsCount : NativeUInt;
|
||||
const dirtyRects : PCefRectArray;
|
||||
shared_handle : Pointer);
|
||||
const info : PCefAcceleratedPaintInfo);
|
||||
begin
|
||||
if assigned(FOnAcceleratedPaint) then
|
||||
FOnAcceleratedPaint(Self, browser, type_, dirtyRectsCount, dirtyRects, shared_handle);
|
||||
FOnAcceleratedPaint(Self, browser, type_, dirtyRectsCount, dirtyRects, info);
|
||||
end;
|
||||
|
||||
procedure TChromiumCore.doGetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize);
|
||||
@ -9055,10 +9175,10 @@ begin
|
||||
FOnProtocolExecution(Self, browser, frame, request, allowOsExecution);
|
||||
end;
|
||||
|
||||
procedure TChromiumCore.doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
procedure TChromiumCore.doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring);
|
||||
begin
|
||||
if assigned(FOnRenderProcessTerminated) then
|
||||
FOnRenderProcessTerminated(Self, browser, status);
|
||||
FOnRenderProcessTerminated(Self, browser, status, error_code, error_string);
|
||||
end;
|
||||
|
||||
procedure TChromiumCore.doOnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
@ -9146,6 +9266,20 @@ begin
|
||||
FOnRenderViewReady(Self, browser);
|
||||
end;
|
||||
|
||||
function TChromiumCore.doOnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
if assigned(FOnRenderProcessUnresponsive) then
|
||||
FOnRenderProcessUnresponsive(Self, browser, callback, Result);
|
||||
end;
|
||||
|
||||
procedure TChromiumCore.doOnRenderProcessResponsive(const browser: ICefBrowser);
|
||||
begin
|
||||
if assigned(FOnRenderProcessUnresponsive) then
|
||||
FOnRenderProcessResponsive(Self, browser);
|
||||
end;
|
||||
|
||||
procedure TChromiumCore.doOnResetDialogState(const browser: ICefBrowser);
|
||||
begin
|
||||
if assigned(FOnResetDialogState) then
|
||||
@ -9842,6 +9976,19 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChromiumCore.SetChromeColorScheme(variant: TCefColorVariant; user_color: TCefColor);
|
||||
var
|
||||
TempContext : ICefRequestContext;
|
||||
begin
|
||||
if Initialized then
|
||||
begin
|
||||
TempContext := Browser.Host.RequestContext;
|
||||
|
||||
if (TempContext <> nil) then
|
||||
TempContext.SetChromeColorScheme(variant, user_color);
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
function TChromiumCore.CopyDCToBitmapStream(aSrcDC : HDC; const aSrcRect : TRect; const aStream : TStream) : boolean;
|
||||
var
|
||||
|
@ -85,7 +85,9 @@ type
|
||||
TOnCertificateError = procedure(Sender: TObject; const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback; out Result: Boolean) of object;
|
||||
TOnSelectClientCertificate = procedure(Sender: TObject; const browser: ICefBrowser; isProxy: boolean; const host: ustring; port: integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback; var aResult : boolean) of object;
|
||||
TOnRenderViewReady = procedure(Sender: Tobject; const browser: ICefBrowser) of object;
|
||||
TOnRenderProcessTerminated = procedure(Sender: TObject; const browser: ICefBrowser; status: TCefTerminationStatus) of object;
|
||||
TOnRenderProcessUnresponsive = procedure(Sender: Tobject; const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback; var aResult: boolean) of object;
|
||||
TOnRenderProcessResponsive = procedure(Sender: Tobject; const browser: ICefBrowser) of object;
|
||||
TOnRenderProcessTerminated = procedure(Sender: TObject; const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring) of object;
|
||||
TOnGetResourceRequestHandler = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean; const request_initiator: ustring; var disable_default_handling: boolean; var aExternalResourceRequestHandler : ICefResourceRequestHandler) of object;
|
||||
TOnDocumentAvailableInMainFrame = procedure(Sender: Tobject; const browser: ICefBrowser) of object;
|
||||
|
||||
@ -114,7 +116,7 @@ type
|
||||
TOnPopupShow = procedure(Sender: TObject; const browser: ICefBrowser; show: Boolean) of Object;
|
||||
TOnPopupSize = procedure(Sender: TObject; const browser: ICefBrowser; const rect: PCefRect) of Object;
|
||||
TOnPaint = procedure(Sender: TObject; const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer) of Object;
|
||||
TOnAcceleratedPaint = procedure(Sender: TObject; const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer) of Object;
|
||||
TOnAcceleratedPaint = procedure(Sender: TObject; const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo) of Object;
|
||||
TOnGetTouchHandleSize = procedure(Sender: TObject; const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize) of Object;
|
||||
TOnTouchHandleStateChanged = procedure(Sender: TObject; const browser: ICefBrowser; const state: TCefTouchHandleState) of Object;
|
||||
TOnStartDragging = procedure(Sender: TObject; const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer; out Result: Boolean) of Object;
|
||||
|
@ -2115,9 +2115,9 @@ const
|
||||
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 shl 7;
|
||||
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 shl 8;
|
||||
CEF_PERMISSION_TYPE_GEOLOCATION = 1 shl 9;
|
||||
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 shl 10;
|
||||
CEF_PERMISSION_TYPE_MIC_STREAM = 1 shl 11;
|
||||
CEF_PERMISSION_TYPE_MIDI = 1 shl 12;
|
||||
CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = 1 shl 10;
|
||||
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 shl 11;
|
||||
CEF_PERMISSION_TYPE_MIC_STREAM = 1 shl 12;
|
||||
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 shl 13;
|
||||
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 shl 14;
|
||||
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 shl 15;
|
||||
@ -2464,6 +2464,540 @@ const
|
||||
LOG_ITEMS_FLAG_TICK_COUNT = 1 shl 4;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Normal exit code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/result_codes.h">See Chromium's content::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Process was killed by user or system.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/result_codes.h">See Chromium's content::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_KILLED = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Process hung.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/result_codes.h">See Chromium's content::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_HUNG = 2;
|
||||
|
||||
/// <summary>
|
||||
/// A bad message caused the process termination.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/result_codes.h">See Chromium's content::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_KILLED_BAD_MESSAGE = 3;
|
||||
|
||||
/// <summary>
|
||||
/// The GPU process exited because initialization failed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/result_codes.h">See Chromium's content::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_GPU_DEAD_ON_ARRIVAL = 4;
|
||||
|
||||
/// <summary>
|
||||
/// First Chrome result code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_CHROME_FIRST = 5;
|
||||
|
||||
/// <summary>
|
||||
/// An invalid command line url was given.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_INVALID_CMDLINE_URL = CEF_RESULT_CODE_CHROME_FIRST;
|
||||
|
||||
/// <summary>
|
||||
/// The process is of an unknown type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_BAD_PROCESS_TYPE = 6;
|
||||
|
||||
/// <summary>
|
||||
/// A critical chrome file is missing.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_MISSING_DATA = 7;
|
||||
|
||||
/// <summary>
|
||||
/// Failed to make Chrome default browser (not used?).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SHELL_INTEGRATION_FAILED = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Machine level install exists.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS = 9;
|
||||
|
||||
/// <summary>
|
||||
/// Uninstall detected another chrome instance.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_UNINSTALL_CHROME_ALIVE = 10;
|
||||
|
||||
/// <summary>
|
||||
/// The user changed their mind.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_UNINSTALL_USER_CANCEL = 11;
|
||||
|
||||
/// <summary>
|
||||
/// Delete profile as well during uninstall.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_UNINSTALL_DELETE_PROFILE = 12;
|
||||
|
||||
/// <summary>
|
||||
/// Command line parameter is not supported.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_UNSUPPORTED_PARAM = 13;
|
||||
|
||||
/// <summary>
|
||||
/// Browser import hung and was killed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_IMPORTER_HUNG = 14;
|
||||
|
||||
/// <summary>
|
||||
/// Trying to restart the browser we crashed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_RESPAWN_FAILED = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Generic code used to communicate some
|
||||
/// simple outcome back to the process that launched us. This is used for
|
||||
/// experiments and the actual meaning depends on the experiment.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_EXP1 = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Generic code used to communicate some
|
||||
/// simple outcome back to the process that launched us. This is used for
|
||||
/// experiments and the actual meaning depends on the experiment.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_EXP2 = 17;
|
||||
|
||||
/// <summary>
|
||||
/// Generic code used to communicate some
|
||||
/// simple outcome back to the process that launched us. This is used for
|
||||
/// experiments and the actual meaning depends on the experiment.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_EXP3 = 18;
|
||||
|
||||
/// <summary>
|
||||
/// Generic code used to communicate some
|
||||
/// simple outcome back to the process that launched us. This is used for
|
||||
/// experiments and the actual meaning depends on the experiment.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_EXP4 = 19;
|
||||
|
||||
/// <summary>
|
||||
/// For experiments this return code means that the user canceled causes the
|
||||
/// did_run "dr" signal to be reset soi this chrome run does not count as
|
||||
/// active chrome usage.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_CANCEL = 20;
|
||||
|
||||
/// <summary>
|
||||
/// The profile was in use on another host.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_PROFILE_IN_USE = 21;
|
||||
|
||||
/// <summary>
|
||||
/// Failed to pack an extension via the cmd line.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_PACK_EXTENSION_ERROR = 22;
|
||||
|
||||
/// <summary>
|
||||
/// Failed to silently uninstall an extension.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_UNINSTALL_EXTENSION_ERROR = 23;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The browser process exited early by passing the command line to another
|
||||
/// running browser.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED = 24;
|
||||
|
||||
/// <summary>
|
||||
/// A dummy value we should not use. See crbug.com/152285.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NOTUSED_1 = 25;
|
||||
|
||||
/// <summary>
|
||||
/// Failed to install an item from the webstore when the
|
||||
/// kInstallEphemeralAppFromWebstore command line flag was present.
|
||||
/// As this flag is no longer supported, this return code should never be
|
||||
/// returned.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_INSTALL_FROM_WEBSTORE_ERROR_2 = 26;
|
||||
|
||||
/// <summary>
|
||||
/// A dummy value we should not use. See crbug.com/152285.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NOTUSED_2 = 27;
|
||||
|
||||
/// <summary>
|
||||
/// Returned when the user has not yet accepted the EULA.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_EULA_REFUSED = 28;
|
||||
|
||||
/// <summary>
|
||||
/// Failed to migrate user data directory for side-by-side package support
|
||||
/// (Linux-only).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SXS_MIGRATION_FAILED_NOT_USED = 29;
|
||||
|
||||
/// <summary>
|
||||
/// The action is not allowed by a policy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_ACTION_DISALLOWED_BY_POLICY = 30;
|
||||
|
||||
/// <summary>
|
||||
/// A browser process was sandboxed. This should never happen.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_INVALID_SANDBOX_STATE = 31;
|
||||
|
||||
/// <summary>
|
||||
/// Cloud policy enrollment is failed or given up by user.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED = 32;
|
||||
|
||||
/// <summary>
|
||||
/// Chrome was downgraded since the last launch. Perform downgrade processing
|
||||
/// and relaunch.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_DOWNGRADE_AND_RELAUNCH = 33;
|
||||
|
||||
/// <summary>
|
||||
/// The GPU process was terminated due to context lost.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST = 34;
|
||||
|
||||
/// <summary>
|
||||
/// Chrome detected that there was a new version waiting to launch and renamed
|
||||
/// the files and launched the new version. This result code is never returned
|
||||
/// from the main process, but is instead used as a signal for early
|
||||
/// termination of browser. See `IsNormalResultCode` below.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_UPGRADE_RELAUNCHED = 35;
|
||||
|
||||
/// <summary>
|
||||
/// An early startup command was executed and the browser must exit.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS = 36;
|
||||
|
||||
/// <summary>
|
||||
/// The browser process exited because system resource are exhausted. The
|
||||
/// system state can't be recovered and will be unstable.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SYSTEM_RESOURCE_EXHAUSTED = 37;
|
||||
|
||||
/// <summary>
|
||||
/// The Lacros process exited because the post-login parameters received
|
||||
/// from Ash are either empty or invalid (Lacros-only).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_INVALID_POST_LOGIN_PARAMS = 38;
|
||||
|
||||
/// <summary>
|
||||
/// Last Chrome result code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_CHROME_LAST = 39;
|
||||
|
||||
/// <summary>
|
||||
/// First Sandbox result code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_FIRST = 7006;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox could not set the integrity level.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_INTEGRITY = CEF_RESULT_CODE_SANDBOX_FATAL_FIRST;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox could not lower the token.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_DROPTOKEN = 7007;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox failed to flush registry handles.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_FLUSHANDLES = 7008;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox failed to forbid HCKU caching.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_CACHEDISABLE = 7009;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox failed to close pending handles.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_CLOSEHANDLES = 7010;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox could not set the mitigation policy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_MITIGATION = 7011;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox exceeded the job memory limit.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_MEMORY_EXCEEDED = 7012;
|
||||
|
||||
/// <summary>
|
||||
/// Windows sandbox failed to warmup.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_WARMUP = 7013;
|
||||
|
||||
/// <summary>
|
||||
/// Last Sandbox result code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>TCefResultCode value.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
CEF_RESULT_CODE_SANDBOX_FATAL_LAST = 7014;
|
||||
|
||||
|
||||
{*
|
||||
******************************************************
|
||||
****************** OTHER CONSTANTS *******************
|
||||
@ -2664,6 +3198,16 @@ const
|
||||
pfidLinux = pidLinux64;
|
||||
{$IFEND}
|
||||
|
||||
{$IFDEF LINUX}
|
||||
/// <summary>
|
||||
/// Maximum number of accelerated paint planes used in TCefAcceleratedPaintInfo.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (kAcceleratedPaintMaxPlanes)</see></para>
|
||||
/// </remarks>
|
||||
CEF_KACCELERATEDPAINTMAXPLANES = 4;
|
||||
{$ENDIF}
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
@ -35,7 +35,7 @@ uses
|
||||
|
||||
procedure TCefFileDialogCallbackRef.Cancel;
|
||||
begin
|
||||
PCefFileDialogCallback(FData)^.cancel(FData);
|
||||
PCefFileDialogCallback(FData)^.cancel(PCefFileDialogCallback(FData));
|
||||
end;
|
||||
|
||||
procedure TCefFileDialogCallbackRef.Cont(const filePaths: TStrings);
|
||||
|
@ -40,6 +40,7 @@ type
|
||||
ICefTask = interface;
|
||||
ICefTaskRunner = interface;
|
||||
ICefFileDialogCallback = interface;
|
||||
ICefUnresponsiveProcessCallback = interface;
|
||||
ICefPrintHandler = interface;
|
||||
ICefPrintDialogCallback = interface;
|
||||
ICefPrintJobCallback = interface;
|
||||
@ -382,7 +383,9 @@ type
|
||||
function doOnCertificateError(const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback): Boolean;
|
||||
function doOnSelectClientCertificate(const browser: ICefBrowser; isProxy: boolean; const host: ustring; port: integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback): boolean;
|
||||
procedure doOnRenderViewReady(const browser: ICefBrowser);
|
||||
procedure doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
function doOnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean;
|
||||
procedure doOnRenderProcessResponsive(const browser: ICefBrowser);
|
||||
procedure doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring);
|
||||
procedure doOnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
|
||||
// ICefResourceRequestHandler
|
||||
@ -410,7 +413,7 @@ type
|
||||
procedure doOnPopupShow(const browser: ICefBrowser; show: Boolean);
|
||||
procedure doOnPopupSize(const browser: ICefBrowser; const rect: PCefRect);
|
||||
procedure doOnPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer);
|
||||
procedure doOnAcceleratedPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer);
|
||||
procedure doOnAcceleratedPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo);
|
||||
procedure doGetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize);
|
||||
procedure doOnTouchHandleStateChanged(const browser: ICefBrowser; const state: TCefTouchHandleState);
|
||||
function doOnStartDragging(const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer): Boolean;
|
||||
@ -594,6 +597,7 @@ type
|
||||
procedure doOnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
|
||||
procedure doOnFocus(const view: ICefView);
|
||||
procedure doOnBlur(const view: ICefView);
|
||||
procedure doOnThemeChanged(const view: ICefView);
|
||||
|
||||
// Custom
|
||||
procedure doCreateCustomView;
|
||||
@ -659,6 +663,7 @@ type
|
||||
procedure doOnWindowDestroyed(const window_: ICefWindow);
|
||||
procedure doOnWindowActivationChanged(const window_: ICefWindow; active: boolean);
|
||||
procedure doOnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect);
|
||||
procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
|
||||
procedure doOnIsWindowModalDialog(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
|
||||
@ -666,13 +671,14 @@ type
|
||||
procedure doOnIsFrameless(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnWithStandardWindowButtons(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean);
|
||||
procedure doOnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
procedure doOnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnCanMaximize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnCanMinimize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnCanClose(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
|
||||
procedure doOnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
|
||||
procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure doOnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
end;
|
||||
|
||||
{*
|
||||
@ -1350,6 +1356,17 @@ type
|
||||
/// </remarks>
|
||||
procedure ExecuteChromeCommand(command_id: integer; disposition: TCefWindowOpenDisposition);
|
||||
/// <summary>
|
||||
/// Returns true (1) if the render process associated with this browser is
|
||||
/// currently unresponsive as indicated by a lack of input event processing
|
||||
/// for at least 15 seconds. To receive associated state change notifications
|
||||
/// and optionally handle an unresponsive render process implement
|
||||
/// ICefRequestHandler.OnRenderProcessUnresponsive.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This function can only be called on the CEF UI thread.</para>
|
||||
/// </remarks>
|
||||
function IsRenderProcessUnresponsive : boolean;
|
||||
/// <summary>
|
||||
/// Returns the hosted browser object.
|
||||
/// </summary>
|
||||
property Browser : ICefBrowser read GetBrowser;
|
||||
@ -6758,10 +6775,40 @@ type
|
||||
/// </summary>
|
||||
procedure OnRenderViewReady(const browser: ICefBrowser);
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the render process terminates
|
||||
/// unexpectedly. |status| indicates how the process terminated.
|
||||
/// Called on the browser process UI thread when the render process is
|
||||
/// unresponsive as indicated by a lack of input event processing for at least
|
||||
/// 15 seconds. Return false (0) for the default behavior which is an
|
||||
/// indefinite wait with the Alloy runtime or display of the "Page
|
||||
/// unresponsive" dialog with the Chrome runtime. Return true (1) and don't
|
||||
/// execute the callback for an indefinite wait without display of the Chrome
|
||||
/// runtime dialog. Return true (1) and call
|
||||
/// ICefUnresponsiveProcessCallback.Wait either in this function or at a
|
||||
/// later time to reset the wait timer, potentially triggering another call to
|
||||
/// this function if the process remains unresponsive. Return true (1) and
|
||||
/// call ICefUnresponsiveProcessCallback.Terminate either in this
|
||||
/// function or at a later time to terminate the unresponsive process,
|
||||
/// resulting in a call to OnRenderProcessTerminated.
|
||||
/// OnRenderProcessResponsive will be called if the process becomes responsive
|
||||
/// after this function is called. This functionality depends on the hang
|
||||
/// monitor which can be disabled by passing the `--disable-hang-monitor`
|
||||
/// command-line flag or setting GlobalCEFApp.DisableHangMonitor to True.
|
||||
/// </summary>
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
function OnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean;
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the render process becomes
|
||||
/// responsive after previously being unresponsive. See documentation on
|
||||
/// OnRenderProcessUnresponsive.
|
||||
/// </summary>
|
||||
procedure OnRenderProcessResponsive(const browser: ICefBrowser);
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the render process terminates
|
||||
/// unexpectedly. |status| indicates how the process terminated. |error_code|
|
||||
/// and |error_string| represent the error that would be displayed in Chrome's
|
||||
/// "Aw, Snap!" view. Possible |error_code| values include TCefResultCode
|
||||
/// non-normal exit values and platform-specific crash values (for example, a
|
||||
/// Posix signal or Windows hardware exception).
|
||||
/// </summary>
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring);
|
||||
/// <summary>
|
||||
/// Called on the browser process UI thread when the window.document object of
|
||||
/// the main frame has been created.
|
||||
@ -7403,15 +7450,23 @@ type
|
||||
/// </summary>
|
||||
procedure OnPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer);
|
||||
/// <summary>
|
||||
/// Called when an element has been rendered to the shared texture handle.
|
||||
/// <para>Called when an element has been rendered to the shared texture handle.
|
||||
/// |type| indicates whether the element is the view or the popup widget.
|
||||
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
|
||||
/// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that
|
||||
/// can be accessed via ID3D11Device using the OpenSharedResource function.
|
||||
/// This function is only called when TCefWindowInfo.shared_texture_enabled
|
||||
/// is set to true (1), and is currently only supported on Windows.
|
||||
/// to be repainted. |info| contains the shared handle; on Windows it is a
|
||||
/// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
|
||||
/// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
|
||||
/// and on Linux it contains several planes, each with an fd to the underlying
|
||||
/// system native buffer.</para>
|
||||
/// <para>The underlying implementation uses a pool to deliver frames. As a result,
|
||||
/// the handle may differ every frame depending on how many frames are in-
|
||||
/// progress. The handle's resource cannot be cached and cannot be accessed
|
||||
/// outside of this callback. It should be reopened each time this callback is
|
||||
/// executed and the contents should be copied to a texture owned by the
|
||||
/// client application. The contents of |info| will be released back to the
|
||||
/// pool after this callback returns.</para>
|
||||
/// </summary>
|
||||
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer);
|
||||
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo);
|
||||
/// <summary>
|
||||
/// Called to retrieve the size of the touch handle for the specified
|
||||
/// |orientation|.
|
||||
@ -7744,6 +7799,25 @@ type
|
||||
procedure Cancel;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
/// Callback structure for asynchronous handling of an unresponsive process.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see cref="uCEFTypes|TCefUnresponsiveProcessCallback">Implements TCefUnresponsiveProcessCallback</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_unresponsive_process_callback_capi.h">CEF source file: /include/capi/cef_unresponsive_process_callback_capi.h (cef_unresponsive_process_callback_t)</see></para>
|
||||
/// </remarks>
|
||||
ICefUnresponsiveProcessCallback = interface(ICefBaseRefCounted)
|
||||
['{3E4F2B66-5AAF-4906-B946-C114D0E43C13}']
|
||||
/// <summary>
|
||||
/// Reset the timeout for the unresponsive process.
|
||||
/// </summary>
|
||||
procedure Wait;
|
||||
/// <summary>
|
||||
/// Terminate the unresponsive process.
|
||||
/// </summary>
|
||||
procedure Terminate;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
/// Interface used to represent drag data. The functions of this interface may
|
||||
/// be called on any thread.
|
||||
@ -8273,6 +8347,29 @@ type
|
||||
/// </summary>
|
||||
procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
|
||||
/// <summary>
|
||||
/// Sets the Chrome color scheme for all browsers that share this request
|
||||
/// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
|
||||
/// color mode (e.g. light vs dark). Other |variant| values determine how
|
||||
/// |user_color| will be applied in the current color mode. If |user_color| is
|
||||
/// transparent (0) the default color will be used.
|
||||
/// </summary>
|
||||
procedure SetChromeColorScheme(variant: TCefColorVariant; user_color: TCefColor);
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
|
||||
/// be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
function GetChromeColorSchemeMode: TCefColorVariant;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme color, or transparent (0) for the
|
||||
/// default color. Must be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
function GetChromeColorSchemeColor: TCefColor;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme variant. Must be called on the
|
||||
/// browser process UI thread.
|
||||
/// </summary>
|
||||
function GetChromeColorSchemeVariant: TCefColorVariant;
|
||||
/// <summary>
|
||||
/// Returns the cache path for this object. If NULL an "incognito mode" in-
|
||||
/// memory cache is being used.
|
||||
/// </summary>
|
||||
@ -8283,6 +8380,21 @@ type
|
||||
/// context argument.
|
||||
/// </summary>
|
||||
property IsGlobalContext : boolean read IsGlobal;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
|
||||
/// be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
property ChromeColorSchemeMode : TCefColorVariant read GetChromeColorSchemeMode;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme color, or transparent (0) for the
|
||||
/// default color. Must be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
property ChromeColorSchemeColor : TCefColor read GetChromeColorSchemeColor;
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme variant. Must be called on the
|
||||
/// browser process UI thread.
|
||||
/// </summary>
|
||||
property ChromeColorSchemeVariant : TCefColorVariant read GetChromeColorSchemeVariant;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
@ -9889,14 +10001,26 @@ type
|
||||
/// </summary>
|
||||
procedure RequestFocus;
|
||||
/// <summary>
|
||||
/// Sets the background color for this View.
|
||||
/// Sets the background color for this View. The background color will be
|
||||
/// automatically reset when ICefViewDelegate.OnThemeChanged is called.
|
||||
/// </summary>
|
||||
procedure SetBackgroundColor(color: TCefColor);
|
||||
/// <summary>
|
||||
/// Returns the background color for this View.
|
||||
/// Returns the background color for this View. If the background color is
|
||||
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
|
||||
/// will be returned. If this View belongs to an overlay (created with
|
||||
/// ICefWindow.AddOverlayView), and the background color is unset, then a
|
||||
/// value of transparent (0) will be returned.
|
||||
/// </summary>
|
||||
function GetBackgroundColor : TCefColor;
|
||||
/// <summary>
|
||||
/// Returns the current theme color associated with |color_id|, or the
|
||||
/// placeholder color (red) if unset. See cef_color_ids.h for standard ID
|
||||
/// values. Standard colors can be overridden and custom colors can be added
|
||||
/// using ICefWindow.SetThemeColor.
|
||||
/// </summary>
|
||||
function GetThemeColor(color_id: integer): TCefColor;
|
||||
/// <summary>
|
||||
/// Convert |point| from this View's coordinate system to DIP screen
|
||||
/// coordinates. This View must belong to a Window when calling this function.
|
||||
/// Returns true (1) if the conversion is successful or false (0) otherwise.
|
||||
@ -10012,7 +10136,11 @@ type
|
||||
/// </summary>
|
||||
property AccessibilityFocusable : boolean read IsAccessibilityFocusable;
|
||||
/// <summary>
|
||||
/// Returns the background color for this View.
|
||||
/// Returns the background color for this View. If the background color is
|
||||
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
|
||||
/// will be returned. If this View belongs to an overlay (created with
|
||||
/// ICefWindow.AddOverlayView), and the background color is unset, then a
|
||||
/// value of transparent (0) will be returned.
|
||||
/// </summary>
|
||||
property BackgroundColor : TCefColor read GetBackgroundColor write SetBackgroundColor;
|
||||
/// <summary>
|
||||
@ -10115,6 +10243,24 @@ type
|
||||
/// Called when |view| loses focus.
|
||||
/// </summary>
|
||||
procedure OnBlur(const view: ICefView);
|
||||
/// <summary>
|
||||
/// <para>Called when the theme for |view| has changed, after the new theme colors
|
||||
/// have already been applied. Views are notified via the component hierarchy
|
||||
/// in depth-first reverse order (children before parents).</para>
|
||||
/// <para>This will be called in the following cases:</para>
|
||||
/// <code>
|
||||
/// 1. When |view|, or a parent of |view|, is added to a Window.
|
||||
/// 2. When the native/OS or Chrome theme changes for the Window that contains
|
||||
/// |view|. See ICefWindowDelegate.OnThemeColorsChanged documentation.
|
||||
/// 3. When the client explicitly calls ICefWindow.ThemeChanged on the
|
||||
/// Window that contains |view|.
|
||||
/// </code>
|
||||
/// <para>Optionally use this callback to override the new per-View theme colors by
|
||||
/// calling ICefView.SetBackgroundColor or the appropriate component-
|
||||
/// specific function. See ICefWindow.SetThemeColor documentation for how
|
||||
/// to customize additional Window theme colors.</para>
|
||||
/// <summary>
|
||||
procedure OnThemeChanged(const view: ICefView);
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
@ -11007,6 +11153,38 @@ type
|
||||
/// Remove all keyboard accelerators.
|
||||
/// </summary>
|
||||
procedure RemoveAllAccelerators;
|
||||
/// <summary>
|
||||
/// <para>Override a standard theme color or add a custom color associated with
|
||||
/// |color_id|. See cef_color_ids.h for standard ID values. Recommended usage
|
||||
/// is as follows:</para>
|
||||
/// <code>
|
||||
/// 1. Customize the default native/OS theme by calling SetThemeColor before
|
||||
/// showing the first Window. When done setting colors call
|
||||
/// ICefWindow.ThemeChanged to trigger ICefViewDelegate.OnThemeChanged
|
||||
/// notifications.
|
||||
/// 2. Customize the current native/OS or Chrome theme after it changes by
|
||||
/// calling SetThemeColor from the ICefWindowDelegate.OnThemeColorsChanged
|
||||
/// callback. ICefViewDelegate.OnThemeChanged notifications will then be
|
||||
/// triggered automatically.
|
||||
/// </code>
|
||||
/// <para>The configured color will be available immediately via
|
||||
/// ICefView.GetThemeColor and will be applied to each View in this
|
||||
/// Window's component hierarchy when ICefViewDelegate.OnThemeChanged is
|
||||
/// called. See OnThemeColorsChanged documentation for additional details.</para>
|
||||
/// <para>Clients wishing to add custom colors should use |color_id| values >=
|
||||
/// CEF_ChromeColorsEnd.</para>
|
||||
/// </summary>
|
||||
procedure SetThemeColor(color_id: integer; color: TCefColor);
|
||||
/// <summary>
|
||||
/// <para>Trigger cef_view_delegate_t::OnThemeChanged callbacks for each View in
|
||||
/// this Window's component hierarchy. Unlike a native/OS or Chrome theme
|
||||
/// change this function does not reset theme colors to standard values and
|
||||
/// does not result in a call to ICefWindowDelegate.OnThemeColorsChanged.</para>
|
||||
/// <para>Do not call this function from ICefWindowDelegate.OnThemeColorsChanged
|
||||
/// or ICefViewDelegate.OnThemeChanged.</para>
|
||||
/// </summary>
|
||||
procedure ThemeChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Get the Window title.
|
||||
/// </summary>
|
||||
@ -11131,6 +11309,16 @@ type
|
||||
/// </summary>
|
||||
procedure OnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean);
|
||||
/// <summary>
|
||||
/// <para>Return whether the view should accept the initial mouse-down event,
|
||||
/// allowing it to respond to click-through behavior. If STATE_ENABLED is
|
||||
/// returned, the view will be sent a mouseDown: message for an initial mouse-
|
||||
/// down event, activating the view with one click, instead of clicking first
|
||||
/// to make the window active and then clicking the view.</para>
|
||||
/// <para>This function is only supported on macOS. For more details, refer to the
|
||||
/// documentation of acceptsFirstMouse.</para>
|
||||
/// </summary>
|
||||
procedure OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
/// <summary>
|
||||
/// Return true (1) if |window| can be resized.
|
||||
/// </summary>
|
||||
procedure OnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
@ -11159,6 +11347,35 @@ type
|
||||
/// true (1) if the keyboard event was handled or false (0) otherwise.
|
||||
/// </summary>
|
||||
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
|
||||
/// <summary>
|
||||
/// <para>Called after the native/OS or Chrome theme for |window| has changed.
|
||||
/// |chrome_theme| will be true (1) if the notification is for a Chrome theme.</para>
|
||||
/// <para>Native/OS theme colors are configured globally and do not need to be
|
||||
/// customized for each Window individually. An example of a native/OS theme
|
||||
/// change that triggers this callback is when the user switches between dark
|
||||
/// and light mode during application lifespan. Native/OS theme changes can be
|
||||
/// disabled by passing the `--force-dark-mode` or `--force-light-mode`
|
||||
/// command-line flag.</para>
|
||||
/// <para>Chrome theme colors will be applied and this callback will be triggered
|
||||
/// if/when a BrowserView is added to the Window's component hierarchy. Chrome
|
||||
/// theme colors can be configured on a per-RequestContext basis using
|
||||
/// ICefRequestContext.SetChromeColorScheme or (Chrome runtime only) by
|
||||
/// visiting chrome://settings/manageProfile. Any theme changes using those
|
||||
/// mechanisms will also trigger this callback. Chrome theme colors will be
|
||||
/// persisted and restored from disk cache with the Chrome runtime, and with
|
||||
/// the Alloy runtime if persist_user_preferences is set to true (1) via
|
||||
/// CefSettings or ICefRequestContext Settings.</para>
|
||||
/// <para>This callback is not triggered on Window creation so clients that wish to
|
||||
/// customize the initial native/OS theme must call
|
||||
/// ICefWindow.SetThemeColor and ICefWindow.ThemeChanged before showing
|
||||
/// the first Window.</para>
|
||||
/// <para>Theme colors will be reset to standard values before this callback is
|
||||
/// called for the first affected Window. Call ICefWindow.SetThemeColor
|
||||
/// from inside this callback to override a standard color or add a custom
|
||||
/// color. ICefViewDelegate.OnThemeChanged will be called after this
|
||||
/// callback for the complete |window| component hierarchy.</para>
|
||||
/// </summary>
|
||||
procedure OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
@ -38,6 +38,7 @@ var
|
||||
|
||||
// /include/capi/cef_app_capi.h
|
||||
cef_initialize : function(const args: PCefMainArgs; const settings: PCefSettings; application: PCefApp; windows_sandbox_info: Pointer): Integer; cdecl;
|
||||
cef_get_exit_code : function : integer; cdecl;
|
||||
cef_shutdown : procedure; cdecl;
|
||||
cef_execute_process : function(const args: PCefMainArgs; application: PCefApp; windows_sandbox_info: Pointer): Integer; cdecl;
|
||||
cef_do_message_loop_work : procedure; cdecl;
|
||||
|
@ -75,6 +75,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
// ICefButtonDelegate
|
||||
procedure OnButtonPressed(const button: ICefButton); override;
|
||||
@ -282,6 +283,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomMenuButtonDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefMenuButtonDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomMenuButtonDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomMenuButtonDelegate.OnButtonPressed(const button: ICefButton);
|
||||
begin
|
||||
try
|
||||
|
@ -60,6 +60,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
public
|
||||
/// <summary>
|
||||
@ -225,5 +226,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomPanelDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefPanelDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomPanelDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -25,7 +25,7 @@ type
|
||||
procedure OnPopupShow(const browser: ICefBrowser; show: Boolean); virtual;
|
||||
procedure OnPopupSize(const browser: ICefBrowser; const rect: PCefRect); virtual;
|
||||
procedure OnPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); virtual;
|
||||
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer); virtual;
|
||||
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo); virtual;
|
||||
procedure GetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize); virtual;
|
||||
procedure OnTouchHandleStateChanged(const browser: ICefBrowser; const state: TCefTouchHandleState); virtual;
|
||||
function OnStartDragging(const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer): Boolean; virtual;
|
||||
@ -52,7 +52,7 @@ type
|
||||
procedure OnPopupShow(const browser: ICefBrowser; show: Boolean); override;
|
||||
procedure OnPopupSize(const browser: ICefBrowser; const rect: PCefRect); override;
|
||||
procedure OnPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); override;
|
||||
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer); override;
|
||||
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo); override;
|
||||
procedure GetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize); override;
|
||||
procedure OnTouchHandleStateChanged(const browser: ICefBrowser; const state: TCefTouchHandleState); override;
|
||||
function GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean; override;
|
||||
@ -215,7 +215,7 @@ procedure cef_render_handler_on_accelerated_paint( self : PCefR
|
||||
kind : TCefPaintElementType;
|
||||
dirtyRectsCount : NativeUInt;
|
||||
const dirtyRects : PCefRectArray;
|
||||
shared_handle : Pointer); stdcall;
|
||||
const info : PCefAcceleratedPaintInfo); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
@ -226,7 +226,7 @@ begin
|
||||
kind,
|
||||
dirtyRectsCount,
|
||||
dirtyRects,
|
||||
shared_handle);
|
||||
info);
|
||||
end;
|
||||
|
||||
function cef_render_handler_start_dragging(self : PCefRenderHandler;
|
||||
@ -412,7 +412,7 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefRenderHandlerOwn.OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer);
|
||||
procedure TCefRenderHandlerOwn.OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
@ -553,10 +553,10 @@ procedure TCustomRenderHandler.OnAcceleratedPaint(const browser : ICefBr
|
||||
kind : TCefPaintElementType;
|
||||
dirtyRectsCount : NativeUInt;
|
||||
const dirtyRects : PCefRectArray;
|
||||
shared_handle : Pointer);
|
||||
const info : PCefAcceleratedPaintInfo);
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnAcceleratedPaint(browser, kind, dirtyRectsCount, dirtyRects, shared_handle);
|
||||
IChromiumEvents(FEvents).doOnAcceleratedPaint(browser, kind, dirtyRectsCount, dirtyRects, info);
|
||||
end;
|
||||
|
||||
procedure TCustomRenderHandler.GetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize);
|
||||
|
@ -264,6 +264,33 @@ type
|
||||
/// </summary>
|
||||
procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the Chrome color scheme for all browsers that share this request
|
||||
/// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
|
||||
/// color mode (e.g. light vs dark). Other |variant| values determine how
|
||||
/// |user_color| will be applied in the current color mode. If |user_color| is
|
||||
/// transparent (0) the default color will be used.
|
||||
/// </summary>
|
||||
procedure SetChromeColorScheme(variant: TCefColorVariant; user_color: TCefColor);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
|
||||
/// be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
function GetChromeColorSchemeMode: TCefColorVariant;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme color, or transparent (0) for the
|
||||
/// default color. Must be called on the browser process UI thread.
|
||||
/// </summary>
|
||||
function GetChromeColorSchemeColor: TCefColor;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current Chrome color scheme variant. Must be called on the
|
||||
/// browser process UI thread.
|
||||
/// </summary>
|
||||
function GetChromeColorSchemeVariant: TCefColorVariant;
|
||||
|
||||
public
|
||||
class function UnWrap(data: Pointer): ICefRequestContext; reintroduce;
|
||||
/// <summary>
|
||||
@ -509,6 +536,26 @@ begin
|
||||
PCefRequestContext(FData)^.set_content_setting(PCefRequestContext(FData), @TempRequestingURL, @TempTopLevelURL, content_type, value);
|
||||
end;
|
||||
|
||||
procedure TCefRequestContextRef.SetChromeColorScheme(variant: TCefColorVariant; user_color: TCefColor);
|
||||
begin
|
||||
PCefRequestContext(FData)^.set_chrome_color_scheme(PCefRequestContext(FData), variant, user_color);
|
||||
end;
|
||||
|
||||
function TCefRequestContextRef.GetChromeColorSchemeMode: TCefColorVariant;
|
||||
begin
|
||||
Result := PCefRequestContext(FData)^.get_chrome_color_scheme_mode(PCefRequestContext(FData));
|
||||
end;
|
||||
|
||||
function TCefRequestContextRef.GetChromeColorSchemeColor: TCefColor;
|
||||
begin
|
||||
Result := PCefRequestContext(FData)^.get_chrome_color_scheme_color(PCefRequestContext(FData));
|
||||
end;
|
||||
|
||||
function TCefRequestContextRef.GetChromeColorSchemeVariant: TCefColorVariant;
|
||||
begin
|
||||
Result := PCefRequestContext(FData)^.get_chrome_color_scheme_variant(PCefRequestContext(FData));
|
||||
end;
|
||||
|
||||
function TCefRequestContextRef.RegisterSchemeHandlerFactory(const schemeName : ustring;
|
||||
const domainName : ustring;
|
||||
const factory : ICefSchemeHandlerFactory): Boolean;
|
||||
|
@ -24,7 +24,9 @@ type
|
||||
function OnCertificateError(const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback): Boolean; virtual;
|
||||
function OnSelectClientCertificate(const browser: ICefBrowser; isProxy: boolean; const host: ustring; port: integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback): boolean; virtual;
|
||||
procedure OnRenderViewReady(const browser: ICefBrowser); virtual;
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); virtual;
|
||||
function OnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean; virtual;
|
||||
procedure OnRenderProcessResponsive(const browser: ICefBrowser); virtual;
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring); virtual;
|
||||
procedure OnDocumentAvailableInMainFrame(const browser: ICefBrowser); virtual;
|
||||
|
||||
procedure RemoveReferences; virtual;
|
||||
@ -44,7 +46,9 @@ type
|
||||
function OnCertificateError(const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback): Boolean; override;
|
||||
function OnSelectClientCertificate(const browser: ICefBrowser; isProxy: boolean; const host: ustring; port: integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback): boolean; override;
|
||||
procedure OnRenderViewReady(const browser: ICefBrowser); override;
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); override;
|
||||
function OnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean; override;
|
||||
procedure OnRenderProcessResponsive(const browser: ICefBrowser); override;
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: ustring); override;
|
||||
procedure OnDocumentAvailableInMainFrame(const browser: ICefBrowser); override;
|
||||
|
||||
public
|
||||
@ -63,7 +67,7 @@ uses
|
||||
{$ENDIF}
|
||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame, uCEFRequest, uCEFCallback,
|
||||
uCEFResponse, uCEFAuthCallback, uCEFSslInfo, uCEFSelectClientCertificateCallback, uCEFX509Certificate,
|
||||
uCEFApplicationCore;
|
||||
uCEFApplicationCore, uCEFUnresponsiveProcessCallback;
|
||||
|
||||
function cef_request_handler_on_before_browse(self : PCefRequestHandler;
|
||||
browser : PCefBrowser;
|
||||
@ -198,9 +202,35 @@ begin
|
||||
TCefRequestHandlerOwn(TempObject).OnRenderViewReady(TCefBrowserRef.UnWrap(browser));
|
||||
end;
|
||||
|
||||
procedure cef_request_handler_on_render_process_terminated(self : PCefRequestHandler;
|
||||
function cef_request_handler_on_render_process_unresponsive(self : PCefRequestHandler;
|
||||
browser : PCefBrowser;
|
||||
status : TCefTerminationStatus); stdcall;
|
||||
callback : PCefUnresponsiveProcessCallback): integer; stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
Result := Ord(False);
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCefRequestHandlerOwn) then
|
||||
Result := Ord(TCefRequestHandlerOwn(TempObject).OnRenderProcessUnresponsive(TCefBrowserRef.UnWrap(browser),
|
||||
TCefUnresponsiveProcessCallbackRef.UnWrap(callback)));
|
||||
end;
|
||||
|
||||
procedure cef_request_handler_on_render_process_responsive(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCefRequestHandlerOwn) then
|
||||
TCefRequestHandlerOwn(TempObject).OnRenderProcessResponsive(TCefBrowserRef.UnWrap(browser));
|
||||
end;
|
||||
|
||||
procedure cef_request_handler_on_render_process_terminated( self : PCefRequestHandler;
|
||||
browser : PCefBrowser;
|
||||
status : TCefTerminationStatus;
|
||||
error_code : integer;
|
||||
const error_string : PCefString); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
@ -208,7 +238,9 @@ begin
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCefRequestHandlerOwn) then
|
||||
TCefRequestHandlerOwn(TempObject).OnRenderProcessTerminated(TCefBrowserRef.UnWrap(browser),
|
||||
status);
|
||||
status,
|
||||
error_code,
|
||||
CefString(error_string));
|
||||
end;
|
||||
|
||||
procedure cef_request_handler_on_document_available_in_main_frame(self : PCefRequestHandler;
|
||||
@ -295,6 +327,8 @@ begin
|
||||
on_certificate_error := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_certificate_error;
|
||||
on_select_client_certificate := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_select_client_certificate;
|
||||
on_render_view_ready := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_view_ready;
|
||||
on_render_process_unresponsive := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_process_unresponsive;
|
||||
on_render_process_responsive := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_process_responsive;
|
||||
on_render_process_terminated := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_process_terminated;
|
||||
on_document_available_in_main_frame := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_document_available_in_main_frame;
|
||||
end;
|
||||
@ -363,7 +397,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCefRequestHandlerOwn.OnRenderProcessTerminated(const browser : ICefBrowser;
|
||||
status : TCefTerminationStatus);
|
||||
status : TCefTerminationStatus;
|
||||
error_code : integer;
|
||||
const error_string : ustring);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
@ -373,6 +409,16 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
function TCefRequestHandlerOwn.OnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TCefRequestHandlerOwn.OnRenderProcessResponsive(const browser: ICefBrowser);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefRequestHandlerOwn.OnRenderViewReady(const browser: ICefBrowser);
|
||||
begin
|
||||
//
|
||||
@ -498,10 +544,33 @@ begin
|
||||
Result := inherited OnSelectClientCertificate(browser, isProxy, host, port, certificatesCount, certificates, callback);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
procedure TCustomRequestHandler.OnRenderViewReady(const browser: ICefBrowser);
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnRenderProcessTerminated(browser, status);
|
||||
IChromiumEvents(FEvents).doOnRenderViewReady(browser);
|
||||
end;
|
||||
|
||||
function TCustomRequestHandler.OnRenderProcessUnresponsive(const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback): boolean;
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
Result := IChromiumEvents(FEvents).doOnRenderProcessUnresponsive(browser, callback)
|
||||
else
|
||||
Result := inherited OnRenderProcessUnresponsive(browser, callback);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnRenderProcessResponsive(const browser: ICefBrowser);
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnRenderProcessResponsive(browser);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnRenderProcessTerminated(const browser : ICefBrowser;
|
||||
status : TCefTerminationStatus;
|
||||
error_code : integer;
|
||||
const error_string : ustring);
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnRenderProcessTerminated(browser, status, error_code, error_string);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
@ -510,10 +579,4 @@ begin
|
||||
IChromiumEvents(FEvents).doOnDocumentAvailableInMainFrame(browser);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnRenderViewReady(const browser: ICefBrowser);
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnRenderViewReady(browser);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -80,6 +80,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
// ICefTextfieldDelegate
|
||||
procedure OnKeyEvent(const textfield: ICefTextfield; const event: TCefKeyEvent; var aResult : boolean); override;
|
||||
@ -312,6 +313,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomTextfieldDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefTextfieldDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomTextfieldDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomTextfieldDelegate.OnKeyEvent(const textfield: ICefTextfield; const event: TCefKeyEvent; var aResult : boolean);
|
||||
begin
|
||||
try
|
||||
|
@ -83,6 +83,7 @@ type
|
||||
PCefRunContextMenuCallback = ^TCefRunContextMenuCallback;
|
||||
PCefDialogHandler = ^TCefDialogHandler;
|
||||
PCefFileDialogCallback = ^TCefFileDialogCallback;
|
||||
PCefUnresponsiveProcessCallback = ^TCefUnresponsiveProcessCallback;
|
||||
PCefDisplayHandler = ^TCefDisplayHandler;
|
||||
PCefDownloadHandler = ^TCefDownloadHandler;
|
||||
PCefDownloadItem = ^TCefDownloadItem;
|
||||
@ -219,7 +220,45 @@ type
|
||||
PCefMediaSinkDeviceInfoCallback = ^TCefMediaSinkDeviceInfoCallback;
|
||||
PCefMediaSource = ^TCefMediaSource;
|
||||
PCefMediaSinkDeviceInfo = ^TCefMediaSinkDeviceInfo;
|
||||
PCefAcceleratedPaintInfo = ^TCefAcceleratedPaintInfo;
|
||||
|
||||
{$IFDEF FPC}
|
||||
NativeInt = PtrInt;
|
||||
NativeUInt = PtrUInt;
|
||||
PNativeInt = ^NativeInt;
|
||||
PNativeUInt = ^NativeUInt;
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
/// </summary>
|
||||
ustring = type UnicodeString;
|
||||
rbstring = type AnsiString;
|
||||
{$ELSE}
|
||||
{$IFNDEF DELPHI12_UP}
|
||||
NativeUInt = Cardinal;
|
||||
PNativeUInt = ^NativeUInt;
|
||||
NativeInt = Integer;
|
||||
uint16 = Word;
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
/// </summary>
|
||||
ustring = type WideString;
|
||||
rbstring = type AnsiString;
|
||||
{$IFNDEF DELPHI7_UP}
|
||||
uint64 = type int64;
|
||||
PPAnsiChar = array of PChar;
|
||||
{$ENDIF}
|
||||
{$ELSE}
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
/// </summary>
|
||||
ustring = type string;
|
||||
rbstring = type RawByteString;
|
||||
{$IFNDEF DELPHI15_UP}
|
||||
NativeUInt = Cardinal;
|
||||
PNativeUInt = ^NativeUInt;
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
/// <summary>
|
||||
@ -243,88 +282,67 @@ type
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_event_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefEventHandle = type PMsg;
|
||||
{$IFNDEF FPC}
|
||||
/// <summary>
|
||||
/// Missing HANDLE declaration.
|
||||
/// </summary>
|
||||
HANDLE = type NativeUInt;
|
||||
{$ENDIF}
|
||||
/// <summary>
|
||||
/// Native texture handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_shared_texture_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefSharedTextureHandle = type HANDLE;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF MACOSX}
|
||||
{$IFDEF FPC}
|
||||
/// <summary>
|
||||
/// Native Window handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_window_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefWindowHandle = type PtrUInt;
|
||||
TCefWindowHandle = type {$IFDEF FPC}PtrUInt{$ELSE}Pointer{$ENDIF};
|
||||
/// <summary>
|
||||
/// Native Cursor handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_cursor_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefCursorHandle = type PtrUInt;
|
||||
TCefCursorHandle = type {$IFDEF FPC}PtrUInt{$ELSE}Pointer{$ENDIF};
|
||||
/// <summary>
|
||||
/// Native event handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_event_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefEventHandle = type PtrUInt;
|
||||
{$ELSE}
|
||||
TCefEventHandle = type {$IFDEF FPC}PtrUInt{$ELSE}Pointer{$ENDIF};
|
||||
/// <summary>
|
||||
/// Native Window handle.
|
||||
/// Native texture handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_window_handle_t)</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_mac.h (cef_shared_texture_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefWindowHandle = type Pointer;
|
||||
/// <summary>
|
||||
/// Native Cursor handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_cursor_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefCursorHandle = type Pointer;
|
||||
/// <summary>
|
||||
/// Native event handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_event_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefEventHandle = type Pointer;
|
||||
{$ENDIF}
|
||||
TCefSharedTextureHandle = {$IFDEF FPC}type PtrUInt{$ELSE}Pointer{$ENDIF};
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF LINUX}
|
||||
{$IFDEF FPC}
|
||||
/// <summary>
|
||||
/// Native Window handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_window_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefWindowHandle = type culong;
|
||||
TCefWindowHandle = type {$IFDEF FPC}culong{$ELSE}LongWord{$ENDIF};
|
||||
/// <summary>
|
||||
/// Native Cursor handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_cursor_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefCursorHandle = type culong;
|
||||
{$ELSE}
|
||||
/// <summary>
|
||||
/// Native Window handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_window_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefWindowHandle = type LongWord;
|
||||
/// <summary>
|
||||
/// Native Cursor handle.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_cursor_handle_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefCursorHandle = type LongWord;
|
||||
{$ENDIF}
|
||||
TCefCursorHandle = type {$IFDEF FPC}culong{$ELSE}LongWord{$ENDIF};
|
||||
/// <summary>
|
||||
/// Native event handle.
|
||||
/// </summary>
|
||||
@ -358,6 +376,107 @@ type
|
||||
TCefEventHandle = type UIntPtr;
|
||||
{$ENDIF}
|
||||
|
||||
/// <summary>
|
||||
/// Describes how to interpret the components of a pixel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_color.h">CEF source file: /include/internal/cef_types_color.h (cef_color_type_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefColorType = (
|
||||
/// <summary>
|
||||
/// RGBA with 8 bits per pixel (32bits total).
|
||||
/// </summary>
|
||||
CEF_COLOR_TYPE_RGBA_8888,
|
||||
/// <summary>
|
||||
/// BGRA with 8 bits per pixel (32bits total).
|
||||
/// </summary>
|
||||
CEF_COLOR_TYPE_BGRA_8888
|
||||
);
|
||||
|
||||
{$IFDEF LINUX}
|
||||
/// <summary>
|
||||
/// Structure containing the plane information of the shared texture.
|
||||
/// Sync with native_pixmap_handle.h
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_accelerated_paint_native_pixmap_plane_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefAcceleratedPaintNativePixmapPlaneInfo = record
|
||||
/// <summary>
|
||||
/// The strides in bytes to be used when accessing the buffers via
|
||||
/// a memory mapping. One per plane per entry.
|
||||
/// </summary>
|
||||
stride : Cardinal;
|
||||
/// <summary>
|
||||
/// The offsets in bytes to be used when accessing the buffers via
|
||||
/// a memory mapping. One per plane per entry.
|
||||
/// </summary>
|
||||
offset : uint64;
|
||||
/// <summary>
|
||||
/// Size in bytes of the plane is necessary to map the buffers.
|
||||
/// </summary>
|
||||
size : uint64;
|
||||
/// <summary>
|
||||
/// File descriptor for the underlying memory object (usually dmabuf).
|
||||
/// </summary>
|
||||
fd : integer;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
/// <summary>
|
||||
/// Structure containing shared texture information for the OnAcceleratedPaint
|
||||
/// callback. Resources will be released to the underlying pool for reuse when
|
||||
/// the callback returns from client code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_accelerated_paint_info_t)</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_accelerated_paint_info_t)</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_accelerated_paint_info_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefAcceleratedPaintInfo = record
|
||||
{$IFDEF MSWINDOWS}
|
||||
/// <summary>
|
||||
/// Handle for the shared texture. The shared texture is instantiated
|
||||
/// without a keyed mutex.
|
||||
/// </summary>
|
||||
shared_texture_handle : TCefSharedTextureHandle;
|
||||
/// <summary>
|
||||
/// The pixel format of the texture.
|
||||
/// </summary>
|
||||
format : TCefColorType;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF MACOSX}
|
||||
/// <summary>
|
||||
/// Handle for the shared texture IOSurface.
|
||||
/// </summary>
|
||||
shared_texture_io_surface : TCefSharedTextureHandle;
|
||||
/// <summary>
|
||||
/// The pixel format of the texture.
|
||||
/// </summary>
|
||||
format : TCefColorType;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF LINUX}
|
||||
/// <summary>
|
||||
/// Planes of the shared texture, usually file descriptors of dmabufs.
|
||||
/// </summary>
|
||||
planes : array [0..pred(CEF_KACCELERATEDPAINTMAXPLANES)] of TCefAcceleratedPaintNativePixmapPlaneInfo;
|
||||
/// <summary>
|
||||
/// Plane count.
|
||||
/// </summary>
|
||||
plane_count : integer;
|
||||
/// <summary>
|
||||
/// Modifier could be used with EGL driver.
|
||||
/// </summary>
|
||||
modifier : uint64;
|
||||
/// <summary>
|
||||
/// The pixel format of the texture.
|
||||
/// </summary>
|
||||
format : TCefColorType;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
/// Platform thread ID.
|
||||
/// </summary>
|
||||
@ -736,43 +855,20 @@ type
|
||||
/// </remarks>
|
||||
TCefLogItems = type Cardinal;
|
||||
|
||||
{$IFDEF FPC}
|
||||
NativeInt = PtrInt;
|
||||
NativeUInt = PtrUInt;
|
||||
PNativeInt = ^NativeInt;
|
||||
PNativeUInt = ^NativeUInt;
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
/// Process result codes. This is not a comprehensive list, as result codes
|
||||
/// might also include platform-specific crash values (Posix signal or Windows
|
||||
/// hardware exception), or internal-only implementation values.
|
||||
/// </summary>
|
||||
ustring = type UnicodeString;
|
||||
rbstring = type AnsiString;
|
||||
{$ELSE}
|
||||
{$IFNDEF DELPHI12_UP}
|
||||
NativeUInt = Cardinal;
|
||||
PNativeUInt = ^NativeUInt;
|
||||
NativeInt = Integer;
|
||||
uint16 = Word;
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
/// </summary>
|
||||
ustring = type WideString;
|
||||
rbstring = type AnsiString;
|
||||
{$IFNDEF DELPHI7_UP}
|
||||
uint64 = type int64;
|
||||
PPAnsiChar = array of PChar;
|
||||
{$ENDIF}
|
||||
{$ELSE}
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
/// </summary>
|
||||
ustring = type string;
|
||||
rbstring = type RawByteString;
|
||||
{$IFNDEF DELPHI15_UP}
|
||||
NativeUInt = Cardinal;
|
||||
PNativeUInt = ^NativeUInt;
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
/// <remarks>
|
||||
/// <para>See the uCEFConstants unit for all possible values.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_resultcode_t)</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/result_codes.h">See Chromium's content::ResultCode type.</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_result_codes.h">See chrome::ResultCode type.</see></para>
|
||||
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/sandbox_types.h">See sandbox::TerminationCodes type.</see></para>
|
||||
/// </remarks>
|
||||
TCefResultCode = type Integer;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Array of byte. Needed only for backwards compatibility with old Delphi versions.
|
||||
@ -1882,48 +1978,49 @@ type
|
||||
CEF_CHANNEL_LAYOUT_5_0_BACK = 11,
|
||||
/// <summary>Front L, Front R, Front C, LFE, Back L, Back R</summary>
|
||||
CEF_CHANNEL_LAYOUT_5_1_BACK = 12,
|
||||
/// <summary>Front L, Front R, Front C, Side L, Side R, Back L, Back R</summary>
|
||||
/// <summary>Front L, Front R, Front C, Back L, Back R, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_7_0 = 13,
|
||||
/// <summary>Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R</summary>
|
||||
/// <summary>Front L, Front R, Front C, LFE, Back L, Back R, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_7_1 = 14,
|
||||
/// <summary>Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC</summary>
|
||||
/// <summary>Front L, Front R, Front C, LFE, Front LofC, Front RofC, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_7_1_WIDE = 15,
|
||||
/// <summary>Stereo L, Stereo R</summary>
|
||||
/// <summary>Front L, Front R</summary>
|
||||
CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16,
|
||||
/// <summary>Stereo L, Stereo R, LFE</summary>
|
||||
/// <summary>Front L, Front R, LFE</summary>
|
||||
CEF_CHANNEL_LAYOUT_2POINT1 = 17,
|
||||
/// <summary>Stereo L, Stereo R, Front C, LFE</summary>
|
||||
/// <summary>Front L, Front R, Front C, LFE</summary>
|
||||
CEF_CHANNEL_LAYOUT_3_1 = 18,
|
||||
/// <summary>Stereo L, Stereo R, Front C, Rear C, LFE</summary>
|
||||
/// <summary>Front L, Front R, Front C, LFE, Back C</summary>
|
||||
CEF_CHANNEL_LAYOUT_4_1 = 19,
|
||||
/// <summary>Stereo L, Stereo R, Front C, Side L, Side R, Back C</summary>
|
||||
/// <summary>Front L, Front R, Front C, Back C, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_6_0 = 20,
|
||||
/// <summary>Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC</summary>
|
||||
/// <summary>Front L, Front R, Front LofC, Front RofC, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_6_0_FRONT = 21,
|
||||
/// <summary>Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C</summary>
|
||||
/// <summary>Front L, Front R, Front C, Back L, Back R, Back C</summary>
|
||||
CEF_CHANNEL_LAYOUT_HEXAGONAL = 22,
|
||||
/// <summary>Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center</summary>
|
||||
/// <summary>Front L, Front R, Front C, LFE, Back C, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_6_1 = 23,
|
||||
/// <summary>Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center</summary>
|
||||
/// <summary>Front L, Front R, Front C, LFE, Back L, Back R, Back C</summary>
|
||||
CEF_CHANNEL_LAYOUT_6_1_BACK = 24,
|
||||
/// <summary>Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE</summary>
|
||||
/// <summary>Front L, Front R, LFE, Front LofC, Front RofC, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_6_1_FRONT = 25,
|
||||
/// <summary>Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC</summary>
|
||||
/// <summary>Front L, Front R, Front C, Front LofC, Front RofC, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_7_0_FRONT = 26,
|
||||
/// <summary>Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC</summary>
|
||||
CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27,
|
||||
/// <summary>Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C.</summary>
|
||||
/// <summary>Front L, Front R, Front C, Back L, Back R, Back C, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_OCTAGONAL = 28,
|
||||
/// <summary>Channels are not explicitly mapped to speakers.</summary>
|
||||
CEF_CHANNEL_LAYOUT_DISCRETE = 29,
|
||||
/// <summary>
|
||||
/// Deprecated, but keeping the enum value for UMA consistency.
|
||||
/// Front L, Front R, Front C. Front C contains the keyboard mic audio. This
|
||||
/// layout is only intended for input for WebRTC. The Front C channel
|
||||
/// is stripped away in the WebRTC audio input pipeline and never seen outside
|
||||
/// of that.
|
||||
/// </summary>
|
||||
CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30,
|
||||
/// <summary>Front L, Front R, Side L, Side R, LFE</summary>
|
||||
/// <summary>Front L, Front R, LFE, Side L, Side R</summary>
|
||||
CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31,
|
||||
/// <summary>
|
||||
/// Actual channel layout is specified in the bitstream and the actual channel
|
||||
@ -1937,8 +2034,12 @@ type
|
||||
/// Will be represented as six channels (5.1) due to eight channel limit
|
||||
/// kMaxConcurrentChannels
|
||||
/// </summary>
|
||||
CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33
|
||||
{* CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX *}
|
||||
CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33,
|
||||
/// <summary>Front C, LFE</summary>
|
||||
CEF_CHANNEL_LAYOUT_1_1 = 34,
|
||||
/// <summary>Front L, Front R, LFE, Back C</summary>
|
||||
CEF_CHANNEL_LAYOUT_3_1_BACK = 35
|
||||
{* CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_3_1_BACK *}
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@ -2276,7 +2377,15 @@ type
|
||||
/// <summary>
|
||||
/// Out of memory. Some platforms may use TS_PROCESS_CRASHED instead.
|
||||
/// </summary>
|
||||
TS_PROCESS_OOM
|
||||
TS_PROCESS_OOM,
|
||||
/// <summary>
|
||||
/// Child process never launched.
|
||||
/// </summary>
|
||||
TS_LAUNCH_FAILED,
|
||||
/// <summary>
|
||||
/// On Windows, the OS terminated the process due to code integrity failure.
|
||||
/// </summary>
|
||||
TS_INTEGRITY_FAILURE
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@ -2362,23 +2471,6 @@ type
|
||||
RESPONSE_FILTER_ERROR
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Describes how to interpret the components of a pixel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_color_type_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefColorType = (
|
||||
/// <summary>
|
||||
/// RGBA with 8 bits per pixel (32bits total).
|
||||
/// </summary>
|
||||
CEF_COLOR_TYPE_RGBA_8888,
|
||||
/// <summary>
|
||||
/// BGRA with 8 bits per pixel (32bits total).
|
||||
/// </summary>
|
||||
CEF_COLOR_TYPE_BGRA_8888
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Describes how to interpret the alpha component of a pixel.
|
||||
/// </summary>
|
||||
@ -2415,51 +2507,29 @@ type
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies where along the main axis the CefBoxLayout child views should be
|
||||
/// laid out.
|
||||
/// Specifies where along the axis the CefBoxLayout child views should be laid
|
||||
/// out. Should be kept in sync with Chromium's views::LayoutAlignment type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_main_axis_alignment_t)</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_axis_alignment_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefMainAxisAlignment = (
|
||||
TCefAxisAlignment = (
|
||||
/// <summary>
|
||||
/// Child views will be left-aligned.
|
||||
/// Child views will be left/top-aligned.
|
||||
/// </summary>
|
||||
CEF_MAIN_AXIS_ALIGNMENT_START,
|
||||
CEF_AXIS_ALIGNMENT_START,
|
||||
/// <summary>
|
||||
/// Child views will be center-aligned.
|
||||
/// </summary>
|
||||
CEF_MAIN_AXIS_ALIGNMENT_CENTER,
|
||||
CEF_AXIS_ALIGNMENT_CENTER,
|
||||
/// <summary>
|
||||
/// Child views will be right-aligned.
|
||||
/// Child views will be right/bottom-aligned.
|
||||
/// </summary>
|
||||
CEF_MAIN_AXIS_ALIGNMENT_END
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies where along the main axis the CefBoxLayout child views should be
|
||||
/// laid out.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_cross_axis_alignment_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefCrossAxisAlignment = (
|
||||
CEF_AXIS_ALIGNMENT_END,
|
||||
/// <summary>
|
||||
/// Child views will be stretched to fit.
|
||||
/// </summary>
|
||||
CEF_CROSS_AXIS_ALIGNMENT_STRETCH,
|
||||
/// <summary>
|
||||
/// Child views will be left-aligned.
|
||||
/// </summary>
|
||||
CEF_CROSS_AXIS_ALIGNMENT_START,
|
||||
/// <summary>
|
||||
/// Child views will be center-aligned.
|
||||
/// </summary>
|
||||
CEF_CROSS_AXIS_ALIGNMENT_CENTER,
|
||||
/// <summary>
|
||||
/// Child views will be right-aligned.
|
||||
/// </summary>
|
||||
CEF_CROSS_AXIS_ALIGNMENT_END
|
||||
CEF_AXIS_ALIGNMENT_STRETCH
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@ -2757,6 +2827,23 @@ type
|
||||
CEF_ZOOM_COMMAND_IN
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the color variants supported by
|
||||
/// ICefRequestContext.SetChromeThemeColor.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_color_variant_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefColorVariant = (
|
||||
CEF_COLOR_VARIANT_SYSTEM,
|
||||
CEF_COLOR_VARIANT_LIGHT,
|
||||
CEF_COLOR_VARIANT_DARK,
|
||||
CEF_COLOR_VARIANT_TONAL_SPOT,
|
||||
CEF_COLOR_VARIANT_NEUTRAL,
|
||||
CEF_COLOR_VARIANT_VIBRANT,
|
||||
CEF_COLOR_VARIANT_EXPRESSIVE
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the gesture commands.
|
||||
/// </summary>
|
||||
@ -2991,11 +3078,11 @@ type
|
||||
/// <summary>
|
||||
/// Specifies where along the main axis the child views should be laid out.
|
||||
/// </summary>
|
||||
main_axis_alignment : TCefMainAxisAlignment;
|
||||
main_axis_alignment : TCefAxisAlignment;
|
||||
/// <summary>
|
||||
/// Specifies where along the cross axis the child views should be laid out.
|
||||
/// </summary>
|
||||
cross_axis_alignment : TCefCrossAxisAlignment;
|
||||
cross_axis_alignment : TCefAxisAlignment;
|
||||
/// <summary>
|
||||
/// Minimum cross axis size.
|
||||
/// </summary>
|
||||
@ -3312,6 +3399,8 @@ type
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_win.h">CEF source file: /include/internal/cef_types_win.h (cef_window_info_t)</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_mac.h">CEF source file: /include/internal/cef_types_mac.h (cef_window_info_t)</see></para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types_linux.h">CEF source file: /include/internal/cef_types_linux.h (cef_window_info_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefWindowInfo = record
|
||||
{$IFDEF MSWINDOWS}
|
||||
@ -4525,7 +4614,20 @@ type
|
||||
/// Whether an application can enumerate audio output device.
|
||||
/// </summary>
|
||||
CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION,
|
||||
CEF_CONTENT_SETTING_TYPE_NUM_TYPES
|
||||
/// <summary>
|
||||
/// Content settings for access to the Direct Sockets API.
|
||||
/// </summary>
|
||||
CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS,
|
||||
/// <summary>
|
||||
/// Keyboard Lock API allows a site to capture keyboard inputs that would
|
||||
/// otherwise be handled by the OS or the browser.
|
||||
/// </summary>
|
||||
CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK,
|
||||
/// <summary>
|
||||
/// Pointer Lock API allows a site to hide the cursor and have exclusive
|
||||
/// access to mouse inputs.
|
||||
/// </summary>
|
||||
CEF_CONTENT_SETTING_TYPE_POINTER_LOCK
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@ -4695,6 +4797,19 @@ type
|
||||
cancel : procedure(self: PCefFileDialogCallback); stdcall;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
/// Callback structure for asynchronous handling of an unresponsive process.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Implemented by ICefUnresponsiveProcessCallback.</para>
|
||||
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_unresponsive_process_callback_capi.h">CEF source file: /include/capi/cef_unresponsive_process_callback_capi.h (cef_unresponsive_process_callback_t)</see></para>
|
||||
/// </remarks>
|
||||
TCefUnresponsiveProcessCallback = record
|
||||
base : TCefBaseRefCounted;
|
||||
wait : procedure(self: PCefUnresponsiveProcessCallback); stdcall;
|
||||
terminate : procedure(self: PCefUnresponsiveProcessCallback); stdcall;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
/// Implement this structure to handle dialog events. The functions of this
|
||||
/// structure will be called on the browser process UI thread.
|
||||
@ -5102,7 +5217,7 @@ type
|
||||
on_popup_show : procedure(self: PCefRenderHandler; browser: PCefBrowser; show: Integer); stdcall;
|
||||
on_popup_size : procedure(self: PCefRenderHandler; browser: PCefBrowser; const rect: PCefRect); stdcall;
|
||||
on_paint : procedure(self: PCefRenderHandler; browser: PCefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); stdcall;
|
||||
on_accelerated_paint : procedure(self: PCefRenderHandler; browser: PCefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer); stdcall;
|
||||
on_accelerated_paint : procedure(self: PCefRenderHandler; browser: PCefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo); stdcall;
|
||||
get_touch_handle_size : procedure(self: PCefRenderHandler; browser: PCefBrowser; orientation: TCefHorizontalAlignment; size: PCefSize); stdcall;
|
||||
on_touch_handle_state_changed : procedure(self: PCefRenderHandler; browser: PCefBrowser; const state: PCefTouchHandleState); stdcall;
|
||||
start_dragging : function(self: PCefRenderHandler; browser: PCefBrowser; drag_data: PCefDragData; allowed_ops: TCefDragOperations; x, y: Integer): Integer; stdcall;
|
||||
@ -5520,7 +5635,9 @@ type
|
||||
on_certificate_error : function(self: PCefRequestHandler; browser: PCefBrowser; cert_error: TCefErrorcode; const request_url: PCefString; ssl_info: PCefSslInfo; callback: PCefCallback): Integer; stdcall;
|
||||
on_select_client_certificate : function(self: PCefRequestHandler; browser: PCefBrowser; isProxy: integer; const host: PCefString; port: integer; certificatesCount: NativeUInt; const certificates: PPCefX509Certificate; callback: PCefSelectClientCertificateCallback): integer; stdcall;
|
||||
on_render_view_ready : procedure(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
on_render_process_terminated : procedure(self: PCefRequestHandler; browser: PCefBrowser; status: TCefTerminationStatus); stdcall;
|
||||
on_render_process_unresponsive : function(self: PCefRequestHandler; browser: PCefBrowser; callback: PCefUnresponsiveProcessCallback): integer; stdcall;
|
||||
on_render_process_responsive : procedure(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
on_render_process_terminated : procedure(self: PCefRequestHandler; browser: PCefBrowser; status: TCefTerminationStatus; error_code: integer; const error_string: PCefString); stdcall;
|
||||
on_document_available_in_main_frame : procedure(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
end;
|
||||
|
||||
@ -5807,6 +5924,10 @@ type
|
||||
set_website_setting : procedure(self: PCefRequestContext; const requesting_url, top_level_url: PCefString; content_type: TCefContentSettingTypes; value: PCefValue); stdcall;
|
||||
get_content_setting : function(self: PCefRequestContext; const requesting_url, top_level_url: PCefString; content_type: TCefContentSettingTypes): TCefContentSettingValues; stdcall;
|
||||
set_content_setting : procedure(self: PCefRequestContext; const requesting_url, top_level_url: PCefString; content_type: TCefContentSettingTypes; value: TCefContentSettingValues); stdcall;
|
||||
set_chrome_color_scheme : procedure(self: PCefRequestContext; variant: TCefColorVariant; user_color: TCefColor); stdcall;
|
||||
get_chrome_color_scheme_mode : function(self: PCefRequestContext): TCefColorVariant; stdcall;
|
||||
get_chrome_color_scheme_color : function(self: PCefRequestContext): TCefColor; stdcall;
|
||||
get_chrome_color_scheme_variant : function(self: PCefRequestContext): TCefColorVariant; stdcall;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
@ -7134,6 +7255,7 @@ type
|
||||
exit_fullscreen : procedure(self: PCefBrowserHost; will_cause_resize: integer); stdcall;
|
||||
can_execute_chrome_command : function(self: PCefBrowserHost; command_id: integer): integer; stdcall;
|
||||
execute_chrome_command : procedure(self: PCefBrowserHost; command_id: integer; disposition: TCefWindowOpenDisposition); stdcall;
|
||||
is_render_process_unresponsive : function(self: PCefBrowserHost): integer; stdcall;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
@ -7476,6 +7598,7 @@ type
|
||||
request_focus : procedure(self: PCefView); stdcall;
|
||||
set_background_color : procedure(self: PCefView; color: TCefColor); stdcall;
|
||||
get_background_color : function(self: PCefView): TCefColor; stdcall;
|
||||
get_theme_color : function(self: PCefView; color_id: integer): TCefColor; stdcall;
|
||||
convert_point_to_screen : function(self: PCefView; point: PCefPoint): Integer; stdcall;
|
||||
convert_point_from_screen : function(self: PCefView; point: PCefPoint): Integer; stdcall;
|
||||
convert_point_to_window : function(self: PCefView; point: PCefPoint): Integer; stdcall;
|
||||
@ -7506,6 +7629,7 @@ type
|
||||
on_layout_changed : procedure(self: PCefViewDelegate; view: PCefView; const new_bounds: PCefRect); stdcall;
|
||||
on_focus : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||
on_blur : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||
on_theme_changed : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
@ -7810,6 +7934,8 @@ type
|
||||
set_accelerator : procedure(self: PCefWindow; command_id, key_code, shift_pressed, ctrl_pressed, alt_pressed, high_priority: Integer); stdcall;
|
||||
remove_accelerator : procedure(self: PCefWindow; command_id: Integer); stdcall;
|
||||
remove_all_accelerators : procedure(self: PCefWindow); stdcall;
|
||||
set_theme_color : procedure(self: PCefWindow; color_id: integer; color: TCefColor); stdcall;
|
||||
theme_changed : procedure(self: PCefWindow); stdcall;
|
||||
end;
|
||||
|
||||
/// <summary>
|
||||
@ -7836,12 +7962,14 @@ type
|
||||
is_frameless : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
|
||||
with_standard_window_buttons : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
|
||||
get_titlebar_height : function(self: PCefWindowDelegate; window: PCefWindow; titlebar_height: PSingle): Integer; stdcall;
|
||||
accepts_first_mouse : function(self: PCefWindowDelegate; window: PCefWindow): TCefState; stdcall;
|
||||
can_resize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
|
||||
can_maximize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
|
||||
can_minimize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
|
||||
can_close : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
|
||||
on_accelerator : function(self: PCefWindowDelegate; window: PCefWindow; command_id: Integer): Integer; stdcall;
|
||||
on_key_event : function(self: PCefWindowDelegate; window: PCefWindow; const event: PCefKeyEvent): Integer; stdcall;
|
||||
on_theme_colors_changed : procedure(self: PCefWindowDelegate; window: PCefWindow; chrome_theme: Integer); stdcall;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
51
source/uCEFUnresponsiveProcessCallback.pas
Normal file
51
source/uCEFUnresponsiveProcessCallback.pas
Normal file
@ -0,0 +1,51 @@
|
||||
unit uCEFUnresponsiveProcessCallback;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$MODE OBJFPC}{$H+}
|
||||
{$ENDIF}
|
||||
|
||||
{$I cef.inc}
|
||||
|
||||
{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
|
||||
{$MINENUMSIZE 4}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
System.Classes, System.SysUtils,
|
||||
{$ELSE}
|
||||
Classes, SysUtils,
|
||||
{$ENDIF}
|
||||
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
|
||||
|
||||
type
|
||||
TCefUnresponsiveProcessCallbackRef = class(TCefBaseRefCountedRef, ICefUnresponsiveProcessCallback)
|
||||
protected
|
||||
procedure Wait;
|
||||
procedure Terminate;
|
||||
public
|
||||
class function UnWrap(data: Pointer): ICefUnresponsiveProcessCallback;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure TCefUnresponsiveProcessCallbackRef.Wait;
|
||||
begin
|
||||
PCefUnresponsiveProcessCallback(FData)^.wait(PCefUnresponsiveProcessCallback(FData));
|
||||
end;
|
||||
|
||||
procedure TCefUnresponsiveProcessCallbackRef.Terminate;
|
||||
begin
|
||||
PCefUnresponsiveProcessCallback(FData)^.terminate(PCefUnresponsiveProcessCallback(FData));
|
||||
end;
|
||||
|
||||
class function TCefUnresponsiveProcessCallbackRef.UnWrap(data: Pointer): ICefUnresponsiveProcessCallback;
|
||||
begin
|
||||
if (data <> nil) then
|
||||
Result := Create(data) as ICefUnresponsiveProcessCallback
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
end.
|
@ -1,9 +1,9 @@
|
||||
CEF_SUPPORTED_VERSION_MAJOR = 123;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 0;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 13;
|
||||
CEF_SUPPORTED_VERSION_MAJOR = 124;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 3;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 1;
|
||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||
|
||||
CEF_CHROMEELF_VERSION_MAJOR = CEF_SUPPORTED_VERSION_MAJOR;
|
||||
CEF_CHROMEELF_VERSION_MINOR = 0;
|
||||
CEF_CHROMEELF_VERSION_RELEASE = 6312;
|
||||
CEF_CHROMEELF_VERSION_BUILD = 124;
|
||||
CEF_CHROMEELF_VERSION_RELEASE = 6367;
|
||||
CEF_CHROMEELF_VERSION_BUILD = 60;
|
||||
|
@ -248,14 +248,26 @@ type
|
||||
/// </summary>
|
||||
procedure RequestFocus;
|
||||
/// <summary>
|
||||
/// Sets the background color for this View.
|
||||
/// Sets the background color for this View. The background color will be
|
||||
/// automatically reset when ICefViewDelegate.OnThemeChanged is called.
|
||||
/// </summary>
|
||||
procedure SetBackgroundColor(color: TCefColor);
|
||||
/// <summary>
|
||||
/// Returns the background color for this View.
|
||||
/// Returns the background color for this View. If the background color is
|
||||
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
|
||||
/// will be returned. If this View belongs to an overlay (created with
|
||||
/// ICefWindow.AddOverlayView), and the background color is unset, then a
|
||||
/// value of transparent (0) will be returned.
|
||||
/// </summary>
|
||||
function GetBackgroundColor : TCefColor;
|
||||
/// <summary>
|
||||
/// Returns the current theme color associated with |color_id|, or the
|
||||
/// placeholder color (red) if unset. See cef_color_ids.h for standard ID
|
||||
/// values. Standard colors can be overridden and custom colors can be added
|
||||
/// using ICefWindow.SetThemeColor.
|
||||
/// </summary>
|
||||
function GetThemeColor(color_id: integer): TCefColor;
|
||||
/// <summary>
|
||||
/// Convert |point| from this View's coordinate system to DIP screen
|
||||
/// coordinates. This View must belong to a Window when calling this function.
|
||||
/// Returns true (1) if the conversion is successful or false (0) otherwise.
|
||||
@ -532,6 +544,11 @@ begin
|
||||
Result := PCefView(FData)^.get_background_color(PCefView(FData));
|
||||
end;
|
||||
|
||||
function TCefViewRef.GetThemeColor(color_id: integer): TCefColor;
|
||||
begin
|
||||
Result := PCefView(FData)^.get_theme_color(PCefView(FData), color_id);
|
||||
end;
|
||||
|
||||
function TCefViewRef.ConvertPointToScreen(var point: TCefPoint): boolean;
|
||||
begin
|
||||
Result := (PCefView(FData)^.convert_point_to_screen(PCefView(FData), @point) <> 0);
|
||||
|
@ -36,6 +36,7 @@ type
|
||||
FOnLayoutChanged : TOnLayoutChangedEvent;
|
||||
FOnFocus : TOnFocusEvent;
|
||||
FOnBlur : TOnBlurEvent;
|
||||
FOnThemeChanged : TOnThemeChangedEvent;
|
||||
|
||||
FComponentID : integer;
|
||||
|
||||
@ -98,6 +99,7 @@ type
|
||||
procedure doOnLayoutChanged(const view: ICefView; new_bounds: TCefRect); virtual;
|
||||
procedure doOnFocus(const view: ICefView); virtual;
|
||||
procedure doOnBlur(const view: ICefView); virtual;
|
||||
procedure doOnThemeChanged(const view: ICefView); virtual;
|
||||
procedure doCreateCustomView; virtual;
|
||||
|
||||
public
|
||||
@ -132,6 +134,13 @@ type
|
||||
/// </summary>
|
||||
procedure RequestFocus;
|
||||
/// <summary>
|
||||
/// Returns the current theme color associated with |color_id|, or the
|
||||
/// placeholder color (red) if unset. See cef_color_ids.h for standard ID
|
||||
/// values. Standard colors can be overridden and custom colors can be added
|
||||
/// using ICefWindow.SetThemeColor.
|
||||
/// </summary>
|
||||
function GetThemeColor(color_id: integer): TCefColor;
|
||||
/// <summary>
|
||||
/// Convert |point| from this View's coordinate system to DIP screen
|
||||
/// coordinates. This View must belong to a Window when calling this function.
|
||||
/// Returns true (1) if the conversion is successful or false (0) otherwise.
|
||||
@ -286,7 +295,11 @@ type
|
||||
/// </summary>
|
||||
property AccessibilityFocusable : boolean read GetIsAccessibilityFocusable;
|
||||
/// <summary>
|
||||
/// Returns the background color for this View.
|
||||
/// Returns the background color for this View. If the background color is
|
||||
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
|
||||
/// will be returned. If this View belongs to an overlay (created with
|
||||
/// ICefWindow.AddOverlayView), and the background color is unset, then a
|
||||
/// value of transparent (0) will be returned.
|
||||
/// </summary>
|
||||
property BackgroundColor : TCefColor read GetBackgroundColor write SetBackgroundColor;
|
||||
/// <summary>
|
||||
@ -382,6 +395,24 @@ type
|
||||
/// Called when |view| loses focus.
|
||||
/// </summary>
|
||||
property OnBlur : TOnBlurEvent read FOnBlur write FOnBlur;
|
||||
/// <summary>
|
||||
/// <para>Called when the theme for |view| has changed, after the new theme colors
|
||||
/// have already been applied. Views are notified via the component hierarchy
|
||||
/// in depth-first reverse order (children before parents).</para>
|
||||
/// <para>This will be called in the following cases:</para>
|
||||
/// <code>
|
||||
/// 1. When |view|, or a parent of |view|, is added to a Window.
|
||||
/// 2. When the native/OS or Chrome theme changes for the Window that contains
|
||||
/// |view|. See ICefWindowDelegate.OnThemeColorsChanged documentation.
|
||||
/// 3. When the client explicitly calls ICefWindow.ThemeChanged on the
|
||||
/// Window that contains |view|.
|
||||
/// </code>
|
||||
/// <para>Optionally use this callback to override the new per-View theme colors by
|
||||
/// calling ICefView.SetBackgroundColor or the appropriate component-
|
||||
/// specific function. See ICefWindow.SetThemeColor documentation for how
|
||||
/// to customize additional Window theme colors.</para>
|
||||
/// <summary>
|
||||
property OnThemeChanged : TOnThemeChangedEvent read FOnThemeChanged write FOnThemeChanged;
|
||||
end;
|
||||
|
||||
// *********************************************************
|
||||
@ -454,6 +485,7 @@ begin
|
||||
FOnLayoutChanged := nil;
|
||||
FOnFocus := nil;
|
||||
FOnBlur := nil;
|
||||
FOnThemeChanged := nil;
|
||||
end;
|
||||
|
||||
procedure TCEFViewComponent.CreateView;
|
||||
@ -854,6 +886,14 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TCEFViewComponent.GetThemeColor(color_id: integer): TCefColor;
|
||||
begin
|
||||
if Initialized then
|
||||
Result := AsView.GetThemeColor(color_id)
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TCEFViewComponent.ConvertPointToScreen(var point: TCefPoint): boolean;
|
||||
begin
|
||||
Result := Initialized and AsView.ConvertPointToScreen(point);
|
||||
@ -954,6 +994,12 @@ begin
|
||||
FOnBlur(self, view);
|
||||
end;
|
||||
|
||||
procedure TCEFViewComponent.doOnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
if assigned(FOnThemeChanged) then
|
||||
FOnThemeChanged(self, view);
|
||||
end;
|
||||
|
||||
procedure TCEFViewComponent.doCreateCustomView;
|
||||
begin
|
||||
//
|
||||
|
@ -32,6 +32,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
|
||||
procedure OnFocus(const view: ICefView);
|
||||
procedure OnBlur(const view: ICefView);
|
||||
procedure OnThemeChanged(const view: ICefView);
|
||||
|
||||
public
|
||||
/// <summary>
|
||||
@ -105,6 +106,24 @@ type
|
||||
/// </summary>
|
||||
procedure OnBlur(const view: ICefView); virtual;
|
||||
/// <summary>
|
||||
/// <para>Called when the theme for |view| has changed, after the new theme colors
|
||||
/// have already been applied. Views are notified via the component hierarchy
|
||||
/// in depth-first reverse order (children before parents).</para>
|
||||
/// <para>This will be called in the following cases:</para>
|
||||
/// <code>
|
||||
/// 1. When |view|, or a parent of |view|, is added to a Window.
|
||||
/// 2. When the native/OS or Chrome theme changes for the Window that contains
|
||||
/// |view|. See ICefWindowDelegate.OnThemeColorsChanged documentation.
|
||||
/// 3. When the client explicitly calls ICefWindow.ThemeChanged on the
|
||||
/// Window that contains |view|.
|
||||
/// </code>
|
||||
/// <para>Optionally use this callback to override the new per-View theme colors by
|
||||
/// calling ICefView.SetBackgroundColor or the appropriate component-
|
||||
/// specific function. See ICefWindow.SetThemeColor documentation for how
|
||||
/// to customize additional Window theme colors.</para>
|
||||
/// <summary>
|
||||
procedure OnThemeChanged(const view: ICefView); virtual;
|
||||
/// <summary>
|
||||
/// Links the methods in the internal CEF record data pointer with the methods in this class.
|
||||
/// </summary>
|
||||
procedure InitializeCEFMethods; virtual;
|
||||
@ -130,6 +149,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
public
|
||||
/// <summary>
|
||||
@ -213,6 +233,12 @@ begin
|
||||
CefGetData(view));
|
||||
end;
|
||||
|
||||
procedure TCefViewDelegateRef.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
PCefViewDelegate(FData)^.on_theme_changed(PCefViewDelegate(FData),
|
||||
CefGetData(view));
|
||||
end;
|
||||
|
||||
class function TCefViewDelegateRef.UnWrap(data: Pointer): ICefViewDelegate;
|
||||
begin
|
||||
if (data <> nil) then
|
||||
@ -360,6 +386,16 @@ begin
|
||||
TCefViewDelegateOwn(TempObject).OnBlur(TCefViewRef.UnWrap(view));
|
||||
end;
|
||||
|
||||
procedure cef_view_delegate_on_theme_changed(self: PCefViewDelegate; view: PCefView); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCefViewDelegateOwn) then
|
||||
TCefViewDelegateOwn(TempObject).OnThemeChanged(TCefViewRef.UnWrap(view));
|
||||
end;
|
||||
|
||||
constructor TCefViewDelegateOwn.Create;
|
||||
begin
|
||||
inherited CreateData(SizeOf(TCefViewDelegate));
|
||||
@ -391,6 +427,7 @@ begin
|
||||
on_layout_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_layout_changed;
|
||||
on_focus := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_focus;
|
||||
on_blur := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_blur;
|
||||
on_theme_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_theme_changed;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -447,6 +484,11 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefViewDelegateOwn.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
|
||||
// **************************************************************
|
||||
// ******************** TCustomViewDelegate *********************
|
||||
@ -584,5 +626,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomViewDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefViewDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomViewDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -31,6 +31,7 @@ type
|
||||
TOnLayoutChangedEvent = procedure(const Sender: TObject; const view: ICefView; new_bounds: TCefRect) of object;
|
||||
TOnFocusEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
||||
TOnBlurEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
||||
TOnThemeChangedEvent = procedure(const Sender: TObject; const view: ICefView) of object;
|
||||
|
||||
// ICefTextfieldDelegate
|
||||
TOnTextfieldKeyEventEvent = procedure(const Sender: TObject; const textfield: ICefTextfield; const event: TCefKeyEvent; var aResult : boolean) of object;
|
||||
@ -60,6 +61,7 @@ type
|
||||
TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window_: ICefWindow) of object;
|
||||
TOnWindowActivationChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; active: boolean) of object;
|
||||
TOnWindowBoundsChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; const new_bounds: TCefRect) of object;
|
||||
TOnWindowFullscreenTransitionEvent = procedure(const Sender: TObject; const window_: ICefWindow; is_completed: boolean) of object;
|
||||
TOnGetParentWindowEvent = procedure(const Sender: TObject; const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object;
|
||||
TOnIsWindowModalDialogEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnGetInitialBoundsEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : TCefRect) of object;
|
||||
@ -67,13 +69,14 @@ type
|
||||
TOnIsFramelessEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnWithStandardWindowButtonsEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnGetTitlebarHeightEvent = procedure(const Sender: TObject; const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean) of object;
|
||||
TOnAcceptsFirstMouseEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : TCefState) of object;
|
||||
TOnCanResizeEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnCanMaximizeEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnCanMinimizeEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnCanCloseEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
|
||||
TOnAcceleratorEvent = procedure(const Sender: TObject; const window_: ICefWindow; command_id: Integer; var aResult : boolean) of object;
|
||||
TOnWindowKeyEventEvent = procedure(const Sender: TObject; const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean) of object;
|
||||
TOnWindowFullscreenTransitionEvent = procedure(const Sender: TObject; const window_: ICefWindow; is_completed: boolean) of object;
|
||||
TOnThemeColorsChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; chrome_theme: Integer) of object;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -292,6 +292,39 @@ type
|
||||
/// </summary>
|
||||
procedure RemoveAllAccelerators;
|
||||
|
||||
/// <summary>
|
||||
/// <para>Override a standard theme color or add a custom color associated with
|
||||
/// |color_id|. See cef_color_ids.h for standard ID values. Recommended usage
|
||||
/// is as follows:</para>
|
||||
/// <code>
|
||||
/// 1. Customize the default native/OS theme by calling SetThemeColor before
|
||||
/// showing the first Window. When done setting colors call
|
||||
/// ICefWindow.ThemeChanged to trigger ICefViewDelegate.OnThemeChanged
|
||||
/// notifications.
|
||||
/// 2. Customize the current native/OS or Chrome theme after it changes by
|
||||
/// calling SetThemeColor from the ICefWindowDelegate.OnThemeColorsChanged
|
||||
/// callback. ICefViewDelegate.OnThemeChanged notifications will then be
|
||||
/// triggered automatically.
|
||||
/// </code>
|
||||
/// <para>The configured color will be available immediately via
|
||||
/// ICefView.GetThemeColor and will be applied to each View in this
|
||||
/// Window's component hierarchy when ICefViewDelegate.OnThemeChanged is
|
||||
/// called. See OnThemeColorsChanged documentation for additional details.</para>
|
||||
/// <para>Clients wishing to add custom colors should use |color_id| values >=
|
||||
/// CEF_ChromeColorsEnd.</para>
|
||||
/// </summary>
|
||||
procedure SetThemeColor(color_id: integer; color: TCefColor);
|
||||
|
||||
/// <summary>
|
||||
/// <para>Trigger cef_view_delegate_t::OnThemeChanged callbacks for each View in
|
||||
/// this Window's component hierarchy. Unlike a native/OS or Chrome theme
|
||||
/// change this function does not reset theme colors to standard values and
|
||||
/// does not result in a call to ICefWindowDelegate.OnThemeColorsChanged.</para>
|
||||
/// <para>Do not call this function from ICefViewDelegate.OnThemeColorsChanged
|
||||
/// or ICefViewDelegate.OnThemeChanged.</para>
|
||||
/// </summary>
|
||||
procedure ThemeChanged;
|
||||
|
||||
public
|
||||
/// <summary>
|
||||
/// Returns a ICefWindow instance using a PCefWindow data pointer.
|
||||
@ -525,6 +558,16 @@ begin
|
||||
PCefWindow(FData)^.remove_all_accelerators(PCefWindow(FData));
|
||||
end;
|
||||
|
||||
procedure TCefWindowRef.SetThemeColor(color_id: integer; color: TCefColor);
|
||||
begin
|
||||
PCefWindow(FData)^.set_theme_color(PCefWindow(FData), color_id, color);
|
||||
end;
|
||||
|
||||
procedure TCefWindowRef.ThemeChanged;
|
||||
begin
|
||||
PCefWindow(FData)^.theme_changed(PCefWindow(FData));
|
||||
end;
|
||||
|
||||
class function TCefWindowRef.UnWrap(data: Pointer): ICefWindow;
|
||||
begin
|
||||
if (data <> nil) then
|
||||
|
@ -35,6 +35,7 @@ type
|
||||
FOnWindowDestroyed : TOnWindowDestroyedEvent;
|
||||
FOnWindowActivationChanged : TOnWindowActivationChangedEvent;
|
||||
FOnWindowBoundsChanged : TOnWindowBoundsChangedEvent;
|
||||
FOnWindowFullscreenTransition : TOnWindowFullscreenTransitionEvent;
|
||||
FOnGetParentWindow : TOnGetParentWindowEvent;
|
||||
FOnIsWindowModalDialog : TOnIsWindowModalDialogEvent;
|
||||
FOnGetInitialBounds : TOnGetInitialBoundsEvent;
|
||||
@ -42,13 +43,14 @@ type
|
||||
FOnIsFrameless : TOnIsFramelessEvent;
|
||||
FOnWithStandardWindowButtons : TOnWithStandardWindowButtonsEvent;
|
||||
FOnGetTitlebarHeight : TOnGetTitlebarHeightEvent;
|
||||
FOnAcceptsFirstMouse : TOnAcceptsFirstMouseEvent;
|
||||
FOnCanResize : TOnCanResizeEvent;
|
||||
FOnCanMaximize : TOnCanMaximizeEvent;
|
||||
FOnCanMinimize : TOnCanMinimizeEvent;
|
||||
FOnCanClose : TOnCanCloseEvent;
|
||||
FOnAccelerator : TOnAcceleratorEvent;
|
||||
FOnKeyEvent : TOnWindowKeyEventEvent;
|
||||
FOnWindowFullscreenTransition : TOnWindowFullscreenTransitionEvent;
|
||||
FOnThemeColorsChanged : TOnThemeColorsChangedEvent;
|
||||
|
||||
procedure DestroyView; override;
|
||||
procedure Initialize; override;
|
||||
@ -82,6 +84,7 @@ type
|
||||
procedure doOnWindowDestroyed(const window_: ICefWindow);
|
||||
procedure doOnWindowActivationChanged(const window_: ICefWindow; active: boolean);
|
||||
procedure doOnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect);
|
||||
procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
|
||||
procedure doOnIsWindowModalDialog(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
|
||||
@ -89,13 +92,14 @@ type
|
||||
procedure doOnIsFrameless(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnWithStandardWindowButtons(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean);
|
||||
procedure doOnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
procedure doOnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnCanMaximize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnCanMinimize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnCanClose(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure doOnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
|
||||
procedure doOnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
|
||||
procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure doOnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
|
||||
// ICefViewDelegateEvents
|
||||
procedure doCreateCustomView; override;
|
||||
@ -331,6 +335,16 @@ type
|
||||
/// </summary>
|
||||
property OnWindowBoundsChanged : TOnWindowBoundsChangedEvent read FOnWindowBoundsChanged write FOnWindowBoundsChanged;
|
||||
/// <summary>
|
||||
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
|
||||
/// the transition occurs asynchronously with |is_competed| set to false (0)
|
||||
/// when the transition starts and true (1) after the transition completes. On
|
||||
/// other platforms the transition occurs synchronously with |is_completed|
|
||||
/// set to true (1) after the transition completes. With the Alloy runtime you
|
||||
/// must also implement ICefDisplayHandler.OnFullscreenModeChange to
|
||||
/// handle fullscreen transitions initiated by browser content.
|
||||
/// </summary>
|
||||
property OnWindowFullscreenTransition : TOnWindowFullscreenTransitionEvent read FOnWindowFullscreenTransition write FOnWindowFullscreenTransition;
|
||||
/// <summary>
|
||||
/// Return the parent for |window| or NULL if the |window| does not have a
|
||||
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
|
||||
/// to true (1) if |window| will be displayed as a menu, in which case it will
|
||||
@ -382,6 +396,16 @@ type
|
||||
/// </summary>
|
||||
property OnGetTitlebarHeight : TOnGetTitlebarHeightEvent read FOnGetTitlebarHeight write FOnGetTitlebarHeight;
|
||||
/// <summary>
|
||||
/// <para>Return whether the view should accept the initial mouse-down event,
|
||||
/// allowing it to respond to click-through behavior. If STATE_ENABLED is
|
||||
/// returned, the view will be sent a mouseDown: message for an initial mouse-
|
||||
/// down event, activating the view with one click, instead of clicking first
|
||||
/// to make the window active and then clicking the view.</para>
|
||||
/// <para>This function is only supported on macOS. For more details, refer to the
|
||||
/// documentation of acceptsFirstMouse.</para>
|
||||
/// </summary>
|
||||
property OnAcceptsFirstMouse : TOnAcceptsFirstMouseEvent read FOnAcceptsFirstMouse write FOnAcceptsFirstMouse;
|
||||
/// <summary>
|
||||
/// Return true (1) if |window| can be resized.
|
||||
/// </summary>
|
||||
property OnCanResize : TOnCanResizeEvent read FOnCanResize write FOnCanResize;
|
||||
@ -411,15 +435,34 @@ type
|
||||
/// </summary>
|
||||
property OnKeyEvent : TOnWindowKeyEventEvent read FOnKeyEvent write FOnKeyEvent;
|
||||
/// <summary>
|
||||
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
|
||||
/// the transition occurs asynchronously with |is_competed| set to false (0)
|
||||
/// when the transition starts and true (1) after the transition completes. On
|
||||
/// other platforms the transition occurs synchronously with |is_completed|
|
||||
/// set to true (1) after the transition completes. With the Alloy runtime you
|
||||
/// must also implement ICefDisplayHandler.OnFullscreenModeChange to
|
||||
/// handle fullscreen transitions initiated by browser content.
|
||||
/// <para>Called after the native/OS or Chrome theme for |window| has changed.
|
||||
/// |chrome_theme| will be true (1) if the notification is for a Chrome theme.</para>
|
||||
/// <para>Native/OS theme colors are configured globally and do not need to be
|
||||
/// customized for each Window individually. An example of a native/OS theme
|
||||
/// change that triggers this callback is when the user switches between dark
|
||||
/// and light mode during application lifespan. Native/OS theme changes can be
|
||||
/// disabled by passing the `--force-dark-mode` or `--force-light-mode`
|
||||
/// command-line flag.</para>
|
||||
/// <para>Chrome theme colors will be applied and this callback will be triggered
|
||||
/// if/when a BrowserView is added to the Window's component hierarchy. Chrome
|
||||
/// theme colors can be configured on a per-RequestContext basis using
|
||||
/// ICefRequestContext.SetChromeColorScheme or (Chrome runtime only) by
|
||||
/// visiting chrome://settings/manageProfile. Any theme changes using those
|
||||
/// mechanisms will also trigger this callback. Chrome theme colors will be
|
||||
/// persisted and restored from disk cache with the Chrome runtime, and with
|
||||
/// the Alloy runtime if persist_user_preferences is set to true (1) via
|
||||
/// CefSettings or ICefRequestContext Settings.</para>
|
||||
/// <para>This callback is not triggered on Window creation so clients that wish to
|
||||
/// customize the initial native/OS theme must call
|
||||
/// ICefWindow.SetThemeColor and ICefWindow.ThemeChanged before showing
|
||||
/// the first Window.</para>
|
||||
/// <para>Theme colors will be reset to standard values before this callback is
|
||||
/// called for the first affected Window. Call ICefWindow.SetThemeColor
|
||||
/// from inside this callback to override a standard color or add a custom
|
||||
/// color. ICefViewDelegate.OnThemeChanged will be called after this
|
||||
/// callback for the complete |window| component hierarchy.</para>
|
||||
/// </summary>
|
||||
property OnWindowFullscreenTransition : TOnWindowFullscreenTransitionEvent read FOnWindowFullscreenTransition write FOnWindowFullscreenTransition;
|
||||
property OnThemeColorsChanged : TOnThemeColorsChangedEvent read FOnThemeColorsChanged write FOnThemeColorsChanged;
|
||||
end;
|
||||
|
||||
{$IFDEF FPC}
|
||||
@ -469,6 +512,7 @@ begin
|
||||
FOnWindowDestroyed := nil;
|
||||
FOnWindowActivationChanged := nil;
|
||||
FOnWindowBoundsChanged := nil;
|
||||
FOnWindowFullscreenTransition := nil;
|
||||
FOnGetParentWindow := nil;
|
||||
FOnIsWindowModalDialog := nil;
|
||||
FOnGetInitialBounds := nil;
|
||||
@ -476,13 +520,13 @@ begin
|
||||
FOnIsFrameless := nil;
|
||||
FOnWithStandardWindowButtons := nil;
|
||||
FOnGetTitlebarHeight := nil;
|
||||
FOnAcceptsFirstMouse := nil;
|
||||
FOnCanResize := nil;
|
||||
FOnCanMaximize := nil;
|
||||
FOnCanMinimize := nil;
|
||||
FOnCanClose := nil;
|
||||
FOnAccelerator := nil;
|
||||
FOnKeyEvent := nil;
|
||||
FOnWindowFullscreenTransition := nil;
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.CreateTopLevelWindow;
|
||||
@ -573,6 +617,12 @@ begin
|
||||
FOnWindowBoundsChanged(self, window_, new_bounds);
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
begin
|
||||
if assigned(FOnWindowFullscreenTransition) then
|
||||
FOnWindowFullscreenTransition(self, window_, is_completed);
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
|
||||
begin
|
||||
if assigned(FOnGetParentWindow) then
|
||||
@ -615,6 +665,12 @@ begin
|
||||
FOnGetTitlebarHeight(self, window_, titlebar_height, aResult);
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.doOnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
begin
|
||||
if assigned(FOnAcceptsFirstMouse) then
|
||||
FOnAcceptsFirstMouse(self, window_, aResult);
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.doOnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
begin
|
||||
if assigned(FOnCanResize) then
|
||||
@ -651,10 +707,10 @@ begin
|
||||
FOnKeyEvent(self, window_, event, aResult);
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure TCEFWindowComponent.doOnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
begin
|
||||
if assigned(FOnWindowFullscreenTransition) then
|
||||
FOnWindowFullscreenTransition(self, window_, is_completed);
|
||||
if assigned(FOnThemeColorsChanged) then
|
||||
FOnThemeColorsChanged(self, window_, chrome_theme);
|
||||
end;
|
||||
|
||||
procedure TCEFWindowComponent.Show;
|
||||
|
@ -27,6 +27,7 @@ type
|
||||
procedure OnWindowDestroyed(const window_: ICefWindow);
|
||||
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean);
|
||||
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect);
|
||||
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
|
||||
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean);
|
||||
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
|
||||
@ -34,13 +35,14 @@ type
|
||||
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure OnWithStandardWindowButtons(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure OnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean);
|
||||
procedure OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
procedure OnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure OnCanMaximize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure OnCanMinimize(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean);
|
||||
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
|
||||
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
|
||||
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
|
||||
public
|
||||
/// <summary>
|
||||
@ -83,6 +85,16 @@ type
|
||||
/// </summary>
|
||||
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); virtual;
|
||||
/// <summary>
|
||||
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
|
||||
/// the transition occurs asynchronously with |is_competed| set to false (0)
|
||||
/// when the transition starts and true (1) after the transition completes. On
|
||||
/// other platforms the transition occurs synchronously with |is_completed|
|
||||
/// set to true (1) after the transition completes. With the Alloy runtime you
|
||||
/// must also implement ICefDisplayHandler.OnFullscreenModeChange to
|
||||
/// handle fullscreen transitions initiated by browser content.
|
||||
/// </summary>
|
||||
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); virtual;
|
||||
/// <summary>
|
||||
/// Return the parent for |window| or NULL if the |window| does not have a
|
||||
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
|
||||
/// to true (1) if |window| will be displayed as a menu, in which case it will
|
||||
@ -134,6 +146,16 @@ type
|
||||
/// </summary>
|
||||
procedure OnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean); virtual;
|
||||
/// <summary>
|
||||
/// <para>Return whether the view should accept the initial mouse-down event,
|
||||
/// allowing it to respond to click-through behavior. If STATE_ENABLED is
|
||||
/// returned, the view will be sent a mouseDown: message for an initial mouse-
|
||||
/// down event, activating the view with one click, instead of clicking first
|
||||
/// to make the window active and then clicking the view.</para>
|
||||
/// <para>This function is only supported on macOS. For more details, refer to the
|
||||
/// documentation of acceptsFirstMouse.</para>
|
||||
/// </summary>
|
||||
procedure OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState); virtual;
|
||||
/// <summary>
|
||||
/// Return true (1) if |window| can be resized.
|
||||
/// </summary>
|
||||
procedure OnCanResize(const window_: ICefWindow; var aResult : boolean); virtual;
|
||||
@ -163,15 +185,34 @@ type
|
||||
/// </summary>
|
||||
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean); virtual;
|
||||
/// <summary>
|
||||
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
|
||||
/// the transition occurs asynchronously with |is_competed| set to false (0)
|
||||
/// when the transition starts and true (1) after the transition completes. On
|
||||
/// other platforms the transition occurs synchronously with |is_completed|
|
||||
/// set to true (1) after the transition completes. With the Alloy runtime you
|
||||
/// must also implement ICefDisplayHandler.OnFullscreenModeChange to
|
||||
/// handle fullscreen transitions initiated by browser content.
|
||||
/// <para>Called after the native/OS or Chrome theme for |window| has changed.
|
||||
/// |chrome_theme| will be true (1) if the notification is for a Chrome theme.</para>
|
||||
/// <para>Native/OS theme colors are configured globally and do not need to be
|
||||
/// customized for each Window individually. An example of a native/OS theme
|
||||
/// change that triggers this callback is when the user switches between dark
|
||||
/// and light mode during application lifespan. Native/OS theme changes can be
|
||||
/// disabled by passing the `--force-dark-mode` or `--force-light-mode`
|
||||
/// command-line flag.</para>
|
||||
/// <para>Chrome theme colors will be applied and this callback will be triggered
|
||||
/// if/when a BrowserView is added to the Window's component hierarchy. Chrome
|
||||
/// theme colors can be configured on a per-RequestContext basis using
|
||||
/// ICefRequestContext.SetChromeColorScheme or (Chrome runtime only) by
|
||||
/// visiting chrome://settings/manageProfile. Any theme changes using those
|
||||
/// mechanisms will also trigger this callback. Chrome theme colors will be
|
||||
/// persisted and restored from disk cache with the Chrome runtime, and with
|
||||
/// the Alloy runtime if persist_user_preferences is set to true (1) via
|
||||
/// CefSettings or ICefRequestContext Settings.</para>
|
||||
/// <para>This callback is not triggered on Window creation so clients that wish to
|
||||
/// customize the initial native/OS theme must call
|
||||
/// ICefWindow.SetThemeColor and ICefWindow.ThemeChanged before showing
|
||||
/// the first Window.</para>
|
||||
/// <para>Theme colors will be reset to standard values before this callback is
|
||||
/// called for the first affected Window. Call ICefWindow.SetThemeColor
|
||||
/// from inside this callback to override a standard color or add a custom
|
||||
/// color. ICefViewDelegate.OnThemeChanged will be called after this
|
||||
/// callback for the complete |window| component hierarchy.</para>
|
||||
/// </summary>
|
||||
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); virtual;
|
||||
procedure OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer); virtual;
|
||||
/// <summary>
|
||||
/// Links the methods in the internal CEF record data pointer with the methods in this class.
|
||||
/// </summary>
|
||||
@ -200,6 +241,7 @@ type
|
||||
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
|
||||
procedure OnFocus(const view: ICefView); override;
|
||||
procedure OnBlur(const view: ICefView); override;
|
||||
procedure OnThemeChanged(const view: ICefView); override;
|
||||
|
||||
// ICefWindowDelegate
|
||||
procedure OnWindowCreated(const window_: ICefWindow); override;
|
||||
@ -207,6 +249,7 @@ type
|
||||
procedure OnWindowDestroyed(const window_: ICefWindow); override;
|
||||
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); override;
|
||||
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); override;
|
||||
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); override;
|
||||
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override;
|
||||
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean); override;
|
||||
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); override;
|
||||
@ -214,13 +257,14 @@ type
|
||||
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); override;
|
||||
procedure OnWithStandardWindowButtons(const window_: ICefWindow; var aResult : boolean); override;
|
||||
procedure OnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean); override;
|
||||
procedure OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState); override;
|
||||
procedure OnCanResize(const window_: ICefWindow; var aResult : boolean); override;
|
||||
procedure OnCanMaximize(const window_: ICefWindow; var aResult : boolean); override;
|
||||
procedure OnCanMinimize(const window_: ICefWindow; var aResult : boolean); override;
|
||||
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean); override;
|
||||
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean); override;
|
||||
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean); override;
|
||||
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); override;
|
||||
procedure OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer); override;
|
||||
|
||||
public
|
||||
/// <summary>
|
||||
@ -264,6 +308,11 @@ begin
|
||||
PCefWindowDelegate(FData)^.on_window_bounds_changed(PCefWindowDelegate(FData), CefGetData(window_), @new_bounds);
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateRef.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
begin
|
||||
PCefWindowDelegate(FData)^.on_window_fullscreen_transition(PCefWindowDelegate(FData), CefGetData(window_), ord(is_completed));
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateRef.OnGetParentWindow(const window_ : ICefWindow;
|
||||
var is_menu : boolean;
|
||||
var can_activate_menu : boolean;
|
||||
@ -311,6 +360,11 @@ begin
|
||||
aResult := (PCefWindowDelegate(FData)^.get_titlebar_height(PCefWindowDelegate(FData), CefGetData(window_), @titlebar_height) <> 0);
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateRef.OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
begin
|
||||
aResult := PCefWindowDelegate(FData)^.accepts_first_mouse(PCefWindowDelegate(FData), CefGetData(window_));
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateRef.OnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
begin
|
||||
aResult := (PCefWindowDelegate(FData)^.can_resize(PCefWindowDelegate(FData), CefGetData(window_)) <> 0);
|
||||
@ -341,9 +395,9 @@ begin
|
||||
aResult := (PCefWindowDelegate(FData)^.on_key_event(PCefWindowDelegate(FData), CefGetData(window_), @event) <> 0);
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateRef.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure TCefWindowDelegateRef.OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
begin
|
||||
PCefWindowDelegate(FData)^.on_window_fullscreen_transition(PCefWindowDelegate(FData), CefGetData(window_), ord(is_completed));
|
||||
PCefWindowDelegate(FData)^.on_theme_colors_changed(PCefWindowDelegate(FData), CefGetData(window_), chrome_theme);
|
||||
end;
|
||||
|
||||
class function TCefWindowDelegateRef.UnWrap(data: Pointer): ICefWindowDelegate;
|
||||
@ -636,6 +690,11 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateOwn.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateOwn.OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
|
||||
begin
|
||||
//
|
||||
@ -671,6 +730,11 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateOwn.OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateOwn.OnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
begin
|
||||
//
|
||||
@ -701,7 +765,7 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefWindowDelegateOwn.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure TCefWindowDelegateOwn.OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
@ -828,6 +892,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnThemeChanged(const view: ICefView);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefWindowDelegateEvents(FEvents).doOnThemeChanged(view);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomWindowDelegate.OnThemeChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnWindowCreated(const window_: ICefWindow);
|
||||
begin
|
||||
try
|
||||
@ -883,6 +958,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefWindowDelegateEvents(FEvents).doOnWindowFullscreenTransition(window_, is_completed);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomWindowDelegate.OnWindowFullscreenTransition', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
|
||||
begin
|
||||
try
|
||||
@ -960,6 +1046,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefWindowDelegateEvents(FEvents).doOnAcceptsFirstMouse(window_, aResult);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomWindowDelegate.OnAcceptsFirstMouse', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnCanResize(const window_: ICefWindow; var aResult : boolean);
|
||||
begin
|
||||
try
|
||||
@ -1026,17 +1123,15 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomWindowDelegate.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
|
||||
procedure TCustomWindowDelegate.OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
ICefWindowDelegateEvents(FEvents).doOnWindowFullscreenTransition(window_, is_completed);
|
||||
ICefWindowDelegateEvents(FEvents).doOnThemeColorsChanged(window_, chrome_theme);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomWindowDelegate.OnWindowFullscreenTransition', e) then raise;
|
||||
if CustomExceptionHandler('TCustomWindowDelegate.OnThemeColorsChanged', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 586,
|
||||
"InternalVersion" : 587,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "123.0.13"
|
||||
"Version" : "124.3.1"
|
||||
}
|
||||
],
|
||||
"UpdatePackageData" : {
|
||||
|
Loading…
Reference in New Issue
Block a user