1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-08-04 21:32:54 +02:00

Update to CEF 128.4.8

This commit is contained in:
Salvador Díaz Fau
2024-09-03 17:26:03 +02:00
parent ed52c6144c
commit 55a70a998e
338 changed files with 10558 additions and 16111 deletions

View File

@ -14,7 +14,6 @@ object Form1: TForm1
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '3.2.0.0'
object Splitter1: TSplitter
Left = 739
Height = 624
@ -95,17 +94,17 @@ object Form1: TForm1
Width = 294
Align = alTop
Caption = ' User agent '
ClientHeight = 55
ClientHeight = 54
ClientWidth = 290
ParentBackground = False
TabOrder = 0
object UserAgentCb: TComboBox
Left = 0
Height = 21
Height = 22
Top = 0
Width = 290
Align = alTop
ItemHeight = 13
ItemHeight = 14
ItemIndex = 0
Items.Strings = (
'Mozilla/5.0 (Linux; Android 11; M2102K1G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36'
@ -135,7 +134,7 @@ object Form1: TForm1
object OverrideUserAgentBtn: TButton
Left = 0
Height = 25
Top = 30
Top = 29
Width = 290
Align = alBottom
Caption = 'Override user agent'
@ -145,8 +144,8 @@ object Form1: TForm1
end
object EmulateTouchChk: TCheckBox
Left = 0
Height = 17
Top = 80
Height = 18
Top = 79
Width = 294
Align = alBottom
Caption = 'Emulate Touch'
@ -172,7 +171,7 @@ object Form1: TForm1
Width = 294
Align = alClient
Caption = ' Emulate device metrics '
ClientHeight = 187
ClientHeight = 186
ClientWidth = 290
ParentBackground = False
TabOrder = 0
@ -241,7 +240,7 @@ object Form1: TForm1
object OverrideDeviceMetricsBtn: TButton
Left = 0
Height = 25
Top = 162
Top = 161
Width = 290
Align = alBottom
Caption = 'Override device metrics'
@ -306,11 +305,11 @@ object Form1: TForm1
end
object OrientationCb: TComboBox
Left = 75
Height = 21
Height = 22
Top = 0
Width = 215
Align = alClient
ItemHeight = 13
ItemHeight = 14
ItemIndex = 0
Items.Strings = (
'Portrait Primary'
@ -420,7 +419,6 @@ object Form1: TForm1
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
OnDevToolsMethodResult = Chromium1DevToolsMethodResult
Left = 56

View File

@ -64,7 +64,6 @@ type
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);
@ -85,7 +84,6 @@ type
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 HandleSetUserAgentResult(aSuccess : boolean; const aResult: ICefValue);
procedure HandleSetTouchEmulationEnabledResult(aSuccess : boolean; const aResult: ICefValue);
@ -119,9 +117,8 @@ uses
// Destruction steps
// =================
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
// 1. FormCloseQuery sets CanClose to FALSE, destroys CEFWindowParent1 and calls TChromium.CloseBrowser which triggers the TChromium.OnBeforeClose event.
// 2. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
const
DEVTOOLS_SETUSERAGENTOVERRIDE_MSGID = 1;
@ -143,6 +140,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
CEFWindowParent1.Free;
end;
end;
@ -196,13 +194,6 @@ begin
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, 0, 0);
aAction := cbaDelay;
end;
procedure TForm1.Chromium1DevToolsMethodResult(Sender: TObject;
const browser: ICefBrowser; message_id: Integer; success: Boolean;
const result: ICefValue);
@ -255,11 +246,6 @@ begin
AddressPnl.Enabled := True;
end;
procedure TForm1.BrowserDestroyMsg(var aMessage : TMessage);
begin
CEFWindowParent1.Free;
end;
procedure TForm1.GoBtnClick(Sender: TObject);
begin
// This will load the URL in the edit box