diff --git a/README.md b/README.md
index 06f64ef6..547a9a07 100644
--- a/README.md
+++ b/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 127.3.5 which includes Chromium 127.0.6533.120.
+CEF4Delphi uses CEF 128.4.8 which includes Chromium 128.0.6613.114.
The CEF binaries used by CEF4Delphi are available for download at Spotify :
-* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_127.3.5%2Bg114ea2a%2Bchromium-127.0.6533.120_windows32.tar.bz2)
-* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_127.3.5%2Bg114ea2a%2Bchromium-127.0.6533.120_windows64.tar.bz2)
-* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_127.3.5%2Bg114ea2a%2Bchromium-127.0.6533.120_linux64.tar.bz2)
-* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_127.3.5%2Bg114ea2a%2Bchromium-127.0.6533.120_linuxarm.tar.bz2)
-* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_127.3.5%2Bg114ea2a%2Bchromium-127.0.6533.120_linuxarm64.tar.bz2)
-* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_127.3.5%2Bg114ea2a%2Bchromium-127.0.6533.120_macosx64.tar.bz2)
+* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_128.4.8%2Bg88b5034%2Bchromium-128.0.6613.114_windows32.tar.bz2)
+* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_128.4.8%2Bg88b5034%2Bchromium-128.0.6613.114_windows64.tar.bz2)
+* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_128.4.8%2Bg88b5034%2Bchromium-128.0.6613.114_linux64.tar.bz2)
+* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_128.4.8%2Bg88b5034%2Bchromium-128.0.6613.114_linuxarm.tar.bz2)
+* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_128.4.8%2Bg88b5034%2Bchromium-128.0.6613.114_linuxarm64.tar.bz2)
+* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_128.4.8%2Bg88b5034%2Bchromium-128.0.6613.114_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.4/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
diff --git a/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas b/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas
index 68565d32..652787da 100644
--- a/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas
+++ b/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas
@@ -350,7 +350,7 @@ begin
if aIndependent then
begin
TempCache := GlobalCEFApp.RootCache + '\cache' + inttostr(TBrowserTab(ParentTab).TabID);
- TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, False, FMXChromium1.ReqContextHandler)
+ TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, FMXChromium1.ReqContextHandler)
end
else
TempContext := nil;
@@ -364,7 +364,8 @@ begin
TempRect.Right := round(TempClientRect.Right * TempScale);
TempRect.Bottom := round(TempClientRect.Bottom * TempScale);
- FMXChromium1.DefaultUrl := FHomepage;
+ FMXChromium1.DefaultUrl := FHomepage;
+ FMXChromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
FMXChromium1.CreateBrowser(TempHandle, TempRect, '', TempContext);
{$ENDIF}
end;
diff --git a/demos/Delphi_FMX_Windows/FMXToolBoxBrowser/uChildForm.pas b/demos/Delphi_FMX_Windows/FMXToolBoxBrowser/uChildForm.pas
index 9dc06d13..813cb8e4 100644
--- a/demos/Delphi_FMX_Windows/FMXToolBoxBrowser/uChildForm.pas
+++ b/demos/Delphi_FMX_Windows/FMXToolBoxBrowser/uChildForm.pas
@@ -291,6 +291,8 @@ begin
FMXWindowParent := nil;
FHomepage := '';
+ FMXChromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
+
{$IFDEF MSWINDOWS}
FCustomWindowState := WindowState;
{$ENDIF}
diff --git a/demos/Delphi_FMX_Windows/SimpleFMXBrowser/uSimpleFMXBrowser.pas b/demos/Delphi_FMX_Windows/SimpleFMXBrowser/uSimpleFMXBrowser.pas
index c5a6266d..b25d505a 100644
--- a/demos/Delphi_FMX_Windows/SimpleFMXBrowser/uSimpleFMXBrowser.pas
+++ b/demos/Delphi_FMX_Windows/SimpleFMXBrowser/uSimpleFMXBrowser.pas
@@ -379,6 +379,8 @@ begin
FClosing := False;
FMXWindowParent := nil;
+ FMXChromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
+
{$IFDEF MSWINDOWS}
FCustomWindowState := WindowState;
{$ENDIF}
diff --git a/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.dfm b/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.dfm
index 5bf17a34..f98077f2 100644
--- a/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.dfm
+++ b/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.dfm
@@ -71,7 +71,6 @@ object CookieVisitorFrm: TCookieVisitorFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.pas b/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.pas
index 1758542e..838f1229 100644
--- a/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.pas
+++ b/demos/Delphi_VCL/CookieVisitor/uCookieVisitor.pas
@@ -39,7 +39,6 @@ type
procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags; out Result: Boolean);
procedure Chromium1CookiesDeleted(Sender: TObject; numDeleted: Integer);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1CookieSet(Sender: TObject; aSuccess: Boolean; aID: Integer);
procedure Chromium1CookieVisitorDestroyed(Sender: TObject; aID: Integer);
@@ -58,7 +57,6 @@ type
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 ShowCookiesMsg(var aMessage : TMessage); message MINIBROWSER_SHOWCOOKIES;
procedure CookiesDeletedMsg(var aMessage : TMessage); message MINIBROWSER_COOKIESDELETED;
procedure CookieSetMsg(var aMessage : TMessage); message MINIBROWSER_COOKIESET;
@@ -94,9 +92,8 @@ uses
// TChromium.DeleteCookies triggers TChromium.OnCookiesDeleted when the cookies have been deleted.
// 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.
procedure CreateGlobalCEFApp;
begin
@@ -118,11 +115,6 @@ begin
AddressBarPnl.Enabled := True;
end;
-procedure TCookieVisitorFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TCookieVisitorFrm.ShowCookiesMsg(var aMessage : TMessage);
begin
SimpleTextViewerFrm.Memo1.Lines.Text := FText; // This should be protected by a mutex.
@@ -195,13 +187,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 TCookieVisitorFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TCookieVisitorFrm.Chromium1ContextMenuCommand(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -300,6 +285,8 @@ begin
Visible := False;
Chromium1.CloseBrowser(True);
+
+ CEFWindowParent1.Free;
end;
end;
diff --git a/demos/Delphi_VCL/CustomResourceBrowser/uMainForm.pas b/demos/Delphi_VCL/CustomResourceBrowser/uMainForm.pas
index 7128e2a4..c13032ab 100644
--- a/demos/Delphi_VCL/CustomResourceBrowser/uMainForm.pas
+++ b/demos/Delphi_VCL/CustomResourceBrowser/uMainForm.pas
@@ -105,6 +105,8 @@ begin
FCanClose := False;
FClosing := False;
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
+
try
try
TempStream := TStringStream.Create('
test
', TEncoding.UTF8, false);
@@ -138,8 +140,11 @@ end;
procedure TMainForm.ChromiumWindow1BeforeClose(Sender: TObject);
begin
- FCanClose := True;
- PostMessage(Handle, WM_CLOSE, 0, 0);
+ if not(FCanClose) then
+ begin
+ FCanClose := True;
+ PostMessage(Handle, WM_CLOSE, 0, 0);
+ end;
end;
procedure TMainForm.ChromiumWindow1Close(Sender: TObject);
diff --git a/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.dfm b/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.dfm
index 881159ff..d1e86c9d 100644
--- a/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.dfm
+++ b/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.dfm
@@ -99,7 +99,6 @@ object DOMVisitorFrm: TDOMVisitorFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnDevToolsMethodResult = Chromium1DevToolsMethodResult
Left = 16
Top = 40
diff --git a/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.pas b/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.pas
index 7181bc24..b551c835 100644
--- a/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.pas
+++ b/demos/Delphi_VCL/DOMVisitor/uDOMVisitor.pas
@@ -74,7 +74,6 @@ type
procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags; out Result: Boolean);
procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1ConsoleMessage(Sender: TObject; const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer; out Result: Boolean);
procedure Chromium1DevToolsMethodResult(Sender: TObject; const browser: ICefBrowser; message_id: Integer; success: Boolean; const result: ICefValue);
@@ -101,7 +100,6 @@ type
procedure SetErrorText(const aValue : string);
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure VisitDOMMsg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_PARTIAL;
procedure VisitDOM2Msg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_FULL;
procedure VisitDOM3Msg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_JS;
@@ -210,12 +208,9 @@ 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
+// 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.
procedure SimpleDOMIteration(const aDocument: ICefDomDocument);
@@ -495,13 +490,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 TDOMVisitorFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TDOMVisitorFrm.Chromium1ConsoleMessage(Sender: TObject;
const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring;
line: Integer; out Result: Boolean);
@@ -731,6 +719,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -767,11 +756,6 @@ begin
GoBtn.Click;
end;
-procedure TDOMVisitorFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TDOMVisitorFrm.VisitDOMBtnClick(Sender: TObject);
begin
PostMessage(Handle, MINIBROWSER_VISITDOM_PARTIAL, 0, 0);
diff --git a/demos/Delphi_VCL/DualBrowser/uMainForm.dfm b/demos/Delphi_VCL/DualBrowser/uMainForm.dfm
index 1743ba69..e6ea8231 100644
--- a/demos/Delphi_VCL/DualBrowser/uMainForm.dfm
+++ b/demos/Delphi_VCL/DualBrowser/uMainForm.dfm
@@ -33,7 +33,6 @@ object MainForm: TMainForm
Align = alLeft
BevelOuter = bvNone
TabOrder = 0
- ExplicitHeight = 656
object CEFAddressPnl: TPanel
Left = 0
Top = 0
@@ -75,7 +74,6 @@ object MainForm: TMainForm
Align = alClient
Color = clWhite
TabOrder = 1
- ExplicitHeight = 626
end
end
object WVPnl: TPanel
@@ -87,8 +85,6 @@ object MainForm: TMainForm
BevelOuter = bvNone
ParentBackground = False
TabOrder = 1
- ExplicitWidth = 519
- ExplicitHeight = 656
object WVAddressPnl: TPanel
Left = 0
Top = 0
@@ -99,7 +95,6 @@ object MainForm: TMainForm
Padding.Top = 5
Padding.Bottom = 5
TabOrder = 0
- ExplicitWidth = 519
object WVAddressEdt: TEdit
Left = 0
Top = 5
@@ -109,7 +104,6 @@ object MainForm: TMainForm
Align = alClient
TabOrder = 0
Text = 'http://www.bing.com'
- ExplicitWidth = 488
ExplicitHeight = 21
end
object WVGoBtn: TButton
@@ -122,7 +116,6 @@ object MainForm: TMainForm
Caption = 'Go'
TabOrder = 1
OnClick = WVGoBtnClick
- ExplicitLeft = 488
end
end
object WVWindowParent1: TWVWindowParent
@@ -135,15 +128,12 @@ object MainForm: TMainForm
TabStop = True
TabOrder = 1
Browser = WVBrowser1
- ExplicitWidth = 519
- ExplicitHeight = 626
end
end
object Chromium1: TChromium
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
Left = 224
Top = 256
diff --git a/demos/Delphi_VCL/DualBrowser/uMainForm.pas b/demos/Delphi_VCL/DualBrowser/uMainForm.pas
index 75112484..57e9fdfd 100644
--- a/demos/Delphi_VCL/DualBrowser/uMainForm.pas
+++ b/demos/Delphi_VCL/DualBrowser/uMainForm.pas
@@ -43,7 +43,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);
@@ -63,7 +62,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;
public
{ Public declarations }
end;
@@ -98,9 +96,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure CreateGlobalCEFApp;
begin
@@ -123,6 +120,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end
else
@@ -171,13 +169,6 @@ begin
CEF_WOD_NEW_WINDOW]);
end;
-procedure TMainForm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.Chromium1OpenUrlFromTab(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition;
@@ -195,11 +186,6 @@ begin
CEFWindowParent1.UpdateSize;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.CEFGoBtnClick(Sender: TObject);
begin
if Chromium1.Initialized then
diff --git a/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.dfm b/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.dfm
index 09b4a50a..473b16aa 100644
--- a/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.dfm
+++ b/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.dfm
@@ -332,7 +332,6 @@ object EditorBrowserFrm: TEditorBrowserFrm
OnContextMenuCommand = Chromium1ContextMenuCommand
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 56
Top = 144
end
diff --git a/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.pas b/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.pas
index c82b49b8..228746d7 100644
--- a/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.pas
+++ b/demos/Delphi_VCL/EditorBrowser/uEditorBrowser.pas
@@ -69,7 +69,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 Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
procedure Chromium1TextResultAvailable(Sender: TObject; const aText: ustring);
@@ -115,7 +114,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;
public
{ Public declarations }
end;
@@ -143,9 +141,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.
procedure CreateGlobalCEFApp;
begin
@@ -179,6 +176,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -220,13 +218,6 @@ begin
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS, 'Show DevTools');
end;
-procedure TEditorBrowserFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TEditorBrowserFrm.Chromium1ContextMenuCommand(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -487,11 +478,6 @@ begin
Caption := 'Editor Browser';
end;
-procedure TEditorBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TEditorBrowserFrm.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
diff --git a/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.dfm b/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.dfm
index f58c3e6e..d1089886 100644
--- a/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.dfm
+++ b/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.dfm
@@ -93,7 +93,6 @@ object ExternalPumpBrowserFrm: TExternalPumpBrowserFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 56
Top = 152
end
diff --git a/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.pas b/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.pas
index ff3f202a..ec24e52b 100644
--- a/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.pas
+++ b/demos/Delphi_VCL/ExternalPumpBrowser/uExternalPumpBrowser.pas
@@ -32,7 +32,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: Boolean; var Result: Boolean);
@@ -41,7 +40,6 @@ type
FClosing : boolean;
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -68,9 +66,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.
procedure GlobalCEFApp_OnScheduleMessagePumpWork(const aDelayMS : int64);
begin
@@ -106,6 +103,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -141,12 +139,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 TExternalPumpBrowserFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TExternalPumpBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage);
begin
Caption := 'External Pump Browser';
@@ -155,11 +147,6 @@ begin
GoBtn.Click;
end;
-procedure TExternalPumpBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TExternalPumpBrowserFrm.GoBtnClick(Sender: TObject);
begin
Chromium1.LoadURL(URLCbx.Text);
diff --git a/demos/Delphi_VCL/FullScreenBrowser/uMainForm.dfm b/demos/Delphi_VCL/FullScreenBrowser/uMainForm.dfm
index e469810e..225c644b 100644
--- a/demos/Delphi_VCL/FullScreenBrowser/uMainForm.dfm
+++ b/demos/Delphi_VCL/FullScreenBrowser/uMainForm.dfm
@@ -32,7 +32,6 @@ object MainForm: TMainForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 208
Top = 120
end
diff --git a/demos/Delphi_VCL/FullScreenBrowser/uMainForm.pas b/demos/Delphi_VCL/FullScreenBrowser/uMainForm.pas
index 1bbe2fa0..a515cdf7 100644
--- a/demos/Delphi_VCL/FullScreenBrowser/uMainForm.pas
+++ b/demos/Delphi_VCL/FullScreenBrowser/uMainForm.pas
@@ -25,7 +25,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
@@ -45,7 +44,6 @@ type
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 HandleKeyUp(const aMsg : TMsg; var aHandled : boolean);
procedure HandleKeyDown(const aMsg : TMsg; var aHandled : boolean);
@@ -67,9 +65,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.
procedure CreateGlobalCEFApp;
begin
@@ -140,22 +137,11 @@ begin
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
end;
-procedure TMainForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
begin
CEFWindowParent1.UpdateSize;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.Chromium1KeyEvent(Sender: TObject;
const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
out Result: Boolean);
@@ -203,6 +189,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
diff --git a/demos/Delphi_VCL/JavaScript/CustomTitleBar/uCustomTitleBarExtension.pas b/demos/Delphi_VCL/JavaScript/CustomTitleBar/uCustomTitleBarExtension.pas
index bb89d070..d7ebe6b3 100644
--- a/demos/Delphi_VCL/JavaScript/CustomTitleBar/uCustomTitleBarExtension.pas
+++ b/demos/Delphi_VCL/JavaScript/CustomTitleBar/uCustomTitleBarExtension.pas
@@ -416,6 +416,7 @@ procedure TCTBForm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TCTBForm.BrowserDestroyMsg(var aMessage: TMessage);
diff --git a/demos/Delphi_VCL/JavaScript/JSDialog/uJSDialogBrowser.pas b/demos/Delphi_VCL/JavaScript/JSDialog/uJSDialogBrowser.pas
index a85c2634..3e7b8679 100644
--- a/demos/Delphi_VCL/JavaScript/JSDialog/uJSDialogBrowser.pas
+++ b/demos/Delphi_VCL/JavaScript/JSDialog/uJSDialogBrowser.pas
@@ -100,6 +100,7 @@ begin
FCallback := nil;
FCanClose := False;
FClosing := False;
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TJSDialogBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
diff --git a/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.dfm b/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.dfm
index 22b93d25..affe78e9 100644
--- a/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.dfm
@@ -12,6 +12,7 @@ object JSEvalFrm: TJSEvalFrm
Font.Style = []
Position = poScreenCenter
OnCloseQuery = FormCloseQuery
+ OnCreate = FormCreate
OnShow = FormShow
TextHeight = 13
object CEFWindowParent1: TCEFWindowParent
diff --git a/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.pas b/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.pas
index cfa19404..ceddffd4 100644
--- a/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.pas
+++ b/demos/Delphi_VCL/JavaScript/JSEval/uJSEval.pas
@@ -51,6 +51,7 @@ type
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: Boolean; var Result: Boolean);
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+ procedure FormCreate(Sender: TObject);
private
{ Private declarations }
@@ -202,6 +203,11 @@ begin
end;
end;
+procedure TJSEvalFrm.FormCreate(Sender: TObject);
+begin
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
+end;
+
procedure TJSEvalFrm.FormShow(Sender: TObject);
begin
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
diff --git a/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.dfm b/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.dfm
index cd0bb3e6..733ebda4 100644
--- a/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.dfm
@@ -66,7 +66,6 @@ object JSExecutingFunctionsFrm: TJSExecutingFunctionsFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas b/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas
index d40a5825..e368783e 100644
--- a/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas
+++ b/demos/Delphi_VCL/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas
@@ -41,7 +41,6 @@ type
procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags; out Result: Boolean);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -50,7 +49,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -85,9 +83,8 @@ implementation
// 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.
uses
uCEFProcessMessage, uMyV8Handler;
@@ -168,12 +165,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 TJSExecutingFunctionsFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExecutingFunctionsFrm.Chromium1ContextMenuCommand(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -202,6 +193,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -267,9 +259,4 @@ begin
GoBtn.Click;
end;
-procedure TJSExecutingFunctionsFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas b/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas
index cb7e83ba..ecb3f784 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas
+++ b/demos/Delphi_VCL/JavaScript/JSExtension/uJSExtension.pas
@@ -440,6 +440,7 @@ procedure TJSExtensionFrm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TJSExtensionFrm.FormShow(Sender: TObject);
diff --git a/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.dfm b/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.dfm
index 4a66e6db..2ec840b6 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.dfm
@@ -28,7 +28,6 @@ object JSExtensionFrm: TJSExtensionFrm
Padding.Right = 5
Padding.Bottom = 5
TabOrder = 0
- ExplicitWidth = 974
object Edit1: TEdit
Left = 5
Top = 5
@@ -38,7 +37,6 @@ object JSExtensionFrm: TJSExtensionFrm
Align = alClient
TabOrder = 0
Text = 'http://www.google.com'
- ExplicitWidth = 933
ExplicitHeight = 21
end
object GoBtn: TButton
@@ -51,7 +49,6 @@ object JSExtensionFrm: TJSExtensionFrm
Caption = 'Go'
TabOrder = 1
OnClick = GoBtnClick
- ExplicitLeft = 938
end
end
object StatusBar1: TStatusBar
@@ -63,8 +60,6 @@ object JSExtensionFrm: TJSExtensionFrm
item
Width = 50
end>
- ExplicitTop = 569
- ExplicitWidth = 974
end
object CEFWindowParent1: TCEFWindowParent
Left = 0
@@ -73,8 +68,6 @@ object JSExtensionFrm: TJSExtensionFrm
Height = 540
Align = alClient
TabOrder = 2
- ExplicitWidth = 974
- ExplicitHeight = 539
end
object Chromium1: TChromium
OnProcessMessageReceived = Chromium1ProcessMessageReceived
diff --git a/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.pas b/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.pas
index 376ce7c3..3c54b019 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.pas
+++ b/demos/Delphi_VCL/JavaScript/JSExtensionSubProcess/uJSExtension.pas
@@ -49,10 +49,7 @@ type
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: Boolean; var Result: Boolean);
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: TCefEventFlags; out Result: Boolean);
protected
FText : string;
@@ -294,7 +291,7 @@ end;
procedure TJSExtensionFrm.Chromium1ContextMenuCommand(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
+ eventFlags: TCefEventFlags; out Result: Boolean);
var
TempPoint : TPoint;
TempJSCode : string;
@@ -408,6 +405,7 @@ procedure TJSExtensionFrm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TJSExtensionFrm.FormShow(Sender: TObject);
diff --git a/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.dfm b/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.dfm
index 7ee0ac0a..830eb27e 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.dfm
@@ -74,7 +74,6 @@ object JSExtensionWithFunctionFrm: TJSExtensionWithFunctionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas b/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas
index 21a4978b..9f4302fc 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas
+++ b/demos/Delphi_VCL/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas
@@ -35,7 +35,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -44,7 +43,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -75,9 +73,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
{$IFDEF DELPHI12_UP}procedure
{$ELSE}class procedure TJSSimpleExtensionFrm.{$ENDIF}GlobalCEFApp_OnWebKitInitializedEvent;
@@ -140,13 +137,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 TJSExtensionWithFunctionFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExtensionWithFunctionFrm.Chromium1ProcessMessageReceived(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
sourceProcess: TCefProcessId; const message: ICefProcessMessage;
@@ -169,6 +159,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -228,9 +219,4 @@ begin
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := False;
end;
-procedure TJSExtensionWithFunctionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.dfm b/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.dfm
index 5a0cf9c3..68c2f537 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.dfm
@@ -63,7 +63,6 @@ object JSExtensionWithObjectParameterFrm: TJSExtensionWithObjectParameterFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas b/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas
index d0953595..6e3f9b3e 100644
--- a/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas
+++ b/demos/Delphi_VCL/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -42,7 +41,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -76,9 +74,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
{$IFDEF DELPHI12_UP}procedure
{$ELSE}class procedure TJSSimpleExtensionFrm.{$ENDIF}GlobalCEFApp_OnWebKitInitializedEvent;
@@ -145,13 +142,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 TJSExtensionWithObjectParameterFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExtensionWithObjectParameterFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -162,6 +152,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -221,9 +212,4 @@ begin
GoBtn.Click;
end;
-procedure TJSExtensionWithObjectParameterFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSRTTIExtension/uJSRTTIExtension.pas b/demos/Delphi_VCL/JavaScript/JSRTTIExtension/uJSRTTIExtension.pas
index e25edcb4..f6612833 100644
--- a/demos/Delphi_VCL/JavaScript/JSRTTIExtension/uJSRTTIExtension.pas
+++ b/demos/Delphi_VCL/JavaScript/JSRTTIExtension/uJSRTTIExtension.pas
@@ -321,6 +321,7 @@ procedure TJSRTTIExtensionFrm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TJSRTTIExtensionFrm.BrowserDestroyMsg(var aMessage : TMessage);
diff --git a/demos/Delphi_VCL/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas b/demos/Delphi_VCL/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas
index 90327c65..ef507f2c 100644
--- a/demos/Delphi_VCL/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas
+++ b/demos/Delphi_VCL/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas
@@ -245,6 +245,8 @@ begin
FClosing := False;
FCritSection := TCriticalSection.Create;
+
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
diff --git a/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.dfm b/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.dfm
index 0049afa3..c4a858ea 100644
--- a/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.dfm
@@ -63,7 +63,6 @@ object JSSimpleExtensionFrm: TJSSimpleExtensionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas b/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas
index e6f72683..61ef6c9e 100644
--- a/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas
+++ b/demos/Delphi_VCL/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -42,7 +41,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -73,9 +71,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
{$IFDEF DELPHI12_UP}procedure
{$ELSE}class procedure TJSSimpleExtensionFrm.{$ENDIF}GlobalCEFApp_OnWebKitInitializedEvent;
@@ -182,12 +179,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSSimpleExtensionFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSSimpleExtensionFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -198,6 +189,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -207,9 +199,4 @@ begin
FClosing := False;
end;
-procedure TJSSimpleExtensionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.dfm b/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.dfm
index 94eeb1ca..06a375a9 100644
--- a/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.dfm
@@ -63,7 +63,6 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas b/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas
index 98e469d3..88d58067 100644
--- a/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas
+++ b/demos/Delphi_VCL/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -42,7 +41,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -68,9 +66,8 @@ implementation
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
var
@@ -170,13 +167,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSSimpleWindowBindingFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSSimpleWindowBindingFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -187,6 +177,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -196,9 +187,4 @@ begin
FClosing := False;
end;
-procedure TJSSimpleWindowBindingFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.dfm b/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.dfm
index 94eeb1ca..06a375a9 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.dfm
@@ -63,7 +63,6 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas b/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas
index 05123204..4c46c9f5 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -43,7 +42,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -69,9 +67,8 @@ implementation
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure CreateGlobalCEFApp;
begin
@@ -171,13 +168,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSSimpleWindowBindingFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSSimpleWindowBindingFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -190,6 +180,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end
else
@@ -202,9 +193,4 @@ begin
FClosing := False;
end;
-procedure TJSSimpleWindowBindingFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/JSWindowBindingWithArrayBuffer.dproj b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/JSWindowBindingWithArrayBuffer.dproj
index a69b374a..c2e043cd 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/JSWindowBindingWithArrayBuffer.dproj
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/JSWindowBindingWithArrayBuffer.dproj
@@ -9,6 +9,7 @@
Win323Application
+ JSWindowBindingWithArrayBuffertrue
@@ -824,6 +825,9 @@
1
+
+ 1
+
@@ -1117,6 +1121,7 @@
+ True
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.dfm b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.dfm
index 8a4b599b..4db2f1d3 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.dfm
@@ -63,7 +63,6 @@ object JSWindowBindingWithArrayBufferFrm: TJSWindowBindingWithArrayBufferFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas
index 17c5445e..c1899904 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -42,7 +41,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -71,14 +69,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
-
-procedure FreeCustomArrayBufer(buffer : Pointer);
-begin
- if (buffer <> nil) then FreeMem(buffer);
-end;
+// 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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
const
@@ -86,27 +78,14 @@ const
BUFFER_FILL_VALUE = 42; // Some ramdom value to fill the buffer
var
TempObject : ICefv8Value;
- TempCallback : ICefv8ArrayBufferReleaseCallback;
TempBuffer : Pointer;
begin
- // The ArrayBuffer in this demo has a "buffer" pointer but CEF uses a callback to free it when the JS garbage collector is triggered.
- // The garbage collector calls ICefv8ArrayBufferReleaseCallback.ReleaseBuffer to free the buffer and
- // CEF4Delphi has a TCefFastv8ArrayBufferReleaseCallback class that calls a custom procedure when
- // ICefv8ArrayBufferReleaseCallback.ReleaseBuffer is called.
-
GetMem(TempBuffer, BUFFER_LENGTH);
FillChar(TempBuffer^, BUFFER_LENGTH, BUFFER_FILL_VALUE);
- // TempCallback will execute FreeCustomArrayBufer when the garbage collector needs to free the buffer inside the "ArrayBuffer".
- TempCallback := TCefFastv8ArrayBufferReleaseCallback.Create(FreeCustomArrayBufer);
- TempObject := TCefv8ValueRef.NewArrayBuffer(TempBuffer, BUFFER_LENGTH, TempCallback);
+ TempObject := TCefv8ValueRef.NewArrayBufferWithCopy(TempBuffer, BUFFER_LENGTH);
context.Global.SetValueByKey('myobj', TempObject, V8_PROPERTY_ATTRIBUTE_NONE);
-
- // If you keep a reference to "TempObject" and you need to free the buffer immediately then call TempObject.NeuterArrayBuffer
-
- // Read this for more information about ICefv8Value :
- // https://magpcss.org/ceforum/apidocs3/projects/(default)/CefV8Value.html
end;
procedure CreateGlobalCEFApp;
@@ -195,13 +174,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSWindowBindingWithArrayBufferFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSWindowBindingWithArrayBufferFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -212,6 +184,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -221,9 +194,4 @@ begin
FClosing := False;
end;
-procedure TJSWindowBindingWithArrayBufferFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.dfm b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.dfm
index 09284add..98f8d2d8 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.dfm
@@ -63,7 +63,6 @@ object JSWindowBindingWithFunctionFrm: TJSWindowBindingWithFunctionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas
index be29a989..5bee9f64 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -42,7 +41,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -71,9 +69,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
var
@@ -175,13 +172,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSWindowBindingWithFunctionFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSWindowBindingWithFunctionFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -192,6 +182,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -201,9 +192,4 @@ begin
FClosing := False;
end;
-procedure TJSWindowBindingWithFunctionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.dfm b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.dfm
index 13e6ce72..23437a0b 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.dfm
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.dfm
@@ -63,7 +63,6 @@ object JSWindowBindingWithObjectFrm: TJSWindowBindingWithObjectFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas
index 85a2bbea..9dd036c9 100644
--- a/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas
+++ b/demos/Delphi_VCL/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas
@@ -33,7 +33,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -42,7 +41,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -71,9 +69,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
var
@@ -176,13 +173,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSWindowBindingWithObjectFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSWindowBindingWithObjectFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -193,6 +183,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -202,9 +193,4 @@ begin
FClosing := False;
end;
-procedure TJSWindowBindingWithObjectFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/MDIBrowser/uChildForm.dfm b/demos/Delphi_VCL/MDIBrowser/uChildForm.dfm
index 8e3e520f..8e52032b 100644
--- a/demos/Delphi_VCL/MDIBrowser/uChildForm.dfm
+++ b/demos/Delphi_VCL/MDIBrowser/uChildForm.dfm
@@ -78,7 +78,6 @@ object ChildForm: TChildForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 592
Top = 288
end
diff --git a/demos/Delphi_VCL/MDIBrowser/uChildForm.pas b/demos/Delphi_VCL/MDIBrowser/uChildForm.pas
index 6c111763..a04c26c1 100644
--- a/demos/Delphi_VCL/MDIBrowser/uChildForm.pas
+++ b/demos/Delphi_VCL/MDIBrowser/uChildForm.pas
@@ -34,7 +34,6 @@ type
procedure Button1Click(Sender: TObject);
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 Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
procedure Chromium1StatusMessage(Sender: TObject; const browser: ICefBrowser; const value: ustring);
@@ -47,7 +46,6 @@ type
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEFBROWSER_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -63,9 +61,8 @@ implementation
// Destruction steps
// =================
-// 1. FormCloseQuery calls TChromium.CloseBrowser
-// 2. TChromium.OnClose sends a CEF_DESTROY message to destroy CEFWindowParent1 in the main thread.
-// 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.
uses
uCEFRequestContext, uCEFApplication;
@@ -99,12 +96,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 TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEFBROWSER_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
begin
if isLoading then
@@ -138,6 +129,7 @@ begin
FClosing := True;
Panel1.Enabled := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -176,7 +168,7 @@ begin
else
TempCache := GlobalCEFApp.RootCache + '\cache' + inttostr(MainForm.BrowserCount);
- TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, False, Chromium1.ReqContextHandler)
+ TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, Chromium1.ReqContextHandler)
end
else
TempContext := nil;
@@ -233,9 +225,4 @@ begin
Panel1.Enabled := True;
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.dfm b/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.dfm
index 8e3e520f..8e52032b 100644
--- a/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.dfm
+++ b/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.dfm
@@ -78,7 +78,6 @@ object ChildForm: TChildForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 592
Top = 288
end
diff --git a/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.pas b/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.pas
index 34a36e19..82c27c21 100644
--- a/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.pas
+++ b/demos/Delphi_VCL/MDIExternalPumpBrowser/uChildForm.pas
@@ -34,7 +34,6 @@ type
procedure FormDestroy(Sender: TObject);
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 Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
procedure Chromium1StatusMessage(Sender: TObject; const browser: ICefBrowser; const value: ustring);
@@ -47,7 +46,6 @@ type
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEFBROWSER_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -63,9 +61,8 @@ implementation
// Destruction steps
// =================
-// 1. FormCloseQuery calls TChromium.CloseBrowser
-// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread.
-// 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.
uses
uCEFRequestContext, uCEFApplication;
@@ -100,12 +97,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 TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEFBROWSER_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
begin
if isLoading then
@@ -139,6 +130,7 @@ begin
FClosing := True;
Panel1.Enabled := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -172,7 +164,7 @@ begin
TempCache := GlobalCEFApp.RootCache + '\cache2';
if MainForm.NewContextChk.Checked then
- TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, False)
+ TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False)
else
TempContext := nil;
@@ -214,9 +206,4 @@ begin
Button1.Click;
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.dfm b/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.dfm
index 9b2264c8..cd94483d 100644
--- a/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.dfm
+++ b/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.dfm
@@ -313,7 +313,6 @@ object MediaRouterFrm: TMediaRouterFrm
OnMediaSinkDeviceInfo = Chromium1MediaSinkDeviceInfo
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnSinks = Chromium1Sinks
OnRoutes = Chromium1Routes
OnRouteStateChanged = Chromium1RouteStateChanged
diff --git a/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.pas b/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.pas
index bb5314f7..190bd485 100644
--- a/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.pas
+++ b/demos/Delphi_VCL/MediaRouter/uMediaRouterFrm.pas
@@ -62,12 +62,11 @@ type
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
procedure Chromium1Sinks(Sender: TObject; const sinks: TCefMediaSinkArray);
procedure Chromium1Routes(Sender: TObject; const routes: TCefMediaRouteArray);
procedure Chromium1RouteStateChanged(Sender: TObject; const route: ICefMediaRoute; state: TCefMediaRouteConnectionState);
procedure Chromium1RouteMessageReceived(Sender: TObject; const route: ICefMediaRoute; const message_: ustring);
- procedure Chromium1MediaRouteCreateFinished(Sender: TObject; result: Integer; const error: ustring; const route: ICefMediaRoute);
+ procedure Chromium1MediaRouteCreateFinished(Sender: TObject; result: TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute);
procedure Chromium1MediaSinkDeviceInfo(Sender: TObject; const ip_address: ustring; port: Integer; const model_name: ustring);
procedure Timer1Timer(Sender: TObject);
@@ -93,7 +92,6 @@ type
FSinks : TCefMediaSinkInfoArray;
FRoutes : TCefMediaRouteInfoArray;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure PendingLogLinesMsg(var aMessage : TMessage); message MEDIA_ROUTER_PENDING_LOG_LINES;
procedure RefreshSinksMsg(var aMessage : TMessage); message MEDIA_ROUTER_REFRESH_SINKS;
procedure RefreshRoutesMsg(var aMessage : TMessage); message MEDIA_ROUTER_REFRESH_ROUTES;
@@ -200,15 +198,8 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TMediaRouterFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMediaRouterFrm.Chromium1MediaRouteCreateFinished(Sender: TObject;
- result: Integer; const error: ustring; const route: ICefMediaRoute);
+ result: TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute);
var
TempMsg, TempID : string;
begin
@@ -308,6 +299,7 @@ begin
Chromium1.ExecuteDevToolsMethod(0, 'Cast.disable', nil);
sleep(500);
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -319,6 +311,8 @@ begin
FRoutes := nil;
FMediaCS := TCriticalSection.Create;
FLog := TStringList.Create;
+
+ //Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TMediaRouterFrm.FormDestroy(Sender: TObject);
@@ -423,11 +417,6 @@ begin
Timer1.Enabled := True;
end;
-procedure TMediaRouterFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMediaRouterFrm.PendingLogLinesMsg(var aMessage : TMessage);
begin
if FClosing then exit;
diff --git a/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr b/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr
index 21f4a450..971e16d2 100644
--- a/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr
+++ b/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr
@@ -25,6 +25,8 @@ const
{$IFDEF WIN32}{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}{$ENDIF}
begin
+ ReportMemoryLeaksOnShutdown := True;
+
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
diff --git a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm
index 4d22812c..4ba998cd 100644
--- a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm
+++ b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm
@@ -306,7 +306,6 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnDownloadUpdated = Chromium1DownloadUpdated
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnCertificateError = Chromium1CertificateError
OnSelectClientCertificate = Chromium1SelectClientCertificate
OnBeforeResourceLoad = Chromium1BeforeResourceLoad
diff --git a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas
index 03189079..b13c3bd0 100644
--- a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas
+++ b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas
@@ -64,6 +64,7 @@ const
MINIBROWSER_CONTEXTMENU_COLORSCHEMESYSTEM = MENU_ID_USER_FIRST + 21;
MINIBROWSER_CONTEXTMENU_COLORSCHEMELIGHT = MENU_ID_USER_FIRST + 22;
MINIBROWSER_CONTEXTMENU_COLORSCHEMEDARK = MENU_ID_USER_FIRST + 23;
+ MINIBROWSER_CONTEXTMENU_TASKMANAGER = MENU_ID_USER_FIRST + 24;
DEVTOOLS_SCREENSHOT_MSGID = 1001;
DEVTOOLS_MHTML_MSGID = 1002;
@@ -155,7 +156,6 @@ type
procedure Chromium1BeforeDownload(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback; var aResult : boolean);
procedure Chromium1DownloadUpdated(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback);
procedure Chromium1BeforeResourceLoad(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback; out Result: TCefReturnValue);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1RenderCompMsg(Sender: TObject; var aMessage : TMessage; var aHandled: Boolean);
procedure Chromium1LoadingProgressChange(Sender: TObject; const browser: ICefBrowser; const progress: Double);
@@ -241,6 +241,8 @@ type
procedure ShowDevTools; overload;
procedure HideDevTools;
+ procedure ShowTaskManager;
+
procedure HandleKeyUp(const aMsg : TMsg; var aHandled : boolean);
procedure HandleKeyDown(const aMsg : TMsg; var aHandled : boolean);
procedure HandleBrowserInfo(const aResult : ICefValue);
@@ -254,7 +256,6 @@ type
function ShowSaveFileDialog(var aFilePaths : TStringList) : boolean;
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowDevToolsMsg(var aMessage : TMessage); message MINIBROWSER_SHOWDEVTOOLS;
procedure HideDevToolsMsg(var aMessage : TMessage); message MINIBROWSER_HIDEDEVTOOLS;
procedure CopyAllTextMsg(var aMessage : TMessage); message MINIBROWSER_COPYALLTEXT;
@@ -296,13 +297,12 @@ implementation
uses
uPreferences, uCefStringMultimap, uCEFMiscFunctions, uSimpleTextViewer,
uCEFClient, uFindFrm, uCEFDictionaryValue, uDirectorySelector, uSelectCertForm,
- uCEFWindowInfoWrapper;
+ uCEFWindowInfoWrapper, uCEFTaskManager;
// 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.
procedure GlobalCEFApp_OnUncaughtException(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace);
begin
@@ -327,7 +327,6 @@ begin
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
GlobalCEFApp.UncaughtExceptionStackSize := 50;
GlobalCEFApp.OnUncaughtException := GlobalCEFApp_OnUncaughtException;
- GlobalCEFApp.ChromeRuntime := True;
end;
procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject);
@@ -424,6 +423,7 @@ begin
model.AddItem(MINIBROWSER_CONTEXTMENU_JSPRINTDOC, 'Print using Javascript');
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWRESPONSE, 'Show server headers');
model.AddItem(MINIBROWSER_CONTEXTMENU_BROWSERINFO, 'Browser information...');
+ model.AddItem(MINIBROWSER_CONTEXTMENU_TASKMANAGER, 'Task Manager...');
if DevTools.Visible then
model.AddItem(MINIBROWSER_CONTEXTMENU_HIDEDEVTOOLS, 'Hide DevTools')
@@ -553,18 +553,6 @@ begin
Result := False;
end;
-procedure TMiniBrowserFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- if (browser <> nil) and
- (Chromium1.BrowserId = browser.Identifier) and
- (CEFWindowParent1 <> nil) then
- begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
- end;
-end;
-
procedure TMiniBrowserFrm.Chromium1ConsoleMessage(Sender: TObject;
const browser: ICefBrowser; level: TCefLogSeverity;
const message_, source: ustring; line: Integer; out Result: Boolean);
@@ -670,6 +658,9 @@ begin
MINIBROWSER_CONTEXTMENU_COLORSCHEMESYSTEM :
Chromium1.SetChromeColorScheme(CEF_COLOR_VARIANT_SYSTEM, 0);
+
+ MINIBROWSER_CONTEXTMENU_TASKMANAGER :
+ ShowTaskManager;
end
else
case commandId of
@@ -1438,10 +1429,7 @@ end;
procedure TMiniBrowserFrm.FindText1Click(Sender: TObject);
begin
- if GlobalCEFApp.ChromeRuntime then
- Chromium1.ExecuteChromeCommand(IDC_FIND, CEF_WOD_CURRENT_TAB)
- else
- FindFrm.Show;
+ Chromium1.ExecuteChromeCommand(IDC_FIND, CEF_WOD_CURRENT_TAB);
end;
procedure TMiniBrowserFrm.Flushcookies1Click(Sender: TObject);
@@ -1465,9 +1453,7 @@ begin
// stored browsers and not only the main browser.
Chromium1.CloseAllBrowsers;
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
@@ -1557,11 +1543,6 @@ begin
NavControlPnl.Enabled := True;
end;
-procedure TMiniBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- FreeAndNil(CEFWindowParent1);
-end;
-
procedure TMiniBrowserFrm.Acceptlanguage1Click(Sender: TObject);
var
TempLanguageList : ustring;
@@ -2018,6 +1999,54 @@ begin
end;
end;
+procedure TMiniBrowserFrm.ShowTaskManager;
+var
+ TempTaskManager : ICefTaskManager;
+ i : integer;
+ TempIDs: TCefCustomInt64Array;
+ TempInfo : TCustomTaskInfo;
+ TempResult : string;
+begin
+ TempTaskManager := TCefTaskManagerRef.New;
+
+ if assigned(TempTaskManager) and
+ TempTaskManager.GetTaskIdsList(TempIDs) then
+ begin
+ TempResult := 'Task Manager Information :' + CRLF + CRLF;
+ i := 0;
+
+ while (i < length(TempIDs)) do
+ begin
+ if TempTaskManager.GetTaskInfo(TempIDs[i], TempInfo) then
+ begin
+ TempResult := TempResult + 'id: ' + inttostr(TempInfo.id) + ', type: ';
+
+ case TempInfo.type_ of
+ CEF_TASK_TYPE_BROWSER : TempResult := TempResult + 'browser';
+ CEF_TASK_TYPE_GPU : TempResult := TempResult + 'GPU';
+ CEF_TASK_TYPE_ZYGOTE : TempResult := TempResult + 'zygote';
+ CEF_TASK_TYPE_UTILITY : TempResult := TempResult + 'utility';
+ CEF_TASK_TYPE_RENDERER : TempResult := TempResult + 'renderer';
+ CEF_TASK_TYPE_EXTENSION : TempResult := TempResult + 'extension';
+ CEF_TASK_TYPE_GUEST : TempResult := TempResult + 'guest';
+ CEF_TASK_TYPE_PLUGIN : TempResult := TempResult + 'plugin';
+ CEF_TASK_TYPE_SANDBOX_HELPER : TempResult := TempResult + 'sandbox helper';
+ CEF_TASK_TYPE_DEDICATED_WORKER : TempResult := TempResult + 'dedicated worker';
+ CEF_TASK_TYPE_SHARED_WORKER : TempResult := TempResult + 'shared worker';
+ CEF_TASK_TYPE_SERVICE_WORKER : TempResult := TempResult + 'service worker';
+ else TempResult := TempResult + 'unknown';
+ end;
+
+ TempResult := TempResult + ', title: ' + TempInfo.title + CRLF;
+ end;
+
+ inc(i);
+ end;
+
+ showmessage(TempResult);
+ end;
+end;
+
procedure TMiniBrowserFrm.WMMove(var aMessage : TWMMove);
begin
inherited;
diff --git a/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas b/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas
index e7dcbd95..4b706a3b 100644
--- a/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas
+++ b/demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas
@@ -341,6 +341,7 @@ begin
// used when you call any method or property in TChromium.
Chromium1.MultiBrowserMode := True;
Chromium1.DefaultURL := MINIBROWSER_HOMEPAGE;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TMiniBrowserFrm.FormShow(Sender: TObject);
diff --git a/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.dfm b/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.dfm
index dc27f4ef..7af2acbe 100644
--- a/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.dfm
+++ b/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.dfm
@@ -454,9 +454,6 @@ object Form1: TForm1
'https://coveryourtracks.eff.org/'
'https://ipleak.com/full-report/'
'https://xsinator.com/testing.html')
- ExplicitLeft = 392
- ExplicitTop = 16
- ExplicitWidth = 145
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -479,7 +476,6 @@ object Form1: TForm1
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
OnDevToolsMethodResult = Chromium1DevToolsMethodResult
Left = 56
diff --git a/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.pas b/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.pas
index 3572df49..ddf0a9ec 100644
--- a/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.pas
+++ b/demos/Delphi_VCL/MobileBrowser/uMobileBrowser.pas
@@ -62,7 +62,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);
@@ -83,7 +82,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);
@@ -113,9 +111,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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;
@@ -130,7 +127,6 @@ begin
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.EnableGPU := True;
- GlobalCEFApp.ChromeRuntime := True;
{$IFDEF DEBUG}
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
@@ -146,10 +142,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
@@ -203,13 +196,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);
@@ -262,11 +248,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
diff --git a/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.dfm b/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.dfm
index 131ddc81..b8ee1f48 100644
--- a/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.dfm
+++ b/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.dfm
@@ -94,7 +94,6 @@ object MainForm: TMainForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
OnDevToolsMethodResult = Chromium1DevToolsMethodResult
OnDevToolsRawEvent = Chromium1DevToolsRawEvent
diff --git a/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.pas b/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.pas
index 7d280079..db558405 100644
--- a/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.pas
+++ b/demos/Delphi_VCL/NetworkTrackerBrowser/uMainForm.pas
@@ -40,7 +40,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);
@@ -63,7 +62,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 AddLogLine(const aLogLine: string);
public
@@ -95,9 +93,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
@@ -108,6 +105,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -174,13 +172,6 @@ begin
CEF_WOD_NEW_WINDOW]);
end;
-procedure TMainForm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.Chromium1DevToolsMethodResult(Sender: TObject;
const browser: ICefBrowser; message_id: Integer; success: Boolean;
const result: ICefValue);
@@ -221,11 +212,6 @@ begin
AddressPnl.Enabled := True;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.GoBtnClick(Sender: TObject);
begin
// This will load the URL in the edit box
diff --git a/demos/Delphi_VCL/PopupBrowser/PopupBrowser.dproj b/demos/Delphi_VCL/PopupBrowser/PopupBrowser.dproj
index 600b3384..79826c95 100644
--- a/demos/Delphi_VCL/PopupBrowser/PopupBrowser.dproj
+++ b/demos/Delphi_VCL/PopupBrowser/PopupBrowser.dproj
@@ -6,9 +6,10 @@
PopupBrowser.dprTrue
Debug
- Win32
+ Win643Application
+ PopupBrowsertrue
@@ -827,6 +828,9 @@
1
+
+ 1
+
@@ -1120,6 +1124,7 @@
+ True
diff --git a/demos/Delphi_VCL/PopupBrowser/uChildForm.pas b/demos/Delphi_VCL/PopupBrowser/uChildForm.pas
index d12b57f6..2f336a86 100644
--- a/demos/Delphi_VCL/PopupBrowser/uChildForm.pas
+++ b/demos/Delphi_VCL/PopupBrowser/uChildForm.pas
@@ -672,9 +672,10 @@ begin
Chromium1.ShutdownDragAndDrop;
if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap);
+ if (FResizeCS <> nil) then FreeAndNil(FResizeCS);
- if FClientInitialized and TMainForm(Owner).HandleAllocated then
- PostMessage(TMainForm(Owner).Handle, CEF_CHILDDESTROYED, 0, 0);
+ if FClientInitialized and MainForm.HandleAllocated then
+ PostMessage(MainForm.Handle, CEF_CHILDDESTROYED, 0, 0);
end;
procedure TChildForm.FormHide(Sender: TObject);
diff --git a/demos/Delphi_VCL/PopupBrowser/uMainForm.pas b/demos/Delphi_VCL/PopupBrowser/uMainForm.pas
index bc82aeb0..ce130c15 100644
--- a/demos/Delphi_VCL/PopupBrowser/uMainForm.pas
+++ b/demos/Delphi_VCL/PopupBrowser/uMainForm.pas
@@ -46,6 +46,7 @@ type
protected
FChildForm : TChildForm;
FCriticalSection : TCriticalSection;
+ FChildCounter : cardinal; // Used to create unique child form names.
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosingMainForm : boolean; // Set to True in the CloseQuery event.
FClosingChildren : boolean; // Set to True in the CloseQuery event.
@@ -53,6 +54,7 @@ type
function GetPopupChildCount : integer;
procedure ClosePopupChildren;
+ procedure CreateChildForm;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -103,7 +105,7 @@ uses
// Destruction steps
// =================
// 1. FormCloseQuery sets CanClose to FALSE and it closes all child forms.
-// 2. When all the child forms are closed then FormCloseQuery is triggered again, sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
+// 2. When all the child forms are closed then FormCloseQuery is triggered again, calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 3. TChromium.OnClose sends a CEF_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 4. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
@@ -111,15 +113,7 @@ procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
- //GlobalCEFApp.LogFile := 'debug.log';
- //GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
- {
- GlobalCEFApp.FrameworkDirPath := 'c:\cef';
- GlobalCEFApp.ResourcesDirPath := 'c:\cef';
- GlobalCEFApp.LocalesDirPath := 'c:\cef\locales';
- GlobalCEFApp.cache := 'c:\cef\cache';
- GlobalCEFApp.UserDataPath := 'c:\cef\User Data';
- }
+ GlobalCEFApp.SetCurrentDir := True;
end;
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -154,6 +148,7 @@ begin
Chromium1.DefaultURL := AddressEdt.Text;
Chromium1.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
@@ -276,6 +271,18 @@ begin
end;
end;
+procedure TMainForm.CreateChildForm;
+begin
+ if (FChildCounter < high(cardinal)) then
+ inc(FChildCounter)
+ else
+ FChildCounter := 1;
+
+ FChildForm := TChildForm.Create(self);
+ FChildForm.Name := 'ChildForm_' + IntToStr(FChildCounter);
+ FChildForm.Tag := FChildCounter;
+end;
+
procedure TMainForm.AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
begin
case Msg.message of
@@ -291,7 +298,8 @@ end;
procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
begin
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
+
Caption := 'Popup Browser';
AddressPnl.Enabled := True;
end;
@@ -309,7 +317,7 @@ begin
if (FChildForm <> nil) then
PostMessage(FChildForm.Handle, CEF_SHOWCHILD, 0, 0);
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
finally
FCriticalSection.Release;
end;
@@ -317,7 +325,8 @@ end;
procedure TMainForm.ChildDestroyedMsg(var aMessage : TMessage);
begin
- if FClosingChildren and (PopupChildCount = 0) then Close;
+ if FClosingChildren and (PopupChildCount = 0) then
+ Close;
end;
procedure TMainForm.GoBtnClick(Sender: TObject);
diff --git a/demos/Delphi_VCL/PopupBrowser2/PopupBrowser2.dproj b/demos/Delphi_VCL/PopupBrowser2/PopupBrowser2.dproj
index 12c56a12..2354e605 100644
--- a/demos/Delphi_VCL/PopupBrowser2/PopupBrowser2.dproj
+++ b/demos/Delphi_VCL/PopupBrowser2/PopupBrowser2.dproj
@@ -9,6 +9,7 @@
Win323Application
+ PopupBrowser2true
@@ -827,6 +828,9 @@
1
+
+ 1
+
@@ -1120,6 +1124,7 @@
+ True
diff --git a/demos/Delphi_VCL/PopupBrowser2/uChildForm.dfm b/demos/Delphi_VCL/PopupBrowser2/uChildForm.dfm
index cd153fa4..1a6e64eb 100644
--- a/demos/Delphi_VCL/PopupBrowser2/uChildForm.dfm
+++ b/demos/Delphi_VCL/PopupBrowser2/uChildForm.dfm
@@ -28,7 +28,6 @@ object ChildForm: TChildForm
OnTitleChange = Chromium1TitleChange
OnBeforePopup = Chromium1BeforePopup
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 24
Top = 56
end
diff --git a/demos/Delphi_VCL/PopupBrowser2/uChildForm.pas b/demos/Delphi_VCL/PopupBrowser2/uChildForm.pas
index 1c730845..fb7745ff 100644
--- a/demos/Delphi_VCL/PopupBrowser2/uChildForm.pas
+++ b/demos/Delphi_VCL/PopupBrowser2/uChildForm.pas
@@ -23,12 +23,11 @@ type
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+ procedure FormClose(Sender: TObject; var Action: TCloseAction);
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: Boolean; var Result: Boolean);
procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -41,7 +40,6 @@ type
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 BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
public
procedure AfterConstruction; override;
@@ -143,12 +141,6 @@ begin
end;
end;
-procedure TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
begin
Caption := title;
@@ -196,10 +188,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
@@ -216,9 +205,4 @@ begin
PostMessage(TMainForm(Owner).Handle, CEF_CHILDDESTROYED, 0, 0);
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/PopupBrowser2/uMainForm.dfm b/demos/Delphi_VCL/PopupBrowser2/uMainForm.dfm
index dc4bcc56..7b4b0240 100644
--- a/demos/Delphi_VCL/PopupBrowser2/uMainForm.dfm
+++ b/demos/Delphi_VCL/PopupBrowser2/uMainForm.dfm
@@ -71,7 +71,6 @@ object MainForm: TMainForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 56
Top = 152
end
diff --git a/demos/Delphi_VCL/PopupBrowser2/uMainForm.pas b/demos/Delphi_VCL/PopupBrowser2/uMainForm.pas
index 2fd39e52..561868f2 100644
--- a/demos/Delphi_VCL/PopupBrowser2/uMainForm.pas
+++ b/demos/Delphi_VCL/PopupBrowser2/uMainForm.pas
@@ -39,11 +39,11 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
protected
FChildForm : TChildForm;
FCriticalSection : TCriticalSection;
+ FChildCounter : cardinal; // Used to create unique child form names.
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosingMainForm : boolean; // Set to True in the CloseQuery event.
FClosingChildren : boolean; // Set to True in the CloseQuery event.
@@ -51,6 +51,7 @@ type
function GetPopupChildCount : integer;
procedure ClosePopupChildren;
+ procedure CreateChildForm;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -58,7 +59,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 CreateNextChildMsg(var aMessage : TMessage); message CEF_CREATENEXTCHILD;
procedure ChildDestroyedMsg(var aMessage : TMessage); message CEF_CHILDDESTROYED;
@@ -101,14 +101,12 @@ uses
// Destruction steps
// =================
// 1. FormCloseQuery sets CanClose to FALSE and it closes all child forms.
-// 2. When all the child forms are closed then FormCloseQuery is triggered again, sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 3. TChromium.OnClose sends a CEF_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
-// 4. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
+// 2. When all the child forms are closed then FormCloseQuery is triggered again, destroys CEFWindowParent1 and calls TChromium.CloseBrowser 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.ChromeRuntime := True;
//GlobalCEFApp.LogFile := 'cef.log';
//GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
end;
@@ -132,10 +130,7 @@ begin
FClosingMainForm := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
end;
@@ -146,6 +141,7 @@ begin
FClosingMainForm := False;
FCanClose := False;
FCriticalSection := TCriticalSection.Create;
+ FChildCounter := 0;
Chromium1.DefaultURL := AddressEdt.Text;
Chromium1.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
@@ -205,12 +201,6 @@ begin
end;
end;
-procedure TMainForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
function TMainForm.CreateClientHandler(var windowInfo : TCefWindowInfo;
var client : ICefClient;
const targetFrameName : string;
@@ -271,16 +261,20 @@ begin
end;
end;
-procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
+procedure TMainForm.CreateChildForm;
begin
+ inc(FChildCounter);
+
FChildForm := TChildForm.Create(self);
- Caption := 'Popup Browser';
- AddressPnl.Enabled := True;
+ FChildForm.Name := 'ChildForm_' + IntToStr(FChildCounter);
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
+procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
begin
- CEFWindowParent1.Free;
+ CreateChildForm;
+
+ Caption := 'Popup Browser';
+ AddressPnl.Enabled := True;
end;
procedure TMainForm.CreateNextChildMsg(var aMessage : TMessage);
@@ -294,7 +288,7 @@ begin
FChildForm.Show;
end;
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
finally
FCriticalSection.Release;
end;
@@ -302,7 +296,8 @@ end;
procedure TMainForm.ChildDestroyedMsg(var aMessage : TMessage);
begin
- if FClosingChildren and (PopupChildCount = 0) then Close;
+ if FClosingChildren and (PopupChildCount = 0) then
+ Close;
end;
procedure TMainForm.GoBtnClick(Sender: TObject);
diff --git a/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.dfm b/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.dfm
index 878070f0..55b48bcf 100644
--- a/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.dfm
+++ b/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.dfm
@@ -91,7 +91,6 @@ object Form1: TForm1
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnBeforeResourceLoad = Chromium1BeforeResourceLoad
Left = 56
Top = 152
diff --git a/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.pas b/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.pas
index bfdc8a9d..ba2a6a77 100644
--- a/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.pas
+++ b/demos/Delphi_VCL/PostInspectorBrowser/uPostInspectorBrowser.pas
@@ -39,7 +39,6 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1BeforeResourceLoad(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback; out Result: TCefReturnValue);
@@ -59,7 +58,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 ShowDataMsg(var aMessage : TMessage); message CEF_SHOWDATA;
procedure HandleRequest(const request : ICefRequest; aIsMain : boolean);
@@ -93,9 +91,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure CreateGlobalCEFApp;
begin
@@ -113,6 +110,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -353,24 +351,12 @@ 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.BrowserCreatedMsg(var aMessage : TMessage);
begin
Caption := 'POST Inspector Browser';
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
diff --git a/demos/Delphi_VCL/ResponseFilterBrowser/uResponseFilterBrowser.pas b/demos/Delphi_VCL/ResponseFilterBrowser/uResponseFilterBrowser.pas
index 9f51347e..d90e4298 100644
--- a/demos/Delphi_VCL/ResponseFilterBrowser/uResponseFilterBrowser.pas
+++ b/demos/Delphi_VCL/ResponseFilterBrowser/uResponseFilterBrowser.pas
@@ -431,6 +431,8 @@ begin
// This event will receive the data
TCustomResponseFilter(FFilter).OnFilter := Filter_OnFilter;
+
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TResponseFilterBrowserFrm.FormDestroy(Sender: TObject);
diff --git a/demos/Delphi_VCL/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas b/demos/Delphi_VCL/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas
index 100ddba8..33fea5e3 100644
--- a/demos/Delphi_VCL/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas
+++ b/demos/Delphi_VCL/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas
@@ -205,6 +205,7 @@ procedure TSchemeRegistrationBrowserFrm.FormCreate(Sender: TObject);
begin
// You can register the Scheme Handler Factory here or later, for example in a context menu command.
CefRegisterSchemeHandlerFactory(CUSTOM_SCHEME_NAME, '', THelloScheme);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TSchemeRegistrationBrowserFrm.FormShow(Sender: TObject);
diff --git a/demos/Delphi_VCL/SimpleBrowser/uSimpleBrowser.pas b/demos/Delphi_VCL/SimpleBrowser/uSimpleBrowser.pas
index 15227003..3e804201 100644
--- a/demos/Delphi_VCL/SimpleBrowser/uSimpleBrowser.pas
+++ b/demos/Delphi_VCL/SimpleBrowser/uSimpleBrowser.pas
@@ -103,7 +103,8 @@ begin
FClosing := False;
// The browser will load the URL in AddressEdt initially.
- ChromiumWindow1.ChromiumBrowser.DefaultURL := AddressEdt.Text;
+ ChromiumWindow1.ChromiumBrowser.DefaultURL := AddressEdt.Text;
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.FormShow(Sender: TObject);
diff --git a/demos/Delphi_VCL/SimpleBrowser2/SimpleBrowser2.res b/demos/Delphi_VCL/SimpleBrowser2/SimpleBrowser2.res
index 02828828..0b905468 100644
Binary files a/demos/Delphi_VCL/SimpleBrowser2/SimpleBrowser2.res and b/demos/Delphi_VCL/SimpleBrowser2/SimpleBrowser2.res differ
diff --git a/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.dfm b/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.dfm
index d5868554..bfad9490 100644
--- a/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.dfm
+++ b/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.dfm
@@ -70,7 +70,6 @@ object Form1: TForm1
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
Left = 56
Top = 152
diff --git a/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.pas b/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.pas
index 54396340..f4b86bfc 100644
--- a/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.pas
+++ b/demos/Delphi_VCL/SimpleBrowser2/uSimpleBrowser2.pas
@@ -32,7 +32,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);
@@ -50,7 +49,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;
public
{ Public declarations }
end;
@@ -83,9 +81,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure CreateGlobalCEFApp;
begin
@@ -93,7 +90,6 @@ begin
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.EnableGPU := True;
- GlobalCEFApp.ChromeRuntime := True;
{$IFDEF DEBUG}
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
@@ -109,10 +105,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
@@ -159,13 +152,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.Chromium1OpenUrlFromTab(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition;
@@ -181,11 +167,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
diff --git a/demos/Delphi_VCL/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas b/demos/Delphi_VCL/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas
index 50637a85..4ea3ba73 100644
--- a/demos/Delphi_VCL/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas
+++ b/demos/Delphi_VCL/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas
@@ -90,6 +90,8 @@ procedure TSimpleExternalPumpBrowserFrm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TSimpleExternalPumpBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
diff --git a/demos/Delphi_VCL/SubProcess/uSimpleBrowser.dfm b/demos/Delphi_VCL/SubProcess/uSimpleBrowser.dfm
index d0a52f95..1b491045 100644
--- a/demos/Delphi_VCL/SubProcess/uSimpleBrowser.dfm
+++ b/demos/Delphi_VCL/SubProcess/uSimpleBrowser.dfm
@@ -13,6 +13,7 @@ object Form1: TForm1
Position = poScreenCenter
OnActivate = FormActivate
OnCloseQuery = FormCloseQuery
+ OnCreate = FormCreate
TextHeight = 13
object ChromiumWindow1: TChromiumWindow
Left = 0
diff --git a/demos/Delphi_VCL/SubProcess/uSimpleBrowser.pas b/demos/Delphi_VCL/SubProcess/uSimpleBrowser.pas
index 92e679d5..3e1a76bf 100644
--- a/demos/Delphi_VCL/SubProcess/uSimpleBrowser.pas
+++ b/demos/Delphi_VCL/SubProcess/uSimpleBrowser.pas
@@ -31,6 +31,7 @@ type
procedure ChromiumWindow1AfterCreated(Sender: TObject);
procedure ChromiumWindow1Close(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
private
// You have to handle this two messages to call NotifyMoveOrResizeStarted or some page elements will be misaligned.
@@ -92,6 +93,11 @@ begin
CanClose := True;
end;
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
+end;
+
procedure TForm1.FormActivate(Sender: TObject);
begin
if ChromiumWindow1.Initialized then
diff --git a/demos/Delphi_VCL/TabbedBrowser/uMainForm.pas b/demos/Delphi_VCL/TabbedBrowser/uMainForm.pas
index 5a87ce61..9c43a24d 100644
--- a/demos/Delphi_VCL/TabbedBrowser/uMainForm.pas
+++ b/demos/Delphi_VCL/TabbedBrowser/uMainForm.pas
@@ -35,17 +35,19 @@ type
URLCbx: TComboBox;
AddTabBtn: TButton;
RemoveTabBtn: TButton;
+
+ procedure FormCreate(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+ procedure PageControl1Change(Sender: TObject);
procedure AddTabBtnClick(Sender: TObject);
procedure RemoveTabBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure PageControl1Change(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure BackBtnClick(Sender: TObject);
procedure ForwardBtnClick(Sender: TObject);
procedure ReloadBtnClick(Sender: TObject);
procedure StopBtnClick(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
protected
FClosingTab : boolean;
@@ -147,6 +149,7 @@ begin
TempChromium.OnClose := Chromium_OnClose;
TempChromium.OnBeforeClose := Chromium_OnBeforeClose;
TempChromium.OnBeforePopup := Chromium_OnBeforePopup;
+ TempChromium.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
TempChromium.CreateBrowser(TempWindowParent, '');
end;
diff --git a/demos/Delphi_VCL/TabbedBrowser2/uBrowserFrame.pas b/demos/Delphi_VCL/TabbedBrowser2/uBrowserFrame.pas
index ce7c21bc..a6484404 100644
--- a/demos/Delphi_VCL/TabbedBrowser2/uBrowserFrame.pas
+++ b/demos/Delphi_VCL/TabbedBrowser2/uBrowserFrame.pas
@@ -272,7 +272,8 @@ end;
procedure TBrowserFrame.CreateBrowser;
begin
- Chromium1.DefaultURL := FHomepage;
+ Chromium1.DefaultURL := FHomepage;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
Chromium1.CreateBrowser(CEFWindowParent1);
end;
@@ -283,10 +284,6 @@ begin
FClosing := True;
NavControlPnl.Enabled := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
end;
end;
diff --git a/demos/Delphi_VCL/TabbedBrowser2/uChildForm.pas b/demos/Delphi_VCL/TabbedBrowser2/uChildForm.pas
index b57cd65d..dfbf0947 100644
--- a/demos/Delphi_VCL/TabbedBrowser2/uChildForm.pas
+++ b/demos/Delphi_VCL/TabbedBrowser2/uChildForm.pas
@@ -235,10 +235,6 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
end;
end
else
@@ -251,6 +247,8 @@ begin
FBrowserWasCreated := False;
FCanClose := False;
FClosing := False;
+
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TChildForm.FormDestroy(Sender: TObject);
diff --git a/demos/Delphi_VCL/TabbedBrowser2/uMainForm.pas b/demos/Delphi_VCL/TabbedBrowser2/uMainForm.pas
index fa6b017f..ad474429 100644
--- a/demos/Delphi_VCL/TabbedBrowser2/uMainForm.pas
+++ b/demos/Delphi_VCL/TabbedBrowser2/uMainForm.pas
@@ -43,6 +43,7 @@ type
FHiddenTab : TBrowserTab;
FChildForm : TChildForm;
FCriticalSection : TCriticalSection;
+ FChildCounter : cardinal; // Used to create unique child form names.
FCanClose : boolean;
FClosing : boolean; // Set to True in the CloseQuery event.
FLastTabID : cardinal; // Used by NextTabID to generate unique tab IDs
@@ -56,6 +57,7 @@ type
function CloseAllBrowsers : boolean;
procedure CloseTab(aIndex : integer);
procedure CreateHiddenBrowsers;
+ procedure CreateChildForm;
procedure CEFInitializedMsg(var aMessage : TMessage); message CEF_INITIALIZED;
procedure DestroyTabMsg(var aMessage : TMessage); message CEF_DESTROYTAB;
@@ -157,7 +159,6 @@ begin
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.ChromeRuntime := True;
end;
procedure TMainForm.EnableButtonPnl;
@@ -275,6 +276,15 @@ begin
end;
end;
+procedure TMainForm.CreateChildForm;
+begin
+ inc(FChildCounter);
+
+ FChildForm := TChildForm.Create(self);
+ FChildForm.Name := 'ChildForm_' + IntToStr(FChildCounter);
+end;
+
+
procedure TMainForm.CreateNextChildMsg(var aMessage : TMessage);
begin
try
@@ -291,7 +301,7 @@ begin
FChildForm.Show;
end;
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
finally
FCriticalSection.Release;
end;
@@ -346,6 +356,7 @@ begin
FLastTabID := 0;
FChildForm := nil;
FHiddenTab := nil;
+ FChildCounter := 0;
FCriticalSection := TCriticalSection.Create;
end;
@@ -419,7 +430,7 @@ begin
FCriticalSection.Acquire;
if (FChildForm = nil) then
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
if (FHiddenTab = nil) then
begin
@@ -495,61 +506,55 @@ function TMainForm.DoOnBeforePopup(var windowInfo : TCefWindowInfo;
const popupFeatures : TCefPopupFeatures;
targetDisposition : TCefWindowOpenDisposition) : boolean;
begin
- if GlobalCEFApp.ChromeRuntime then
- Result := False
- else
- try
- FCriticalSection.Acquire;
+ try
+ FCriticalSection.Acquire;
- case targetDisposition of
- CEF_WOD_NEW_FOREGROUND_TAB,
- CEF_WOD_NEW_BACKGROUND_TAB :
- Result := (FHiddenTab <> nil) and
- FHiddenTab.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
- PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(False));
+ case targetDisposition of
+ CEF_WOD_NEW_FOREGROUND_TAB,
+ CEF_WOD_NEW_BACKGROUND_TAB :
+ Result := (FHiddenTab <> nil) and
+ FHiddenTab.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
+ PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(False));
- CEF_WOD_NEW_WINDOW,
- CEF_WOD_NEW_POPUP :
- Result := (FChildForm <> nil) and
- FChildForm.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
- PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(False));
+ CEF_WOD_NEW_WINDOW,
+ CEF_WOD_NEW_POPUP :
+ Result := (FChildForm <> nil) and
+ FChildForm.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
+ PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(False));
- else Result := False;
- end;
- finally
- FCriticalSection.Release;
+ else Result := False;
end;
+ finally
+ FCriticalSection.Release;
+ end;
end;
function TMainForm.DoOpenUrlFromTab(const targetUrl : string;
targetDisposition : TCefWindowOpenDisposition) : boolean;
begin
- if GlobalCEFApp.ChromeRuntime then
- Result := True
- else
- try
- FCriticalSection.Acquire;
+ try
+ FCriticalSection.Acquire;
- case targetDisposition of
- CEF_WOD_NEW_FOREGROUND_TAB,
- CEF_WOD_NEW_BACKGROUND_TAB :
- begin
- FPendingURL := targetUrl;
- Result := PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(True));
- end;
+ case targetDisposition of
+ CEF_WOD_NEW_FOREGROUND_TAB,
+ CEF_WOD_NEW_BACKGROUND_TAB :
+ begin
+ FPendingURL := targetUrl;
+ Result := PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(True));
+ end;
- CEF_WOD_NEW_WINDOW,
- CEF_WOD_NEW_POPUP :
- begin
- FPendingURL := targetUrl;
- Result := PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(True));
- end
+ CEF_WOD_NEW_WINDOW,
+ CEF_WOD_NEW_POPUP :
+ begin
+ FPendingURL := targetUrl;
+ Result := PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(True));
+ end
- else Result := False;
- end;
- finally
- FCriticalSection.Release;
+ else Result := False;
end;
+ finally
+ FCriticalSection.Release;
+ end;
end;
end.
diff --git a/demos/Delphi_VCL/TinyBrowser/uTinyBrowser.pas b/demos/Delphi_VCL/TinyBrowser/uTinyBrowser.pas
index 95a61523..9cd39553 100644
--- a/demos/Delphi_VCL/TinyBrowser/uTinyBrowser.pas
+++ b/demos/Delphi_VCL/TinyBrowser/uTinyBrowser.pas
@@ -255,9 +255,8 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- GlobalCEFApp.ChromeRuntime := True; // Enable this line to test the new "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
diff --git a/demos/Delphi_VCL/TinyBrowser2/uTinyBrowser2.pas b/demos/Delphi_VCL/TinyBrowser2/uTinyBrowser2.pas
index 2b129825..23a3516c 100644
--- a/demos/Delphi_VCL/TinyBrowser2/uTinyBrowser2.pas
+++ b/demos/Delphi_VCL/TinyBrowser2/uTinyBrowser2.pas
@@ -72,15 +72,10 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.DisablePopupBlocking := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
-
- // This is a workaround for the CEF4Delphi issue #324 :
- // https://github.com/salvadordf/CEF4Delphi/issues/324
- GlobalCEFApp.DisableFeatures := 'WinUseBrowserSpellChecker';
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
diff --git a/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.dfm b/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.dfm
index 99874743..4f2c5f65 100644
--- a/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.dfm
+++ b/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.dfm
@@ -32,7 +32,6 @@ object ChildForm: TChildForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 184
Top = 128
end
diff --git a/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.pas b/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.pas
index af5fba8a..146dfee7 100644
--- a/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.pas
+++ b/demos/Delphi_VCL/ToolBoxBrowser/uChildForm.pas
@@ -28,7 +28,6 @@ type
procedure FormDestroy(Sender: TObject);
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1PreKeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
procedure Chromium1KeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out Result: Boolean);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
@@ -42,7 +41,6 @@ type
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEFBROWSER_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -65,9 +63,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery calls TChromium.CloseBrowser
-// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread.
-// 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.
procedure TChildForm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
@@ -93,12 +90,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 TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEFBROWSER_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1KeyEvent(Sender: TObject;
const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
out Result: Boolean);
@@ -179,6 +170,7 @@ begin
begin
FClosing := True;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -234,9 +226,4 @@ begin
Chromium1.LoadURL(FHomepage);
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj b/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj
index 09754cf4..4e6a2596 100644
--- a/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj
+++ b/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj
@@ -9,6 +9,7 @@
Win323Application
+ ToolBoxBrowser2true
@@ -819,6 +820,9 @@
1
+
+ 1
+
@@ -1112,6 +1116,7 @@
+ True
diff --git a/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.dfm b/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.dfm
index 99874743..4f2c5f65 100644
--- a/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.dfm
+++ b/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.dfm
@@ -32,7 +32,6 @@ object ChildForm: TChildForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 184
Top = 128
end
diff --git a/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.pas b/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.pas
index 29b68b32..6f3374ae 100644
--- a/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.pas
+++ b/demos/Delphi_VCL/ToolBoxSubProcessBrowser/uChildForm.pas
@@ -28,7 +28,6 @@ type
procedure FormDestroy(Sender: TObject);
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1PreKeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
procedure Chromium1KeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out Result: Boolean);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
@@ -42,7 +41,6 @@ type
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEFBROWSER_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -65,9 +63,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery calls TChromium.CloseBrowser
-// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread.
-// 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.
procedure TChildForm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
@@ -93,12 +90,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 TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEFBROWSER_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1KeyEvent(Sender: TObject;
const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
out Result: Boolean);
@@ -179,7 +170,10 @@ begin
FClosing := True;
if Chromium1.Initialized then
- Chromium1.CloseBrowser(True)
+ begin
+ Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
+ end
else
CanClose := True;
end;
@@ -240,9 +234,4 @@ begin
Chromium1.LoadURL(FHomepage);
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Linux_Console/LibraryBrowser/librarybrowser_sp.lpr b/demos/Lazarus_Linux_Console/LibraryBrowser/librarybrowser_sp.lpr
index e3c03235..dce65d57 100644
--- a/demos/Lazarus_Linux_Console/LibraryBrowser/librarybrowser_sp.lpr
+++ b/demos/Lazarus_Linux_Console/LibraryBrowser/librarybrowser_sp.lpr
@@ -14,7 +14,6 @@ begin
GlobalCEFApp.ShowMessageDlg := False;
GlobalCEFApp.BlinkSettings := 'hideScrollbars';
GlobalCEFApp.SetCurrentDir := True;
- GlobalCEFApp.ChromeRuntime := True;
GlobalCEFApp.StartSubProcess;
DestroyGlobalCEFApp;
end.
diff --git a/demos/Lazarus_Linux_Console/LibraryBrowser/ucefbrowserthread.pas b/demos/Lazarus_Linux_Console/LibraryBrowser/ucefbrowserthread.pas
index c4842ad8..f8aa4715 100644
--- a/demos/Lazarus_Linux_Console/LibraryBrowser/ucefbrowserthread.pas
+++ b/demos/Lazarus_Linux_Console/LibraryBrowser/ucefbrowserthread.pas
@@ -108,7 +108,6 @@ begin
GlobalCEFApp.BlinkSettings := 'hideScrollbars'; // This setting removes all scrollbars to capture a cleaner snapshot
GlobalCEFApp.SetCurrentDir := True;
GlobalCEFApp.DisableZygote := True;
- GlobalCEFApp.ChromeRuntime := True;
GlobalCEFApp.StartMainProcess;
end;
diff --git a/demos/Lazarus_Linux_GTK2/ExternalPumpBrowser/uExternalPumpBrowser.pas b/demos/Lazarus_Linux_GTK2/ExternalPumpBrowser/uExternalPumpBrowser.pas
index 5f9d5d6a..b4ea3330 100644
--- a/demos/Lazarus_Linux_GTK2/ExternalPumpBrowser/uExternalPumpBrowser.pas
+++ b/demos/Lazarus_Linux_GTK2/ExternalPumpBrowser/uExternalPumpBrowser.pas
@@ -123,7 +123,8 @@ begin
FCanClose := False;
FClosing := False;
- Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.GoBtnClick(Sender: TObject);
diff --git a/demos/Lazarus_Linux_GTK2/MiniBrowser/uMiniBrowser.pas b/demos/Lazarus_Linux_GTK2/MiniBrowser/uMiniBrowser.pas
index b597e9f3..1225d78e 100644
--- a/demos/Lazarus_Linux_GTK2/MiniBrowser/uMiniBrowser.pas
+++ b/demos/Lazarus_Linux_GTK2/MiniBrowser/uMiniBrowser.pas
@@ -229,7 +229,6 @@ begin
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
GlobalCEFApp.EnablePrintPreview := True;
- GlobalCEFApp.ChromeRuntime := True;
end;
{Property setters and getters}
@@ -520,6 +519,7 @@ begin
// used when you call any method or property in TChromium.
Chromium1.MultiBrowserMode := True;
Chromium1.DefaultURL := UTF8Decode(URLCbx.Text);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
// WebRTC's IP leaking can lowered/avoided by setting these preferences
// To test this go to https://www.browserleaks.com/webrtc
diff --git a/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.lfm b/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.lfm
index a7ea5b4b..426b93d2 100644
--- a/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.lfm
+++ b/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.lfm
@@ -14,7 +14,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.2.0.4'
+ LCLVersion = '3.4.0.0'
object Splitter1: TSplitter
Left = 739
Height = 624
@@ -33,6 +33,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 624
ClientWidth = 294
+ ParentBackground = False
TabOrder = 0
object LogMem: TMemo
Left = 0
@@ -53,6 +54,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 57
ClientWidth = 294
+ ParentBackground = False
TabOrder = 1
object CanEmulateBtn: TButton
Left = 0
@@ -61,8 +63,8 @@ object Form1: TForm1
Width = 294
Align = alTop
Caption = 'Can emulate'
- OnClick = CanEmulateBtnClick
TabOrder = 0
+ OnClick = CanEmulateBtnClick
end
object ClearDeviceMetricsOverrideBtn: TButton
Left = 0
@@ -71,8 +73,8 @@ object Form1: TForm1
Width = 294
Align = alBottom
Caption = 'Clear device metrics override'
- OnClick = ClearDeviceMetricsOverrideBtnClick
TabOrder = 1
+ OnClick = ClearDeviceMetricsOverrideBtnClick
end
end
object Panel4: TPanel
@@ -84,6 +86,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 104
ClientWidth = 294
+ ParentBackground = False
TabOrder = 2
object GroupBox1: TGroupBox
Left = 0
@@ -92,8 +95,9 @@ object Form1: TForm1
Width = 294
Align = alTop
Caption = ' User agent '
- ClientHeight = 60
+ ClientHeight = 58
ClientWidth = 292
+ ParentBackground = False
TabOrder = 0
object UserAgentCb: TComboBox
Left = 0
@@ -135,8 +139,8 @@ object Form1: TForm1
Width = 292
Align = alBottom
Caption = 'Override user agent'
- OnClick = OverrideUserAgentBtnClick
TabOrder = 1
+ OnClick = OverrideUserAgentBtnClick
end
end
object EmulateTouchChk: TCheckBox
@@ -146,8 +150,8 @@ object Form1: TForm1
Width = 294
Align = alBottom
Caption = 'Emulate Touch'
- OnClick = EmulateTouchChkClick
TabOrder = 1
+ OnClick = EmulateTouchChkClick
end
end
object Panel5: TPanel
@@ -159,6 +163,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 205
ClientWidth = 294
+ ParentBackground = False
TabOrder = 3
object GroupBox2: TGroupBox
Left = 0
@@ -167,8 +172,9 @@ object Form1: TForm1
Width = 294
Align = alClient
Caption = ' Emulate device metrics '
- ClientHeight = 190
+ ClientHeight = 188
ClientWidth = 292
+ ParentBackground = False
TabOrder = 0
object Panel6: TPanel
Left = 0
@@ -179,6 +185,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 27
ClientWidth = 292
+ ParentBackground = False
TabOrder = 0
object Label1: TLabel
Left = 0
@@ -209,6 +216,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 27
ClientWidth = 292
+ ParentBackground = False
TabOrder = 1
object Label2: TLabel
Left = 0
@@ -237,8 +245,8 @@ object Form1: TForm1
Width = 292
Align = alBottom
Caption = 'Override device metrics'
- OnClick = OverrideDeviceMetricsBtnClick
TabOrder = 2
+ OnClick = OverrideDeviceMetricsBtnClick
end
object Panel8: TPanel
Left = 0
@@ -249,6 +257,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 27
ClientWidth = 292
+ ParentBackground = False
TabOrder = 3
object Label3: TLabel
Left = 0
@@ -266,6 +275,7 @@ object Form1: TForm1
Top = 0
Width = 217
Align = alClient
+ EnableSets = False
MaxLength = 4
TabOrder = 0
EditMask = '#.##;1;0'
@@ -282,6 +292,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 27
ClientWidth = 292
+ ParentBackground = False
TabOrder = 4
object Label4: TLabel
Left = 0
@@ -321,6 +332,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 27
ClientWidth = 292
+ ParentBackground = False
TabOrder = 5
object Label5: TLabel
Left = 0
@@ -354,6 +366,7 @@ object Form1: TForm1
BevelOuter = bvNone
ClientHeight = 624
ClientWidth = 739
+ ParentBackground = False
TabOrder = 1
object AddressPnl: TPanel
Left = 0
@@ -365,6 +378,7 @@ object Form1: TForm1
ClientHeight = 23
ClientWidth = 739
Enabled = False
+ ParentBackground = False
TabOrder = 0
object AddressEdt: TEdit
Left = 0
@@ -382,8 +396,8 @@ object Form1: TForm1
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFLinkedWindowParent1: TCEFLinkedWindowParent
diff --git a/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.pas b/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.pas
index afc403cc..7d206b8d 100644
--- a/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.pas
+++ b/demos/Lazarus_Linux_GTK2/MobileBrowser/uMobileBrowser.pas
@@ -161,6 +161,7 @@ begin
FClosing := False;
FPendingMsgID := 0;
Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.GoBtnClick(Sender: TObject);
diff --git a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.dfm b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.dfm
index 7c2d64d8..7bb75448 100644
--- a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.dfm
+++ b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.dfm
@@ -16,6 +16,7 @@ object ChildForm: TChildForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poDefault
+ LCLVersion = '3.4.0.0'
object CEFLinkedWindowParent1: TCEFLinkedWindowParent
Left = 0
Height = 256
diff --git a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.pas b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.pas
index 4d9818b9..35e50044 100644
--- a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.pas
+++ b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uChildForm.pas
@@ -164,9 +164,6 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- if GlobalCEFApp.ChromeRuntime then
- CEFLinkedWindowParent1.Free;
end;
end;
@@ -194,6 +191,8 @@ begin
FCanClose := False;
FClosing := False;
FClientInitialized := False;
+
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
// This is a workaround for the CEF issue #2026
diff --git a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.lfm b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.lfm
index 3fe9bba3..7db731ce 100644
--- a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.lfm
+++ b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.lfm
@@ -15,7 +15,7 @@ object MainForm: TMainForm
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
- LCLVersion = '3.2.0.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 21
diff --git a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas
index c9e55cee..6c66155c 100644
--- a/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas
+++ b/demos/Lazarus_Linux_GTK2/PopupBrowser2/uMainForm.pas
@@ -130,7 +130,6 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.OnContextInitialized := @GlobalCEFApp_OnContextInitialized;
GlobalCEFApp.SetCurrentDir := True;
- GlobalCEFApp.ChromeRuntime := True;
end;
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -151,9 +150,6 @@ begin
begin
FClosingMainForm := True;
Chromium1.CloseBrowser(True);
-
- if GlobalCEFApp.ChromeRuntime then
- CEFLinkedWindowParent1.Free;
end;
end;
end;
@@ -173,6 +169,7 @@ begin
Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
Chromium1.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
CreateHiddenChildForm;
end;
diff --git a/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.lfm b/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.lfm
index 93f9602b..bce334e3 100644
--- a/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.lfm
+++ b/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.lfm
@@ -10,7 +10,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 25
@@ -38,8 +38,8 @@ object Form1: TForm1
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object ChromiumWindow1: TChromiumWindow
diff --git a/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.pas b/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.pas
index f5c3c3d1..c25b9c84 100644
--- a/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.pas
+++ b/demos/Lazarus_Linux_GTK2/SimpleBrowser/usimplebrowser.pas
@@ -99,7 +99,8 @@ begin
FClosing := False;
// The browser will load the URL in AddressEdt initially.
- ChromiumWindow1.ChromiumBrowser.DefaultURL := UTF8Decode(AddressEdt.Text);
+ ChromiumWindow1.ChromiumBrowser.DefaultURL := UTF8Decode(AddressEdt.Text);
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.Chromium_OnBeforePopup(Sender: TObject;
diff --git a/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.lfm b/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.lfm
index 90d9bcd3..5dcc71f9 100644
--- a/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.lfm
+++ b/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.lfm
@@ -10,7 +10,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 23
@@ -29,9 +29,9 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
+ TabOrder = 0
OnClick = GoBtnClick
OnEnter = CEFLinkedWindowParent1Exit
- TabOrder = 0
end
object AddressEdt: TEdit
Left = 0
@@ -39,9 +39,9 @@ object Form1: TForm1
Top = 0
Width = 932
Align = alClient
- OnEnter = CEFLinkedWindowParent1Exit
TabOrder = 1
Text = 'https://www.google.com'
+ OnEnter = CEFLinkedWindowParent1Exit
end
end
object CEFLinkedWindowParent1: TCEFLinkedWindowParent
diff --git a/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.pas b/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.pas
index 2a009ff3..ef38c4f5 100644
--- a/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.pas
+++ b/demos/Lazarus_Linux_GTK2/SimpleBrowser2/usimplebrowser2.pas
@@ -115,7 +115,8 @@ begin
FCanClose := False;
FClosing := False;
- Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.GoBtnClick(Sender: TObject);
diff --git a/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.lfm b/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.lfm
index fd768abe..40f2c769 100644
--- a/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.lfm
+++ b/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.lfm
@@ -10,7 +10,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 23
@@ -29,8 +29,8 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object AddressEdt: TEdit
Left = 0
diff --git a/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.pas b/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.pas
index c0e98f51..85ef00b3 100644
--- a/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.pas
+++ b/demos/Lazarus_Linux_GTK2/SubProcess/uSubProcess.pas
@@ -96,7 +96,8 @@ begin
FCanClose := False;
FClosing := False;
- Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.GoBtnClick(Sender: TObject);
diff --git a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.lfm b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.lfm
index 0af54084..978daae2 100644
--- a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.lfm
+++ b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.lfm
@@ -39,9 +39,9 @@ object BrowserFrame: TBrowserFrame
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- OnClick = BackBtnClick
ParentFont = False
TabOrder = 0
+ OnClick = BackBtnClick
end
object ForwardBtn: TButton
Left = 30
@@ -53,9 +53,9 @@ object BrowserFrame: TBrowserFrame
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- OnClick = ForwardBtnClick
ParentFont = False
TabOrder = 1
+ OnClick = ForwardBtnClick
end
object ReloadBtn: TButton
Left = 59
@@ -67,9 +67,9 @@ object BrowserFrame: TBrowserFrame
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- OnClick = ReloadBtnClick
ParentFont = False
TabOrder = 2
+ OnClick = ReloadBtnClick
end
object StopBtn: TButton
Left = 88
@@ -81,9 +81,9 @@ object BrowserFrame: TBrowserFrame
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- OnClick = StopBtnClick
ParentFont = False
TabOrder = 3
+ OnClick = StopBtnClick
end
end
object URLEditPnl: TPanel
@@ -175,9 +175,9 @@ object BrowserFrame: TBrowserFrame
Font.Height = -17
Font.Name = 'Arial'
Font.Style = [fsBold]
- OnClick = GoBtnClick
ParentFont = False
TabOrder = 0
+ OnClick = GoBtnClick
end
end
end
diff --git a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.pas b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.pas
index 2dc44852..ac15ea76 100644
--- a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.pas
+++ b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uBrowserFrame.pas
@@ -247,7 +247,8 @@ end;
procedure TBrowserFrame.CreateBrowser;
begin
- Chromium1.DefaultURL := FHomepage;
+ Chromium1.DefaultURL := FHomepage;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
Chromium1.CreateBrowser(CEFLinkedWindowParent1.Handle, CEFLinkedWindowParent1.BoundsRect);
end;
diff --git a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.lfm b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.lfm
index d7153422..45b1faa4 100644
--- a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.lfm
+++ b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.lfm
@@ -14,7 +14,7 @@ object MainForm: TMainForm
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object BrowserPageCtrl: TPageControl
Left = 34
Height = 704
@@ -33,6 +33,7 @@ object MainForm: TMainForm
ClientHeight = 704
ClientWidth = 34
Enabled = False
+ ParentBackground = False
TabOrder = 1
object AddTabBtn: TSpeedButton
Left = 4
diff --git a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.pas b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.pas
index 27f851ff..fe1dc5d7 100644
--- a/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.pas
+++ b/demos/Lazarus_Linux_GTK2/TabbedBrowser2/uMainForm.pas
@@ -119,7 +119,6 @@ end;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
- GlobalCEFApp.ChromeRuntime := True;
GlobalCEFApp.OnContextInitialized := @GlobalCEFApp_OnContextInitialized;
end;
diff --git a/demos/Lazarus_Linux_GTK2/TinyBrowser/uTinyBrowser.pas b/demos/Lazarus_Linux_GTK2/TinyBrowser/uTinyBrowser.pas
index 4281bac5..809319f4 100644
--- a/demos/Lazarus_Linux_GTK2/TinyBrowser/uTinyBrowser.pas
+++ b/demos/Lazarus_Linux_GTK2/TinyBrowser/uTinyBrowser.pas
@@ -241,9 +241,8 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- //GlobalCEFApp.ChromeRuntime := True; // Enable this line to test the new "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
end;
procedure DestroyTinyBrowser;
diff --git a/demos/Lazarus_Linux_GTK2/TinyBrowser2/uTinyBrowser2.pas b/demos/Lazarus_Linux_GTK2/TinyBrowser2/uTinyBrowser2.pas
index c061dc5d..ad65eda0 100644
--- a/demos/Lazarus_Linux_GTK2/TinyBrowser2/uTinyBrowser2.pas
+++ b/demos/Lazarus_Linux_GTK2/TinyBrowser2/uTinyBrowser2.pas
@@ -96,11 +96,10 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- //GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.DisableZygote := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
// Add a debug log in the BIN directory
//GlobalCEFApp.LogFile := 'cef.log';
diff --git a/demos/Lazarus_Linux_GTK3/TinyBrowser/uTinyBrowser.pas b/demos/Lazarus_Linux_GTK3/TinyBrowser/uTinyBrowser.pas
index 48eca77c..0b9763a5 100644
--- a/demos/Lazarus_Linux_GTK3/TinyBrowser/uTinyBrowser.pas
+++ b/demos/Lazarus_Linux_GTK3/TinyBrowser/uTinyBrowser.pas
@@ -235,10 +235,9 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- GlobalCEFApp.ChromeRuntime := True; // Enable this line to test the new "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.SetCurrentDir := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
end;
procedure DestroyTinyBrowser;
diff --git a/demos/Lazarus_Linux_GTK3/TinyBrowser2/uTinyBrowser2.pas b/demos/Lazarus_Linux_GTK3/TinyBrowser2/uTinyBrowser2.pas
index 079d81ae..0a43df57 100644
--- a/demos/Lazarus_Linux_GTK3/TinyBrowser2/uTinyBrowser2.pas
+++ b/demos/Lazarus_Linux_GTK3/TinyBrowser2/uTinyBrowser2.pas
@@ -90,12 +90,11 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.DisableZygote := True;
GlobalCEFApp.SetCurrentDir := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
// Add a debug log in the BIN directory
//GlobalCEFApp.LogFile := 'cef.log';
diff --git a/demos/Lazarus_Mac/ExternalPumpBrowser/uExternalPumpBrowser.pas b/demos/Lazarus_Mac/ExternalPumpBrowser/uExternalPumpBrowser.pas
index 1ffa0dfb..f0abf55c 100644
--- a/demos/Lazarus_Mac/ExternalPumpBrowser/uExternalPumpBrowser.pas
+++ b/demos/Lazarus_Mac/ExternalPumpBrowser/uExternalPumpBrowser.pas
@@ -100,7 +100,7 @@ procedure TForm1.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
-
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
end;
diff --git a/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.lfm b/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.lfm
index f4d7843b..f4c14bfe 100644
--- a/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.lfm
+++ b/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.lfm
@@ -14,7 +14,6 @@ object CookieVisitorFrm: TCookieVisitorFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.12.0'
object AddressBarPnl: TPanel
Left = 0
Height = 21
@@ -26,6 +25,7 @@ object CookieVisitorFrm: TCookieVisitorFrm
ClientWidth = 884
DoubleBuffered = True
Enabled = False
+ ParentBackground = False
ParentDoubleBuffered = False
TabOrder = 0
object Edit1: TEdit
@@ -44,8 +44,8 @@ object CookieVisitorFrm: TCookieVisitorFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -66,7 +66,6 @@ object CookieVisitorFrm: TCookieVisitorFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.pas b/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.pas
index 54af88ec..35ed7ba3 100644
--- a/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.pas
+++ b/demos/Lazarus_Windows/CookieVisitor/uCookieVisitor.pas
@@ -43,7 +43,6 @@ type
procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
procedure Chromium1CookiesDeleted(Sender: TObject; numDeleted: Integer);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1CookieSet(Sender: TObject; aSuccess: boolean; aID: integer);
procedure Chromium1CookieVisitorDestroyed(Sender: TObject; aID: integer);
@@ -62,7 +61,6 @@ type
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 ShowCookiesMsg(var aMessage : TMessage); message MINIBROWSER_SHOWCOOKIES;
procedure CookiesDeletedMsg(var aMessage : TMessage); message MINIBROWSER_COOKIESDELETED;
procedure CookieSetMsg(var aMessage : TMessage); message MINIBROWSER_COOKIESET;
@@ -103,9 +101,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.
procedure CreateGlobalCEFApp;
begin
@@ -128,11 +125,6 @@ begin
GoBtn.Click;
end;
-procedure TCookieVisitorFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TCookieVisitorFrm.ShowCookiesMsg(var aMessage : TMessage);
begin
SimpleTextViewerFrm.Memo1.Lines.Text := FText; // This should be protected by a mutex.
@@ -244,13 +236,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 TCookieVisitorFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TCookieVisitorFrm.Chromium1ContextMenuCommand(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -310,6 +295,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
diff --git a/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.lfm b/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.lfm
index 6b6fcc78..9d9ec051 100644
--- a/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.lfm
+++ b/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.lfm
@@ -14,7 +14,6 @@ object MainForm: TMainForm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object ChromiumWindow1: TChromiumWindow
Left = 0
Height = 637
@@ -36,6 +35,7 @@ object MainForm: TMainForm
ClientWidth = 781
DoubleBuffered = True
Enabled = False
+ ParentBackground = False
ParentDoubleBuffered = False
TabOrder = 1
object Edit1: TEdit
@@ -54,15 +54,15 @@ object MainForm: TMainForm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = Button1Click
TabOrder = 1
+ OnClick = Button1Click
end
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 48
- top = 240
+ Left = 48
+ Top = 240
end
end
diff --git a/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.pas b/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.pas
index 18b7eb44..9f7e2bd4 100644
--- a/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.pas
+++ b/demos/Lazarus_Windows/CustomResourceBrowser/uMainForm.pas
@@ -26,11 +26,13 @@ type
Button1: TButton;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
procedure ChromiumWindow1Close(Sender: TObject);
procedure ChromiumWindow1BeforeClose(Sender: TObject);
@@ -100,6 +102,8 @@ procedure TMainForm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TMainForm.FormShow(Sender: TObject);
diff --git a/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.lfm b/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.lfm
index 0179e1f4..d4b30011 100644
--- a/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.lfm
+++ b/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.lfm
@@ -15,7 +15,6 @@ object DOMVisitorFrm: TDOMVisitorFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 539
@@ -98,7 +97,6 @@ object DOMVisitorFrm: TDOMVisitorFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnDevToolsMethodResult = Chromium1DevToolsMethodResult
Left = 16
Top = 40
diff --git a/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.pas b/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.pas
index 64e206fc..2379e1b1 100644
--- a/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.pas
+++ b/demos/Lazarus_Windows/DOMVisitor/uDOMVisitor.pas
@@ -69,7 +69,6 @@ type
procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1ConsoleMessage(Sender: TObject; const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring; line: Integer; out Result: Boolean);
procedure Chromium1DevToolsMethodResult(Sender: TObject; const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue);
@@ -96,7 +95,6 @@ type
procedure SetErrorText(const aValue : string);
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure VisitDOMMsg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_PARTIAL;
procedure VisitDOM2Msg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_FULL;
procedure VisitDOM3Msg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_JS;
@@ -196,13 +194,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.
procedure SimpleDOMIteration(const aDocument: ICefDomDocument);
var
@@ -482,15 +475,8 @@ begin
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
end;
-procedure TDOMVisitorFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TDOMVisitorFrm.Chromium1ConsoleMessage(Sender: TObject;
- const browser: ICefBrowser; level: Cardinal; const message, source: ustring;
+ const browser: ICefBrowser; level: TCefLogSeverity; const message, source: ustring;
line: Integer; out Result: Boolean);
begin
// In this event we receive the message with the name and value of a DOM node
@@ -715,6 +701,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -751,11 +738,6 @@ begin
GoBtn.Click;
end;
-procedure TDOMVisitorFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TDOMVisitorFrm.VisitDOMBtnClick(Sender: TObject);
begin
PostMessage(Handle, MINIBROWSER_VISITDOM_PARTIAL, 0, 0);
diff --git a/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.lfm b/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.lfm
index ffab713e..d6e45366 100644
--- a/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.lfm
+++ b/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.lfm
@@ -14,7 +14,6 @@ object Form1: TForm1
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.4.0.0'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 599
@@ -329,7 +328,6 @@ object Form1: TForm1
OnLoadEnd = Chromium1LoadEnd
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 56
Top = 144
end
diff --git a/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.pas b/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.pas
index 34def6c8..bec0fe09 100644
--- a/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.pas
+++ b/demos/Lazarus_Windows/EditorBrowser/uEditorBrowser.pas
@@ -65,7 +65,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 Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
procedure Chromium1TextResultAvailable(Sender: TObject; const aText: ustring);
@@ -109,7 +108,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;
public
{ Public declarations }
end;
@@ -137,9 +135,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.
procedure CreateGlobalCEFApp;
begin
@@ -174,6 +171,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -212,13 +210,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TForm1.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TForm1.Chromium1LoadEnd(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
httpStatusCode: Integer);
@@ -401,11 +392,6 @@ begin
Caption := 'Editor Browser';
end;
-procedure TForm1.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
diff --git a/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.lfm b/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.lfm
index 49d6dc15..6756ced8 100644
--- a/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.lfm
+++ b/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.lfm
@@ -14,7 +14,6 @@ object ExternalPumpBrowserFrm: TExternalPumpBrowserFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.12.0'
object AddressPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object ExternalPumpBrowserFrm: TExternalPumpBrowserFrm
ClientHeight = 21
ClientWidth = 1038
Enabled = False
+ ParentBackground = False
TabOrder = 0
object GoBtn: TButton
Left = 1007
@@ -33,16 +33,16 @@ object ExternalPumpBrowserFrm: TExternalPumpBrowserFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object URLCbx: TComboBox
Left = 0
- Height = 21
+ Height = 22
Top = 0
Width = 1007
Align = alClient
- ItemHeight = 13
+ ItemHeight = 14
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
@@ -86,7 +86,6 @@ object ExternalPumpBrowserFrm: TExternalPumpBrowserFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 56
Top = 152
end
diff --git a/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.pas b/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.pas
index 9b76738c..84b11353 100644
--- a/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.pas
+++ b/demos/Lazarus_Windows/ExternalPumpBrowser/uExternalPumpBrowser.pas
@@ -27,32 +27,22 @@ type
Chromium1: TChromium;
URLCbx: TComboBox;
- procedure CEFSentinel1Close(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
+ procedure FormShow(Sender: TObject);
procedure FormCreate(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: Boolean; var Result: Boolean);
+ 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: Boolean; var Result: Boolean);
private
FCanClose : boolean;
FClosing : boolean;
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -79,10 +69,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 calls TCEFSentinel.Start, which will trigger TCEFSentinel.OnClose when the renderer processes are closed.
-// 4. TCEFSentinel.OnClose 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.
procedure GlobalCEFApp_OnScheduleMessagePumpWork(const aDelayMS : int64);
begin
@@ -121,6 +109,7 @@ begin
Visible := False;
AddressPnl.Enabled := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -156,12 +145,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 TExternalPumpBrowserFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TExternalPumpBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage);
begin
Caption := 'External Pump Browser';
@@ -170,21 +153,11 @@ begin
GoBtn.Click;
end;
-procedure TExternalPumpBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TExternalPumpBrowserFrm.GoBtnClick(Sender: TObject);
begin
Chromium1.LoadURL(URLCbx.Text);
end;
-procedure TExternalPumpBrowserFrm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TExternalPumpBrowserFrm.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
diff --git a/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.lfm b/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.lfm
index d4cf506f..a21f75c9 100644
--- a/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.lfm
+++ b/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.lfm
@@ -1,13 +1,13 @@
object MainForm: TMainForm
- Left = 165
- Height = 673
- Top = 130
- Width = 1364
+ Left = -8
+ Height = 712
+ Top = -8
+ Width = 1380
BorderIcons = []
BorderStyle = bsNone
Caption = 'MainForm'
- ClientHeight = 673
- ClientWidth = 1364
+ ClientHeight = 811
+ ClientWidth = 1537
Color = clBtnFace
Font.Color = clWindowText
Font.Height = -11
@@ -16,13 +16,12 @@ object MainForm: TMainForm
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnShow = FormShow
- LCLVersion = '2.0.6.0'
WindowState = wsMaximized
object CEFWindowParent1: TCEFWindowParent
Left = 0
- Height = 673
+ Height = 811
Top = 0
- Width = 1364
+ Width = 1537
Align = alClient
TabOrder = 0
end
@@ -32,15 +31,14 @@ object MainForm: TMainForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 208
- top = 120
+ Left = 208
+ Top = 120
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 272
- top = 120
+ Left = 272
+ Top = 120
end
end
diff --git a/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.pas b/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.pas
index 8d736d09..3804ce0e 100644
--- a/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.pas
+++ b/demos/Lazarus_Windows/FullScreenBrowser/uMainForm.pas
@@ -24,31 +24,19 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure CEFSentinel1Close(Sender: TObject);
- procedure Chromium1PreKeyEvent(Sender: TObject;
- const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
- out isKeyboardShortcut, Result: Boolean);
- procedure Chromium1KeyEvent(Sender: TObject;
- const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
- out Result: Boolean);
+
procedure FormShow(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject;
- const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
+
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1PreKeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
+ procedure Chromium1KeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out Result: Boolean);
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
private
{ Private declarations }
protected
@@ -61,7 +49,6 @@ type
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 HandleKeyUp(const aMsg : TMsg; var aHandled : boolean);
procedure HandleKeyDown(const aMsg : TMsg; var aHandled : boolean);
@@ -83,10 +70,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 calls TCEFSentinel.Start, which will trigger TCEFSentinel.OnClose when the renderer processes are closed.
-// 4. TCEFSentinel.OnClose 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.
procedure CreateGlobalCEFApp;
begin
@@ -159,22 +144,11 @@ begin
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
end;
-procedure TMainForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
begin
CEFWindowParent1.UpdateSize;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.Chromium1KeyEvent(Sender: TObject;
const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
out Result: Boolean);
@@ -213,11 +187,6 @@ begin
isKeyboardShortcut := True;
end;
-procedure TMainForm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := FCanClose;
@@ -227,6 +196,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
diff --git a/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.lfm b/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.lfm
index 7b9fabad..f4cc732b 100644
--- a/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.lfm
@@ -15,7 +15,7 @@ object JSDialogBrowserFrm: TJSDialogBrowserFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
+ LCLVersion = '3.4.0.0'
object ChromiumWindow1: TChromiumWindow
Left = 0
Height = 603
@@ -37,6 +37,7 @@ object JSDialogBrowserFrm: TJSDialogBrowserFrm
ClientHeight = 21
ClientWidth = 1038
Enabled = False
+ ParentBackground = False
TabOrder = 1
object AddressEdt: TEdit
Left = 0
@@ -54,15 +55,15 @@ object JSDialogBrowserFrm: TJSDialogBrowserFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 56
- top = 88
+ Left = 56
+ Top = 88
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.pas b/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.pas
index 658770bf..cbbec493 100644
--- a/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSDialog/uJSDialogBrowser.pas
@@ -28,14 +28,16 @@ type
AddressEdt: TEdit;
GoBtn: TButton;
Timer1: TTimer;
- procedure CEFSentinel1Close(Sender: TObject);
+
procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure ChromiumWindow1AfterCreated(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+ procedure ChromiumWindow1AfterCreated(Sender: TObject);
procedure ChromiumWindow1Close(Sender: TObject);
procedure ChromiumWindow1BeforeClose(Sender: TObject);
@@ -103,6 +105,7 @@ begin
FCallback := nil;
FCanClose := False;
FClosing := False;
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TJSDialogBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -145,12 +148,6 @@ begin
ChromiumWindow1.LoadURL(AddressEdt.Text);
end;
-procedure TJSDialogBrowserFrm.CEFSentinel1Close(Sender: TObject);
-begin
- FCanClose := True;
- PostMessage(Handle, WM_CLOSE, 0, 0);
-end;
-
procedure TJSDialogBrowserFrm.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
diff --git a/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.lfm b/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.lfm
index 0fb18242..fdfb0110 100644
--- a/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.lfm
@@ -13,7 +13,6 @@ object JSEvalFrm: TJSEvalFrm
OnCloseQuery = FormCloseQuery
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 550
@@ -33,6 +32,7 @@ object JSEvalFrm: TJSEvalFrm
ClientWidth = 878
DoubleBuffered = True
Enabled = False
+ ParentBackground = False
ParentDoubleBuffered = False
TabOrder = 1
object GoBtn: TButton
@@ -42,8 +42,8 @@ object JSEvalFrm: TJSEvalFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object AddressEdt: TEdit
Left = 0
@@ -62,15 +62,14 @@ object JSEvalFrm: TJSEvalFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 16
- top = 40
+ Left = 16
+ Top = 40
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 16
- top = 96
+ Left = 16
+ Top = 96
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.pas b/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.pas
index b0ae0fdd..5327e0c4 100644
--- a/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSEval/uJSEval.pas
@@ -36,34 +36,19 @@ type
GoBtn: TButton;
AddressEdt: TEdit;
Timer1: TTimer;
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
-
- procedure Chromium1ProcessMessageReceived(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId;
- const message: ICefProcessMessage; out Result: Boolean);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
+
+ procedure GoBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ 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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
private
{ Private declarations }
@@ -75,7 +60,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowTextViewerMsg(var aMessage : TMessage); message MINIBROWSER_SHOWTEXTVIEWER;
procedure EvalJSCodeMsg(var aMessage : TMessage); message MINIBROWSER_EVALJSCODE;
procedure GetScrollPosMsg(var aMessage : TMessage); message MINIBROWSER_GETSCROLLPOS;
@@ -138,9 +122,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.
procedure TJSEvalFrm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
@@ -180,13 +163,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 TJSEvalFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSEvalFrm.Chromium1ContextMenuCommand(Sender : TObject;
const browser : ICefBrowser;
const frame : ICefFrame;
@@ -213,6 +189,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -235,11 +212,6 @@ begin
GoBtn.Click;
end;
-procedure TJSEvalFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TJSEvalFrm.ShowTextViewerMsg(var aMessage : TMessage);
begin
SimpleTextViewerFrm.Memo1.Lines.Text := FText;
diff --git a/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.lfm b/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.lfm
index 1cf3cbf2..e2015866 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.lfm
@@ -15,7 +15,6 @@ object JSExecutingFunctionsFrm: TJSExecutingFunctionsFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -26,6 +25,7 @@ object JSExecutingFunctionsFrm: TJSExecutingFunctionsFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -43,8 +43,8 @@ object JSExecutingFunctionsFrm: TJSExecutingFunctionsFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -61,15 +61,14 @@ object JSExecutingFunctionsFrm: TJSExecutingFunctionsFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas b/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas
index 23c5694e..2712d8d9 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSExecutingFunctions/uJSExecutingFunctions.pas
@@ -33,39 +33,27 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormCreate(Sender: TObject);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ 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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -100,10 +88,8 @@ implementation
// 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 calls TCEFSentinel.Start, which will trigger TCEFSentinel.OnClose when the renderer processes are closed.
-// 4. TCEFSentinel.OnClose 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.
uses
uCEFProcessMessage, uMyV8Handler;
@@ -185,12 +171,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 TJSExecutingFunctionsFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExecutingFunctionsFrm.Chromium1ContextMenuCommand(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -219,6 +199,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -284,9 +265,4 @@ begin
GoBtn.Click;
end;
-procedure TJSExecutingFunctionsFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.lfm b/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.lfm
index 8b2ab098..7bca3b31 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.lfm
@@ -14,7 +14,6 @@ object JSExtensionFrm: TJSExtensionFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.8.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSExtensionFrm: TJSExtensionFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSExtensionFrm: TJSExtensionFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -61,6 +61,7 @@ object JSExtensionFrm: TJSExtensionFrm
Width = 978
Align = alBottom
BevelOuter = bvLowered
+ ParentBackground = False
TabOrder = 2
end
object Chromium1: TChromium
@@ -70,15 +71,14 @@ object JSExtensionFrm: TJSExtensionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.pas b/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.pas
index 6e2b3dde..3bb78391 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSExtension/uJSExtension.pas
@@ -40,34 +40,21 @@ type
Chromium1: TChromium;
StatusPnl: TPanel;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
- procedure Chromium1ProcessMessageReceived(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId;
- const message: ICefProcessMessage; out Result: Boolean);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
FText : string;
// Variables to control when can we destroy the form safely
@@ -77,7 +64,6 @@ type
FOffline : boolean;
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowTextViewerMsg(var aMessage : TMessage); message MINIBROWSER_SHOWTEXTVIEWER;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -242,11 +228,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.
procedure GlobalCEFApp_OnWebKitInitialized;
var
@@ -338,13 +321,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 TJSExtensionFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExtensionFrm.Chromium1ContextMenuCommand(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -455,6 +431,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -523,9 +500,4 @@ begin
GoBtn.Click;
end;
-procedure TJSExtensionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.lfm b/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.lfm
index 7a1233b3..7bca3b31 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.lfm
@@ -14,7 +14,6 @@ object JSExtensionFrm: TJSExtensionFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -72,7 +71,6 @@ object JSExtensionFrm: TJSExtensionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 32
Top = 224
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.pas b/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.pas
index 917af06c..6dcac1ae 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSExtensionSubProcess/uJSExtension.pas
@@ -40,34 +40,21 @@ type
Chromium1: TChromium;
StatusPnl: TPanel;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
- procedure Chromium1ProcessMessageReceived(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId;
- const message: ICefProcessMessage; out Result: Boolean);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
FText : string;
// Variables to control when can we destroy the form safely
@@ -77,7 +64,6 @@ type
FOffline : boolean;
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowTextViewerMsg(var aMessage : TMessage); message MINIBROWSER_SHOWTEXTVIEWER;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -242,11 +228,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.
procedure CreateGlobalCEFApp;
begin
@@ -303,13 +286,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 TJSExtensionFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExtensionFrm.Chromium1ContextMenuCommand(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -420,6 +396,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -488,9 +465,4 @@ begin
GoBtn.Click;
end;
-procedure TJSExtensionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.lfm b/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.lfm
index 6913270e..34be0dd1 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.lfm
@@ -14,7 +14,6 @@ object JSExtensionWithFunctionFrm: TJSExtensionWithFunctionFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSExtensionWithFunctionFrm: TJSExtensionWithFunctionFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSExtensionWithFunctionFrm: TJSExtensionWithFunctionFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -69,15 +69,14 @@ object JSExtensionWithFunctionFrm: TJSExtensionWithFunctionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas b/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas
index 5224c88a..68e6d9d0 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSExtensionWithFunction/uJSExtensionWithFunction.pas
@@ -29,34 +29,25 @@ type
Chromium1: TChromium;
Timer1: TTimer;
StatusBar1: TStatusBar;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
- procedure Chromium1ProcessMessageReceived(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId;
- const message: ICefProcessMessage; out Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -85,9 +76,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
+// 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.
procedure GlobalCEFApp_OnWebKitInitializedEvent;
var
@@ -150,13 +140,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 TJSExtensionWithFunctionFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExtensionWithFunctionFrm.Chromium1ProcessMessageReceived(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
sourceProcess: TCefProcessId; const message: ICefProcessMessage;
@@ -179,6 +162,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -238,9 +222,4 @@ begin
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then GlobalCEFApp.OsmodalLoop := False;
end;
-procedure TJSExtensionWithFunctionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.lfm b/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.lfm
index f6df077f..578b805b 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.lfm
@@ -14,7 +14,6 @@ object JSExtensionWithObjectParameterFrm: TJSExtensionWithObjectParameterFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSExtensionWithObjectParameterFrm: TJSExtensionWithObjectParameterFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSExtensionWithObjectParameterFrm: TJSExtensionWithObjectParameterFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSExtensionWithObjectParameterFrm: TJSExtensionWithObjectParameterFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas b/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas
index 0d0750ee..bf878b86 100644
--- a/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSExtensionWithObjectParameter/uJSExtensionWithObjectParameter.pas
@@ -28,31 +28,24 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -84,9 +77,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.
procedure GlobalCEFApp_OnWebKitInitializedEvent;
var
@@ -152,13 +144,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 TJSExtensionWithObjectParameterFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSExtensionWithObjectParameterFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -169,6 +154,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -228,9 +214,4 @@ begin
GoBtn.Click;
end;
-procedure TJSExtensionWithObjectParameterFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.lfm b/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.lfm
index e3c9821b..3bfc4f9a 100644
--- a/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.lfm
@@ -15,7 +15,6 @@ object MainForm: TMainForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 559
@@ -85,7 +84,6 @@ object MainForm: TMainForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 16
Top = 40
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas b/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas
index 0650e6de..92afae19 100644
--- a/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSSharedMemoryProcMessage/uMainForm.pas
@@ -42,7 +42,6 @@ type
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1ProcessMessageReceived(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage; out Result: Boolean);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -58,7 +57,6 @@ type
procedure SetMsgContents(const aValue : string);
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowMessageMsg(var aMessage : TMessage); message MINIBROWSER_SHOWMESSAGE;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -100,13 +98,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.
procedure GlobalCEFApp_OnProcessMessageReceived(const browser : ICefBrowser;
const frame : ICefFrame;
@@ -194,13 +187,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 TMainForm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.Chromium1ProcessMessageReceived(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId;
const message: ICefProcessMessage; out Result: Boolean);
@@ -232,6 +218,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -268,11 +255,6 @@ begin
AddressBarPnl.Enabled := True;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.SendMessageBtnClick(Sender: TObject);
const
BUFFER_SIZE = 1; // Random buffer size for this demo
diff --git a/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.lfm b/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.lfm
index f44a01a3..b5210f27 100644
--- a/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.lfm
@@ -14,7 +14,6 @@ object JSSimpleExtensionFrm: TJSSimpleExtensionFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSSimpleExtensionFrm: TJSSimpleExtensionFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSSimpleExtensionFrm: TJSSimpleExtensionFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSSimpleExtensionFrm: TJSSimpleExtensionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas b/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas
index fb0438b8..1120bb22 100644
--- a/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSSimpleExtension/uJSSimpleExtension.pas
@@ -28,31 +28,24 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -81,9 +74,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.
procedure GlobalCEFApp_OnWebKitInitializedEvent;
var
@@ -190,13 +182,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSSimpleExtensionFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSSimpleExtensionFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -207,6 +192,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -216,9 +202,4 @@ begin
FClosing := False;
end;
-procedure TJSSimpleExtensionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.lfm b/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.lfm
index 32485b52..b6ab26aa 100644
--- a/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.lfm
@@ -14,7 +14,6 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas b/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas
index 1cea9be5..a7fc3e43 100644
--- a/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSSimpleWindowBinding/uJSSimpleWindowBinding.pas
@@ -28,31 +28,24 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -78,9 +71,8 @@ implementation
// 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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
var
@@ -182,13 +174,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSSimpleWindowBindingFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSSimpleWindowBindingFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -199,6 +184,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -208,9 +194,4 @@ begin
FClosing := False;
end;
-procedure TJSSimpleWindowBindingFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.lfm b/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.lfm
index 833febed..6d1ef0a4 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.lfm
@@ -14,7 +14,6 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSSimpleWindowBindingFrm: TJSSimpleWindowBindingFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas b/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas
index 74ccc56a..6b995aa5 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingSubProcess/uJSSimpleWindowBinding.pas
@@ -28,24 +28,18 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
FText : string;
// Variables to control when can we destroy the form safely
@@ -53,7 +47,6 @@ type
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -77,9 +70,8 @@ implementation
// 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.
procedure TJSSimpleWindowBindingFrm.GoBtnClick(Sender: TObject);
begin
@@ -162,13 +154,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSSimpleWindowBindingFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSSimpleWindowBindingFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -181,6 +166,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end
else
@@ -193,9 +179,4 @@ begin
FClosing := False;
end;
-procedure TJSSimpleWindowBindingFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.lfm b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.lfm
index 5b987022..5417645c 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.lfm
@@ -14,7 +14,6 @@ object JSWindowBindingWithArrayBufferFrm: TJSWindowBindingWithArrayBufferFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 20
@@ -25,6 +24,7 @@ object JSWindowBindingWithArrayBufferFrm: TJSWindowBindingWithArrayBufferFrm
ClientHeight = 20
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSWindowBindingWithArrayBufferFrm: TJSWindowBindingWithArrayBufferFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSWindowBindingWithArrayBufferFrm: TJSWindowBindingWithArrayBufferFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas
index 33bee355..d80b4c46 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithArrayBuffer/uJSWindowBindingWithArrayBuffer.pas
@@ -28,31 +28,24 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -81,14 +74,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.
-
-procedure FreeCustomArrayBufer(buffer : Pointer);
-begin
- if (buffer <> nil) then FreeMem(buffer);
-end;
+// 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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
const
@@ -96,27 +83,14 @@ const
BUFFER_FILL_VALUE = 42; // Some ramdom value to fill the buffer
var
TempObject : ICefv8Value;
- TempCallback : ICefv8ArrayBufferReleaseCallback;
TempBuffer : Pointer;
begin
- // The ArrayBuffer in this demo has a "buffer" pointer but CEF uses a callback to free it when the JS garbage collector is triggered.
- // The garbage collector calls ICefv8ArrayBufferReleaseCallback.ReleaseBuffer to free the buffer and
- // CEF4Delphi has a TCefFastv8ArrayBufferReleaseCallback class that calls a custom procedure when
- // ICefv8ArrayBufferReleaseCallback.ReleaseBuffer is called.
-
GetMem(TempBuffer, BUFFER_LENGTH);
FillChar(TempBuffer^, BUFFER_LENGTH, BUFFER_FILL_VALUE);
- // TempCallback will execute FreeCustomArrayBufer when the garbage collector needs to free the buffer inside the "ArrayBuffer".
- TempCallback := TCefFastv8ArrayBufferReleaseCallback.Create(@FreeCustomArrayBufer);
- TempObject := TCefv8ValueRef.NewArrayBuffer(TempBuffer, BUFFER_LENGTH, TempCallback);
+ TempObject := TCefv8ValueRef.NewArrayBufferWithCopy(TempBuffer, BUFFER_LENGTH);
context.Global.SetValueByKey('myobj', TempObject, V8_PROPERTY_ATTRIBUTE_NONE);
-
- // If you keep a reference to "TempObject" and you need to free the buffer immediately then call TempObject.NeuterArrayBuffer
-
- // Read this for more information about ICefv8Value :
- // https://magpcss.org/ceforum/apidocs3/projects/(default)/CefV8Value.html
end;
procedure CreateGlobalCEFApp;
@@ -206,13 +180,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSWindowBindingWithArrayBufferFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSWindowBindingWithArrayBufferFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -223,6 +190,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -232,9 +200,4 @@ begin
FClosing := False;
end;
-procedure TJSWindowBindingWithArrayBufferFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.lfm b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.lfm
index 568253ce..a886162f 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.lfm
@@ -14,7 +14,6 @@ object JSWindowBindingWithFunctionFrm: TJSWindowBindingWithFunctionFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSWindowBindingWithFunctionFrm: TJSWindowBindingWithFunctionFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSWindowBindingWithFunctionFrm: TJSWindowBindingWithFunctionFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSWindowBindingWithFunctionFrm: TJSWindowBindingWithFunctionFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas
index d25509c6..8fc3da8a 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithFunction/uJSWindowBindingWithFunction.pas
@@ -28,31 +28,24 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
+
procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -81,9 +74,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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
var
@@ -186,13 +178,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSWindowBindingWithFunctionFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSWindowBindingWithFunctionFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -203,6 +188,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -212,9 +198,4 @@ begin
FClosing := False;
end;
-procedure TJSWindowBindingWithFunctionFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.lfm b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.lfm
index 0769ee80..e79a2058 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.lfm
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.lfm
@@ -14,7 +14,6 @@ object JSWindowBindingWithObjectFrm: TJSWindowBindingWithObjectFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +24,7 @@ object JSWindowBindingWithObjectFrm: TJSWindowBindingWithObjectFrm
ClientHeight = 21
ClientWidth = 978
Enabled = False
+ ParentBackground = False
TabOrder = 0
object Edit1: TEdit
Left = 0
@@ -42,8 +42,8 @@ object JSWindowBindingWithObjectFrm: TJSWindowBindingWithObjectFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -58,15 +58,14 @@ object JSWindowBindingWithObjectFrm: TJSWindowBindingWithObjectFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 32
- top = 224
+ Left = 32
+ Top = 224
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 32
- top = 288
+ Left = 32
+ Top = 288
end
end
diff --git a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas
index e76ccaed..c6ef5239 100644
--- a/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas
+++ b/demos/Lazarus_Windows/JavaScript/JSWindowBindingWithObject/uJSWindowBindingWithObject.pas
@@ -28,32 +28,24 @@ type
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
Timer1: TTimer;
- procedure CEFSentinel1Close(Sender: TObject);
+
procedure FormShow(Sender: TObject);
- procedure GoBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
- procedure Timer1Timer(Sender: TObject);
- 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: Boolean; var Result: Boolean);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -82,9 +74,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.
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
var
@@ -140,11 +131,6 @@ begin
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then Timer1.Enabled := True;
end;
-procedure TJSWindowBindingWithObjectFrm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TJSWindowBindingWithObjectFrm.WMMove(var aMessage : TWMMove);
begin
inherited;
@@ -195,13 +181,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TJSWindowBindingWithObjectFrm.Chromium1Close(
- Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TJSWindowBindingWithObjectFrm.FormCloseQuery(
Sender: TObject; var CanClose: Boolean);
begin
@@ -212,6 +191,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -221,9 +201,4 @@ begin
FClosing := False;
end;
-procedure TJSWindowBindingWithObjectFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/MediaRouter/debug.log b/demos/Lazarus_Windows/MediaRouter/debug.log
deleted file mode 100644
index fff270b2..00000000
--- a/demos/Lazarus_Windows/MediaRouter/debug.log
+++ /dev/null
@@ -1,2 +0,0 @@
-[1223/171613.318:WARNING:resource_util.cc(94)] Please customize CefSettings.root_cache_path for your application. Use of the default value may lead to unintended process singleton behavior.
-[1223/171618.055:WARNING:pref_notifier_impl.cc(41)] Pref observer for media_router.cast_allow_all_ips found at shutdown.
diff --git a/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.lfm b/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.lfm
index c6d257e9..f546b873 100644
--- a/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.lfm
+++ b/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.lfm
@@ -15,7 +15,7 @@ object MediaRouterFrm: TMediaRouterFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
+ LCLVersion = '3.4.0.0'
object CEFWindowParent1: TCEFWindowParent
Left = 184
Height = 0
@@ -311,7 +311,6 @@ object MediaRouterFrm: TMediaRouterFrm
OnMediaRouteCreateFinished = Chromium1MediaRouteCreateFinished
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnSinks = Chromium1Sinks
OnRoutes = Chromium1Routes
OnRouteStateChanged = Chromium1RouteStateChanged
diff --git a/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.pas b/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.pas
index b2056cbf..e7f6f22b 100644
--- a/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.pas
+++ b/demos/Lazarus_Windows/MediaRouter/uMediaRouterFrm.pas
@@ -57,7 +57,6 @@ type
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
procedure Chromium1Sinks(Sender: TObject; const sinks: TCefMediaSinkArray);
procedure Chromium1Routes(Sender: TObject; const routes: TCefMediaRouteArray);
procedure Chromium1RouteStateChanged(Sender: TObject; const route: ICefMediaRoute; state: TCefMediaRouteConnectionState);
@@ -86,7 +85,6 @@ type
FSinks : TCefMediaSinkInfoArray;
FRoutes : TCefMediaRouteInfoArray;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure PendingLogLinesMsg(var aMessage : TMessage); message MEDIA_ROUTER_PENDING_LOG_LINES;
procedure RefreshSinksMsg(var aMessage : TMessage); message MEDIA_ROUTER_REFRESH_SINKS;
procedure RefreshRoutesMsg(var aMessage : TMessage); message MEDIA_ROUTER_REFRESH_ROUTES;
@@ -194,13 +192,6 @@ begin
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TMediaRouterFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMediaRouterFrm.Chromium1MediaRouteCreateFinished(Sender: TObject;
result: Integer; const error: ustring; const route: ICefMediaRoute);
var
@@ -284,6 +275,7 @@ begin
Visible := False;
DestroyAllArrays;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -399,11 +391,6 @@ begin
Timer1.Enabled := True;
end;
-procedure TMediaRouterFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMediaRouterFrm.PendingLogLinesMsg(var aMessage : TMessage);
begin
if FClosing then exit;
diff --git a/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.lfm b/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.lfm
index 27a46e58..4909d6d3 100644
--- a/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.lfm
+++ b/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.lfm
@@ -15,7 +15,6 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.4.0.0'
object Splitter1: TSplitter
Left = 1179
Height = 663
@@ -118,11 +117,11 @@ object MiniBrowserFrm: TMiniBrowserFrm
TabOrder = 1
object URLCbx: TComboBox
Left = 0
- Height = 21
+ Height = 22
Top = 3
Width = 978
Anchors = [akTop, akLeft, akRight, akBottom]
- ItemHeight = 13
+ ItemHeight = 14
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
diff --git a/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.pas b/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.pas
index 9818daa5..3c3697ed 100644
--- a/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.pas
+++ b/demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.pas
@@ -117,25 +117,16 @@ type
OpenfilewithaDAT1: TMenuItem;
N5: TMenuItem;
Memoryinfo1: TMenuItem;
+
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure FormDestroy(Sender: TObject);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+ procedure Timer1Timer(Sender: TObject);
+ procedure ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
+ procedure PopupMenu1Popup(Sender: TObject);
procedure Allowdownloads1Click(Sender: TObject);
- procedure CEFWindowParent1DragDrop(Sender, Source: TObject; X, Y: Integer);
- procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser;
- const url, request_method: ustring; var aResult: boolean);
- procedure Chromium1CookiesFlushed(Sender: TObject);
- procedure Chromium1DevToolsMethodResult(Sender: TObject;
- const browser: ICefBrowser; message_id: integer; success: boolean;
- const result: ICefValue);
- procedure Chromium1DownloadImageFinished(Sender: TObject;
- const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
- procedure Chromium1MediaAccessChange(Sender: TObject;
- const browser: ICefBrowser; has_video_access, has_audio_access: boolean);
- procedure Chromium1RequestMediaAccessPermission(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const requesting_origin: ustring; requested_permissions: cardinal;
- const callback: ICefMediaAccessCallback; var aResult: boolean);
- procedure Chromium1ZoomPctAvailable(Sender: TObject; const aZoomPct: double
- );
- procedure FormShow(Sender: TObject);
procedure BackBtnClick(Sender: TObject);
procedure ForwardBtnClick(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
@@ -145,24 +136,6 @@ type
procedure MenuItem5Click(Sender: TObject);
procedure MenuItem6Click(Sender: TObject);
procedure ReloadBtnClick(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject;
- const browser: ICefBrowser);
- procedure Chromium1LoadingStateChange(Sender: TObject;
- const browser: ICefBrowser; isLoading, canGoBack,
- canGoForward: Boolean);
- procedure Chromium1TitleChange(Sender: TObject;
- const browser: ICefBrowser; const title: ustring);
- procedure Chromium1AddressChange(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const url: ustring);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1StatusMessage(Sender: TObject;
- const browser: ICefBrowser; const value: ustring);
- procedure Chromium1TextResultAvailable(Sender: TObject;
- const aText: ustring);
- procedure PopupMenu1Popup(Sender: TObject);
procedure DevTools1Click(Sender: TObject);
procedure Preferences1Click(Sender: TObject);
procedure ConfigBtnClick(Sender: TObject);
@@ -172,68 +145,47 @@ type
procedure Inczoom1Click(Sender: TObject);
procedure Deczoom1Click(Sender: TObject);
procedure Resetzoom1Click(Sender: TObject);
- procedure Chromium1FullScreenModeChange(Sender: TObject;
- const browser: ICefBrowser; fullscreen: Boolean);
- procedure Chromium1PreKeyEvent(Sender: TObject;
- const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
- out isKeyboardShortcut, Result: Boolean);
- procedure Chromium1KeyEvent(Sender: TObject;
- const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
- out Result: Boolean);
- procedure ApplicationEvents1Message(var Msg: tagMSG;
- var Handled: Boolean);
procedure Openfile1Click(Sender: TObject);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
- procedure Chromium1PdfPrintFinished(Sender: TObject;
- aResultOK: Boolean);
- procedure Chromium1ResourceResponse(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const request: ICefRequest; const response: ICefResponse;
- out Result: Boolean);
procedure StopBtnClick(Sender: TObject);
procedure Resolvehost1Click(Sender: TObject);
- procedure Chromium1ResolvedHostAvailable(Sender: TObject;
- result: Integer; const resolvedIps: TStrings);
- procedure Timer1Timer(Sender: TObject);
- procedure Chromium1PrefsAvailable(Sender: TObject; aResultOK: Boolean);
- procedure Chromium1BeforeDownload(Sender: TObject;
- const browser: ICefBrowser; const downloadItem: ICefDownloadItem;
- const suggestedName: ustring;
- const callback: ICefBeforeDownloadCallback);
- procedure Chromium1DownloadUpdated(Sender: TObject;
- const browser: ICefBrowser; const downloadItem: ICefDownloadItem;
- const callback: ICefDownloadItemCallback);
- procedure FormCreate(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- procedure Chromium1BeforeResourceLoad(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const request: ICefRequest; const callback: ICefCallback;
- out Result: TCefReturnValue);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
- procedure Chromium1RenderCompMsg(Sender: TObject; var aMessage : TMessage; var aHandled: Boolean);
- procedure Chromium1LoadingProgressChange(Sender: TObject;
- const browser: ICefBrowser; const progress: Double);
procedure OpenfilewithaDAT1Click(Sender: TObject);
- procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser;
- const frame: ICefFrame; httpStatusCode: Integer);
procedure Memoryinfo1Click(Sender: TObject);
- procedure Chromium1LoadError(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- errorCode: Integer; const errorText, failedUrl: ustring);
- procedure Chromium1CertificateError(Sender: TObject;
- const browser: ICefBrowser; certError: Integer;
- const requestUrl: ustring; const sslInfo: ICefSslInfo;
- const callback: ICefCallback; out Result: Boolean);
- procedure Chromium1NavigationVisitorResultAvailable(Sender: TObject;
- const entry: ICefNavigationEntry; current: Boolean; index, total: Integer;
- var aResult: Boolean);
+
+ procedure CEFWindowParent1DragDrop(Sender, Source: TObject; X, Y: Integer);
+
+ procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser; const url, request_method: ustring; var aResult: boolean);
+ procedure Chromium1CookiesFlushed(Sender: TObject);
+ procedure Chromium1DevToolsMethodResult(Sender: TObject; const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue);
+ procedure Chromium1DownloadImageFinished(Sender: TObject; const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
+ procedure Chromium1MediaAccessChange(Sender: TObject; const browser: ICefBrowser; has_video_access, has_audio_access: boolean);
+ procedure Chromium1RequestMediaAccessPermission(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const requesting_origin: ustring; requested_permissions: cardinal; const callback: ICefMediaAccessCallback; var aResult: boolean);
+ procedure Chromium1ZoomPctAvailable(Sender: TObject; const aZoomPct: double);
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1LoadingStateChange(Sender: TObject; const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
+ procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
+ procedure Chromium1AddressChange(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1StatusMessage(Sender: TObject; const browser: ICefBrowser; const value: ustring);
+ procedure Chromium1TextResultAvailable(Sender: TObject; const aText: ustring);
+ procedure Chromium1FullScreenModeChange(Sender: TObject; const browser: ICefBrowser; fullscreen: Boolean);
+ procedure Chromium1PreKeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
+ procedure Chromium1KeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out Result: Boolean);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ procedure Chromium1PdfPrintFinished(Sender: TObject; aResultOK: Boolean);
+ procedure Chromium1ResourceResponse(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; out Result: Boolean);
+ procedure Chromium1ResolvedHostAvailable(Sender: TObject; result: Integer; const resolvedIps: TStrings);
+ procedure Chromium1PrefsAvailable(Sender: TObject; aResultOK: Boolean);
+ procedure Chromium1BeforeDownload(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback);
+ procedure Chromium1DownloadUpdated(Sender: TObject; const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback);
+ procedure Chromium1BeforeResourceLoad(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback; out Result: TCefReturnValue);
+ procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1RenderCompMsg(Sender: TObject; var aMessage : TMessage; var aHandled: Boolean);
+ procedure Chromium1LoadingProgressChange(Sender: TObject; const browser: ICefBrowser; const progress: Double);
+ procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
+ procedure Chromium1LoadError(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
+ procedure Chromium1CertificateError(Sender: TObject; const browser: ICefBrowser; certError: Integer; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback; out Result: Boolean);
+ procedure Chromium1NavigationVisitorResultAvailable(Sender: TObject; const entry: ICefNavigationEntry; current: Boolean; index, total: Integer; var aResult: Boolean);
protected
FResponse : TStringList;
@@ -269,7 +221,6 @@ type
procedure InspectResponse(const aResponse : ICefResponse);
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowDevToolsMsg(var aMessage : TMessage); message MINIBROWSER_SHOWDEVTOOLS;
procedure HideDevToolsMsg(var aMessage : TMessage); message MINIBROWSER_HIDEDEVTOOLS;
procedure CopyAllTextMsg(var aMessage : TMessage); message MINIBROWSER_COPYALLTEXT;
@@ -312,9 +263,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.
procedure CreateGlobalCEFApp;
begin
@@ -325,7 +275,6 @@ begin
GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.EnableGPU := True;
GlobalCEFApp.SetCurrentDir := True;
- GlobalCEFApp.ChromeRuntime := True;
end;
procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject);
@@ -1138,10 +1087,7 @@ begin
// if TChromium.MultiBrowserMode is enabled then we have to close all
// stored browsers and not only the main browser.
Chromium1.CloseAllBrowsers;
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
@@ -1517,11 +1463,6 @@ begin
NavControlPnl.Enabled := True;
end;
-procedure TMiniBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- FreeAndNil(CEFWindowParent1);
-end;
-
procedure TMiniBrowserFrm.AddURL(const aURL : string);
begin
if (URLCbx.Items.IndexOf(aURL) < 0) then URLCbx.Items.Add(aURL);
diff --git a/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.lfm b/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.lfm
index c447f433..c42942b1 100644
--- a/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.lfm
+++ b/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.lfm
@@ -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
diff --git a/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.pas b/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.pas
index 23994e17..51542f28 100644
--- a/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.pas
+++ b/demos/Lazarus_Windows/MobileBrowser/uMobileBrowser.pas
@@ -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
diff --git a/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.lfm b/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.lfm
index e15fdd2d..758d7e1f 100644
--- a/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.lfm
+++ b/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.lfm
@@ -15,7 +15,6 @@ object MainForm: TMainForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.2.0.0'
object Splitter1: TSplitter
Cursor = crVSplit
Left = 0
@@ -90,7 +89,6 @@ object MainForm: TMainForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
OnDevToolsMethodResult = Chromium1DevToolsMethodResult
OnDevToolsRawEvent = Chromium1DevToolsRawEvent
diff --git a/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.pas b/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.pas
index 4622117b..98e7a5a7 100644
--- a/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.pas
+++ b/demos/Lazarus_Windows/NetworkTrackerBrowser/uMainForm.pas
@@ -35,7 +35,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);
@@ -58,7 +57,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 AddLogLine(const aLogLine: string);
public
@@ -90,9 +88,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 2. TChromium.OnClose sends a CEF_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.
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
@@ -103,6 +100,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -169,13 +167,6 @@ begin
CEF_WOD_NEW_WINDOW]);
end;
-procedure TMainForm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.Chromium1DevToolsMethodResult(Sender: TObject;
const browser: ICefBrowser; message_id: Integer; success: Boolean;
const result: ICefValue);
@@ -216,11 +207,6 @@ begin
AddressPnl.Enabled := True;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.GoBtnClick(Sender: TObject);
begin
// This will load the URL in the edit box
diff --git a/demos/Lazarus_Windows/OAuth2Tester/OAuth2Tester.lpi b/demos/Lazarus_Windows/OAuth2Tester/OAuth2Tester.lpi
index 9d2f8a79..b0d396e2 100644
--- a/demos/Lazarus_Windows/OAuth2Tester/OAuth2Tester.lpi
+++ b/demos/Lazarus_Windows/OAuth2Tester/OAuth2Tester.lpi
@@ -70,6 +70,9 @@
+
+
+
diff --git a/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.lfm b/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.lfm
index c2ea93b5..a2c65a89 100644
--- a/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.lfm
+++ b/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.lfm
@@ -16,7 +16,7 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
OnHide = FormHide
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -27,6 +27,7 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
ClientHeight = 21
ClientWidth = 913
Enabled = False
+ ParentBackground = False
TabOrder = 0
object ComboBox1: TComboBox
Left = 0
@@ -44,9 +45,9 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
'https://frames-per-second.appspot.com/'
'https://www.youtube.com'
)
- OnEnter = ComboBox1Enter
TabOrder = 0
Text = 'https://www.google.com'
+ OnEnter = ComboBox1Enter
end
object Panel2: TPanel
Left = 844
@@ -57,6 +58,7 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
BevelOuter = bvNone
ClientHeight = 21
ClientWidth = 69
+ ParentBackground = False
TabOrder = 1
object GoBtn: TButton
Left = 0
@@ -65,9 +67,9 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
Width = 31
Align = alLeft
Caption = 'Go'
+ TabOrder = 0
OnClick = GoBtnClick
OnEnter = GoBtnEnter
- TabOrder = 0
end
object SnapshotBtn: TButton
Left = 38
@@ -81,12 +83,12 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Webdings'
- OnClick = SnapshotBtnClick
- OnEnter = SnapshotBtnEnter
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 1
+ OnClick = SnapshotBtnClick
+ OnEnter = SnapshotBtnEnter
end
end
end
diff --git a/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas b/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas
index a1d86e78..df2125b2 100644
--- a/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas
+++ b/demos/Lazarus_Windows/OSRExternalPumpBrowser/uOSRExternalPumpBrowser.pas
@@ -27,7 +27,6 @@ type
Timer1: TTimer;
Panel1: TBufferPanel;
- procedure CEFSentinel1Close(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
procedure GoBtnEnter(Sender: TObject);
@@ -173,12 +172,6 @@ begin
chrmosr.LoadURL(ComboBox1.Text);
end;
-procedure TOSRExternalPumpBrowserFrm.CEFSentinel1Close(Sender: TObject);
-begin
- FCanClose := True;
- PostMessage(Handle, WM_CLOSE, 0, 0);
-end;
-
procedure TOSRExternalPumpBrowserFrm.chrmosrIMECompositionRangeChanged( Sender : TObject;
const browser : ICefBrowser;
const selected_range : PCefRange;
diff --git a/demos/Lazarus_Windows/PopupBrowser/uChildForm.lfm b/demos/Lazarus_Windows/PopupBrowser/uChildForm.lfm
index 1616cdc8..15c15940 100644
--- a/demos/Lazarus_Windows/PopupBrowser/uChildForm.lfm
+++ b/demos/Lazarus_Windows/PopupBrowser/uChildForm.lfm
@@ -1,4 +1,5 @@
object ChildForm: TChildForm
+ Tag = 42
Left = 550
Height = 256
Top = 146
@@ -18,15 +19,12 @@ object ChildForm: TChildForm
OnShow = FormShow
Position = poScreenCenter
ShowInTaskBar = stAlways
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object Panel1: TBufferPanel
Left = 0
Height = 256
Top = 0
Width = 352
- OnIMECancelComposition = Panel1IMECancelComposition
- OnIMECommitText = Panel1IMECommitText
- OnIMESetComposition = Panel1IMESetComposition
Align = alClient
OnUTF8KeyPress = Panel1UTF8KeyPress
Caption = 'Panel1'
@@ -46,6 +44,7 @@ object ChildForm: TChildForm
OnResize = Panel1Resize
end
object chrmosr: TChromium
+ OnCanFocus = chrmosrCanFocus
OnTitleChange = chrmosrTitleChange
OnTooltip = chrmosrTooltip
OnCursorChange = chrmosrCursorChange
@@ -57,7 +56,6 @@ object ChildForm: TChildForm
OnPopupShow = chrmosrPopupShow
OnPopupSize = chrmosrPopupSize
OnPaint = chrmosrPaint
- OnIMECompositionRangeChanged = chrmosrIMECompositionRangeChanged
Left = 24
Top = 56
end
diff --git a/demos/Lazarus_Windows/PopupBrowser/uChildForm.pas b/demos/Lazarus_Windows/PopupBrowser/uChildForm.pas
index 47569d54..878d249a 100644
--- a/demos/Lazarus_Windows/PopupBrowser/uChildForm.pas
+++ b/demos/Lazarus_Windows/PopupBrowser/uChildForm.pas
@@ -25,9 +25,6 @@ type
procedure Panel1Enter(Sender: TObject);
procedure Panel1Exit(Sender: TObject);
- procedure Panel1IMECancelComposition(Sender: TObject);
- procedure Panel1IMECommitText(Sender: TObject; const aText: ustring; const replacement_range: PCefRange; relative_cursor_pos: integer);
- procedure Panel1IMESetComposition(Sender: TObject; const aText: ustring; const underlines: TCefCompositionUnderlineDynArray; const replacement_range, selection_range: TCefRange);
procedure Panel1Resize(Sender: TObject);
procedure Panel1Click(Sender: TObject);
procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
@@ -43,7 +40,6 @@ type
procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormHide(Sender: TObject);
- procedure FormAfterMonitorDpiChanged(Sender: TObject; OldDPI, NewDPI: Integer);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormClose(Sender: TObject; var aAction: TCloseAction);
@@ -57,12 +53,11 @@ type
procedure chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser);
procedure chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var aText: ustring; out Result: Boolean);
procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
- procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect);
procedure chrmosrTitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
+ procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser);
+ procedure chrmosrCanFocus(Sender: TObject);
protected
- FbFirst : boolean;
FPopUpBitmap : TBitmap;
FPopUpRect : TRect;
FShowPopUp : boolean;
@@ -72,9 +67,6 @@ type
FClosing : boolean;
FClientInitialized : boolean;
FResizeCS : TCriticalSection;
- FIMECS : TCriticalSection;
- FDeviceBounds : TCefRectDynArray;
- FSelectedRange : TCefRange;
FPopupFeatures : TCefPopupFeatures;
FLastClickCount : integer;
@@ -101,11 +93,11 @@ type
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
procedure PendingResizeMsg(var aMessage : TMessage); message CEF_PENDINGRESIZE;
procedure PendingInvalidateMsg(var aMessage : TMessage); message CEF_PENDINGINVALIDATE;
- procedure RangeChangedMsg(var aMessage : TMessage); message CEF_IMERANGECHANGED;
- procedure ShowChildMsg(var aMessage : TMessage); message CEF_SHOWCHILD;
+ procedure ShowChildMsg(var aMessage : TMessage); message CEF_SHOWCHILD;
+ procedure FocusEnabledMsg(var aMessage : TMessage); message CEF_FOCUSENABLED;
public
- function CreateClientHandler(var windowInfo : TCefWindowInfo; var client : ICefClient; const targetFrameName : string; const popupFeatures : TCefPopupFeatures) : boolean;
+ function CreateClientHandler(var windowInfo : TCefWindowInfo; var client : ICefClient; const targetFrameName : ustring; const popupFeatures : TCefPopupFeatures) : boolean;
procedure ApplyPopupFeatures;
property ClientInitialized : boolean read FClientInitialized;
@@ -129,7 +121,7 @@ uses
function TChildForm.CreateClientHandler(var windowInfo : TCefWindowInfo;
var client : ICefClient;
- const targetFrameName : string;
+ const targetFrameName : ustring;
const popupFeatures : TCefPopupFeatures) : boolean;
begin
Panel1.CreateIMEHandler;
@@ -149,55 +141,6 @@ begin
if (FPopupFeatures.heightset <> 0) then chrmosr.ResizeFormHeightTo(FPopupFeatures.height);
end;
-procedure TChildForm.chrmosrIMECompositionRangeChanged( Sender : TObject;
- const browser : ICefBrowser;
- const selected_range : PCefRange;
- character_boundsCount : NativeUInt;
- const character_bounds : PCefRect);
-var
- TempPRect : PCefRect;
- i : NativeUInt;
-begin
- try
- FIMECS.Acquire;
-
- // TChromium.OnIMECompositionRangeChanged is triggered in a different thread
- // and all functions using a IMM context need to be executed in the same
- // thread, in this case the main thread. We need to save the parameters and
- // send a message to the form to execute Panel1.ChangeCompositionRange in
- // the main thread.
-
- if (FDeviceBounds <> nil) then
- begin
- Finalize(FDeviceBounds);
- FDeviceBounds := nil;
- end;
-
- FSelectedRange := selected_range^;
-
- if (character_boundsCount > 0) then
- begin
- SetLength(FDeviceBounds, character_boundsCount);
-
- i := 0;
- TempPRect := character_bounds;
-
- while (i < character_boundsCount) do
- begin
- FDeviceBounds[i] := TempPRect^;
- LogicalToDevice(FDeviceBounds[i], GlobalCEFApp.DeviceScaleFactor);
-
- inc(TempPRect);
- inc(i);
- end;
- end;
-
- PostMessage(Handle, CEF_IMERANGECHANGED, 0, 0);
- finally
- FIMECS.Release;
- end;
-end;
-
procedure TChildForm.chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
@@ -460,7 +403,7 @@ end;
procedure TChildForm.chrmosrTooltip(Sender: TObject; const browser: ICefBrowser; var aText: ustring; out Result: Boolean);
begin
- Panel1.hint := aText;
+ Panel1.hint := UTF8Encode(aText);
Panel1.ShowHint := (length(aText) > 0);
Result := True;
end;
@@ -611,15 +554,6 @@ begin
Caption := 'Popup Browser';
end;
-procedure TChildForm.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI, NewDPI: Integer);
-begin
- if (chrmosr <> nil) then
- begin
- chrmosr.NotifyScreenInfoChanged;
- chrmosr.WasResized;
- end;
-end;
-
procedure TChildForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := FCanClose;
@@ -634,7 +568,6 @@ end;
procedure TChildForm.FormCreate(Sender: TObject);
begin
- FbFirst := False;
FPopUpBitmap := nil;
FPopUpRect := rect(0, 0, 0, 0);
FShowPopUp := False;
@@ -642,13 +575,7 @@ begin
FPendingResize := False;
FCanClose := False;
FClosing := False;
- FDeviceBounds := nil;
-
- FSelectedRange.from := 0;
- FSelectedRange.to_ := 0;
-
FResizeCS := TCriticalSection.Create;
- FIMECS := TCriticalSection.Create;
InitializeLastClick;
end;
@@ -659,16 +586,9 @@ begin
if (FPopUpBitmap <> nil) then FreeAndNil(FPopUpBitmap);
if (FResizeCS <> nil) then FreeAndNil(FResizeCS);
- if (FIMECS <> nil) then FreeAndNil(FIMECS);
- if (FDeviceBounds <> nil) then
- begin
- Finalize(FDeviceBounds);
- FDeviceBounds := nil;
- end;
-
- if FClientInitialized and TMainForm(Owner).HandleAllocated then
- PostMessage(TMainForm(Owner).Handle, CEF_CHILDDESTROYED, 0, 0);
+ if FClientInitialized and MainForm.HandleAllocated then
+ PostMessage(MainForm.Handle, CEF_CHILDDESTROYED, 0, 0);
end;
procedure TChildForm.FormHide(Sender: TObject);
@@ -784,16 +704,6 @@ begin
Panel1.Invalidate;
end;
-procedure TChildForm.RangeChangedMsg(var aMessage : TMessage);
-begin
- try
- FIMECS.Acquire;
- Panel1.ChangeCompositionRange(FSelectedRange, FDeviceBounds);
- finally
- FIMECS.Release;
- end;
-end;
-
procedure TChildForm.DoResize;
begin
try
@@ -837,33 +747,19 @@ begin
chrmosr.SetFocus(True);
end;
+procedure TChildForm.chrmosrCanFocus(Sender: TObject);
+begin
+ // The browser required some time to create associated internal objects
+ // before being able to accept the focus. Now we can set the focus on the
+ // TBufferPanel control
+ PostMessage(Handle, CEF_FOCUSENABLED, 0, 0);
+end;
+
procedure TChildForm.Panel1Exit(Sender: TObject);
begin
chrmosr.SetFocus(False);
end;
-procedure TChildForm.Panel1IMECancelComposition(Sender: TObject);
-begin
- chrmosr.IMECancelComposition;
-end;
-
-procedure TChildForm.Panel1IMECommitText( Sender : TObject;
- const aText : ustring;
- const replacement_range : PCefRange;
- relative_cursor_pos : Integer);
-begin
- chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos);
-end;
-
-procedure TChildForm.Panel1IMESetComposition( Sender : TObject;
- const aText : ustring;
- const underlines : TCefCompositionUnderlineDynArray;
- const replacement_range : TCefRange;
- const selection_range : TCefRange);
-begin
- chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range);
-end;
-
procedure TChildForm.Panel1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var
TempKeyEvent : TCefKeyEvent;
@@ -925,7 +821,7 @@ end;
procedure TChildForm.chrmosrTitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
begin
- Caption := title;
+ Caption := UTF8Encode(title);
end;
procedure TChildForm.FormClose(Sender: TObject; var aAction: TCloseAction);
@@ -939,4 +835,12 @@ begin
Show;
end;
+procedure TChildForm.FocusEnabledMsg(var aMessage : TMessage);
+begin
+ if Panel1.Focused then
+ chrmosr.SetFocus(True)
+ else
+ Panel1.SetFocus;
+end;
+
end.
diff --git a/demos/Lazarus_Windows/PopupBrowser/uMainForm.lfm b/demos/Lazarus_Windows/PopupBrowser/uMainForm.lfm
index 75efd156..c657d92a 100644
--- a/demos/Lazarus_Windows/PopupBrowser/uMainForm.lfm
+++ b/demos/Lazarus_Windows/PopupBrowser/uMainForm.lfm
@@ -15,7 +15,7 @@ object MainForm: TMainForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 21
diff --git a/demos/Lazarus_Windows/PopupBrowser/uMainForm.pas b/demos/Lazarus_Windows/PopupBrowser/uMainForm.pas
index c9703538..cb374ff6 100644
--- a/demos/Lazarus_Windows/PopupBrowser/uMainForm.pas
+++ b/demos/Lazarus_Windows/PopupBrowser/uMainForm.pas
@@ -12,7 +12,7 @@ uses
const
CEF_CREATENEXTCHILD = WM_APP + $A50;
- CEF_CHILDDESTROYED = WM_APP + $A51;
+ CEF_CHILDDESTROYED = WM_APP + $A51;
type
@@ -27,7 +27,6 @@ type
Chromium1: TChromium;
CEFWindowParent1: TCEFWindowParent;
- procedure CEFSentinel1Close(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
@@ -43,14 +42,16 @@ type
protected
FChildForm : TChildForm;
- FCriticalSection : TCriticalSection;
+ FCriticalSection : TCriticalSection;
+ FChildCounter : cardinal; // Used to create unique child form names.
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosingMainForm : boolean; // Set to True in the CloseQuery event.
FClosingChildren : boolean; // Set to True in the CloseQuery event.
function GetPopupChildCount : integer;
- procedure ClosePopupChildren;
+ procedure ClosePopupChildren;
+ procedure CreateChildForm;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -63,7 +64,7 @@ type
procedure ChildDestroyedMsg(var aMessage : TMessage); message CEF_CHILDDESTROYED;
public
- function CreateClientHandler(var windowInfo : TCefWindowInfo; var client : ICefClient; const targetFrameName : string; const popupFeatures : TCefPopupFeatures) : boolean;
+ function CreateClientHandler(var windowInfo : TCefWindowInfo; var client : ICefClient; const targetFrameName : ustring; const popupFeatures : TCefPopupFeatures) : boolean;
property PopupChildCount : integer read GetPopupChildCount;
end;
@@ -109,7 +110,7 @@ uses
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
- GlobalCEFApp.WindowlessRenderingEnabled := True;
+ GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.SetCurrentDir := True;
end;
@@ -143,8 +144,9 @@ begin
FCanClose := False;
FCriticalSection := TCriticalSection.Create;
- Chromium1.DefaultURL := AddressEdt.Text;
+ Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
Chromium1.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
@@ -192,7 +194,7 @@ end;
function TMainForm.CreateClientHandler(var windowInfo : TCefWindowInfo;
var client : ICefClient;
- const targetFrameName : string;
+ const targetFrameName : ustring;
const popupFeatures : TCefPopupFeatures) : boolean;
begin
try
@@ -244,15 +246,28 @@ begin
if (TempForm is TChildForm) and
TChildForm(TempForm).ClientInitialized and
not(TChildForm(TempForm).Closing) then
- PostMessage(TChildForm(TempForm).Handle, WM_CLOSE, 0, 0);
+ PostMessage(TempForm.Handle, WM_CLOSE, 0, 0);
dec(i);
end;
end;
+procedure TMainForm.CreateChildForm;
+begin
+ if (FChildCounter < high(cardinal)) then
+ inc(FChildCounter)
+ else
+ FChildCounter := 1;
+
+ FChildForm := TChildForm.Create(self);
+ FChildForm.Name := 'ChildForm_' + IntToStr(FChildCounter);
+ FChildForm.Tag := FChildCounter;
+end;
+
procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
begin
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
+
Caption := 'Popup Browser';
AddressPnl.Enabled := True;
end;
@@ -268,13 +283,9 @@ begin
FCriticalSection.Acquire;
if (FChildForm <> nil) then
- begin
- //FChildForm.ApplyPopupFeatures;
- //FChildForm.Show;
- PostMessage(FChildForm.Handle, CEF_SHOWCHILD, 0, 0);
- end;
+ PostMessage(FChildForm.Handle, CEF_SHOWCHILD, 0, 0);
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
finally
FCriticalSection.Release;
end;
@@ -282,18 +293,14 @@ end;
procedure TMainForm.ChildDestroyedMsg(var aMessage : TMessage);
begin
- if FClosingChildren and (PopupChildCount = 0) then Close;
+ if FClosingChildren and (PopupChildCount = 0) then
+ Close;
end;
procedure TMainForm.GoBtnClick(Sender: TObject);
begin
// This will load the URL in the edit box
- Chromium1.LoadURL(AddressEdt.Text);
-end;
-
-procedure TMainForm.CEFSentinel1Close(Sender: TObject);
-begin
-
+ Chromium1.LoadURL(UTF8Decode(AddressEdt.Text));
end;
procedure TMainForm.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
diff --git a/demos/Lazarus_Windows/PopupBrowser2/uChildForm.dfm b/demos/Lazarus_Windows/PopupBrowser2/uChildForm.dfm
index 60805f42..1866e499 100644
--- a/demos/Lazarus_Windows/PopupBrowser2/uChildForm.dfm
+++ b/demos/Lazarus_Windows/PopupBrowser2/uChildForm.dfm
@@ -16,7 +16,6 @@ object ChildForm: TChildForm
OnDestroy = FormDestroy
Position = poScreenCenter
ShowInTaskBar = stAlways
- LCLVersion = '2.0.2.0'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 256
@@ -29,8 +28,7 @@ object ChildForm: TChildForm
OnTitleChange = Chromium1TitleChange
OnBeforePopup = Chromium1BeforePopup
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 24
- top = 56
+ Left = 24
+ Top = 56
end
end
diff --git a/demos/Lazarus_Windows/PopupBrowser2/uChildForm.pas b/demos/Lazarus_Windows/PopupBrowser2/uChildForm.pas
index 1933078d..d7c504d4 100644
--- a/demos/Lazarus_Windows/PopupBrowser2/uChildForm.pas
+++ b/demos/Lazarus_Windows/PopupBrowser2/uChildForm.pas
@@ -24,7 +24,6 @@ type
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: Boolean; var Result: Boolean);
procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
protected
@@ -37,7 +36,6 @@ type
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 BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure ShowChildMsg(var aMessage : TMessage); message CEF_SHOWCHILD;
public
@@ -136,12 +134,6 @@ begin
end;
end;
-procedure TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
begin
Caption := title;
@@ -189,10 +181,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
@@ -209,11 +198,6 @@ begin
PostMessage(TMainForm(Owner).Handle, CEF_CHILDDESTROYED, 0, 0);
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TChildForm.ShowChildMsg(var aMessage : TMessage);
begin
ApplyPopupFeatures;
diff --git a/demos/Lazarus_Windows/PopupBrowser2/uMainForm.lfm b/demos/Lazarus_Windows/PopupBrowser2/uMainForm.lfm
index eab3cc2b..491e9ed7 100644
--- a/demos/Lazarus_Windows/PopupBrowser2/uMainForm.lfm
+++ b/demos/Lazarus_Windows/PopupBrowser2/uMainForm.lfm
@@ -15,7 +15,6 @@ object MainForm: TMainForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object AddressPnl: TPanel
Left = 0
Height = 21
@@ -26,6 +25,7 @@ object MainForm: TMainForm
ClientHeight = 21
ClientWidth = 1038
Enabled = False
+ ParentBackground = False
TabOrder = 0
object AddressEdt: TEdit
Left = 0
@@ -43,8 +43,8 @@ object MainForm: TMainForm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -59,19 +59,18 @@ object MainForm: TMainForm
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 56
- top = 88
+ Left = 56
+ Top = 88
end
object Chromium1: TChromium
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 56
- top = 152
+ Left = 56
+ Top = 152
end
object ApplicationProperties1: TApplicationProperties
- left = 56
- top = 216
+ Left = 56
+ Top = 216
end
end
diff --git a/demos/Lazarus_Windows/PopupBrowser2/uMainForm.pas b/demos/Lazarus_Windows/PopupBrowser2/uMainForm.pas
index 96e7f4b4..e7e09c69 100644
--- a/demos/Lazarus_Windows/PopupBrowser2/uMainForm.pas
+++ b/demos/Lazarus_Windows/PopupBrowser2/uMainForm.pas
@@ -27,7 +27,6 @@ type
Chromium1: TChromium;
CEFWindowParent1: TCEFWindowParent;
- procedure CEFSentinel1Close(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
@@ -39,18 +38,19 @@ type
procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction: TCefCloseBrowserAction);
protected
FChildForm : TChildForm;
- FCriticalSection : TCriticalSection;
+ FCriticalSection : TCriticalSection;
+ FChildCounter : cardinal; // Used to create unique child form names.
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosingMainForm : boolean; // Set to True in the CloseQuery event.
FClosingChildren : boolean; // Set to True in the CloseQuery event.
function GetPopupChildCount : integer;
- procedure ClosePopupChildren;
+ procedure ClosePopupChildren;
+ procedure CreateChildForm;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@@ -58,7 +58,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 CreateNextChildMsg(var aMessage : TMessage); message CEF_CREATENEXTCHILD;
procedure ChildDestroyedMsg(var aMessage : TMessage); message CEF_CHILDDESTROYED;
@@ -101,15 +100,13 @@ uses
// Destruction steps
// =================
// 1. FormCloseQuery sets CanClose to FALSE and it closes all child forms.
-// 2. When all the child forms are closed then FormCloseQuery is triggered again, sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
-// 3. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
-// 4. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
+// 2. When all the child forms are closed then FormCloseQuery is triggered again, destroys CEFWindowParent1 and calls TChromium.CloseBrowser 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.SetCurrentDir := True;
- GlobalCEFApp.ChromeRuntime := True;
//GlobalCEFApp.LogFile := 'cef.log';
//GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
end;
@@ -132,10 +129,7 @@ begin
begin
FClosingMainForm := True;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
+ CEFWindowParent1.Free;
end;
end;
end;
@@ -254,31 +248,31 @@ begin
end;
end;
+procedure TMainForm.CreateChildForm;
+begin
+ inc(FChildCounter);
+
+ FChildForm := TChildForm.Create(self);
+ FChildForm.Name := 'ChildForm_' + IntToStr(FChildCounter);
+end;
+
procedure TMainForm.BrowserCreatedMsg(var aMessage : TMessage);
begin
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
+
Caption := 'Popup Browser';
AddressPnl.Enabled := True;
end;
-procedure TMainForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TMainForm.CreateNextChildMsg(var aMessage : TMessage);
begin
try
FCriticalSection.Acquire;
if (FChildForm <> nil) then
- begin
- //FChildForm.ApplyPopupFeatures;
- //FChildForm.Show;
- PostMessage(FChildForm.Handle, CEF_SHOWCHILD, 0, 0);
- end;
+ PostMessage(FChildForm.Handle, CEF_SHOWCHILD, 0, 0);
- FChildForm := TChildForm.Create(self);
+ CreateChildForm;
finally
FCriticalSection.Release;
end;
@@ -286,7 +280,8 @@ end;
procedure TMainForm.ChildDestroyedMsg(var aMessage : TMessage);
begin
- if FClosingChildren and (PopupChildCount = 0) then Close;
+ if FClosingChildren and (PopupChildCount = 0) then
+ PostMessage(Handle, WM_CLOSE, 0, 0);
end;
procedure TMainForm.GoBtnClick(Sender: TObject);
@@ -295,24 +290,12 @@ begin
Chromium1.LoadURL(AddressEdt.Text);
end;
-procedure TMainForm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TMainForm.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
-procedure TMainForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction: TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TMainForm.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
diff --git a/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.lfm b/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.lfm
index a3eb33d7..ae7c03ba 100644
--- a/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.lfm
+++ b/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.lfm
@@ -15,7 +15,6 @@ object Form1: TForm1
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
object Splitter1: TSplitter
Cursor = crVSplit
Left = 0
@@ -49,11 +48,11 @@ object Form1: TForm1
end
object AddressCb: TComboBox
Left = 0
- Height = 21
+ Height = 22
Top = 0
Width = 1007
Align = alClient
- ItemHeight = 13
+ ItemHeight = 14
ItemIndex = 0
Items.Strings = (
'https://tryphp.w3schools.com/showphp.php?filename=demo_form_post'
@@ -90,7 +89,6 @@ object Form1: TForm1
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnBeforeResourceLoad = Chromium1BeforeResourceLoad
Left = 56
Top = 152
diff --git a/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.pas b/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.pas
index 7fec1ab7..a8cc7a85 100644
--- a/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.pas
+++ b/demos/Lazarus_Windows/PostInspectorBrowser/uPostInspectorBrowser.pas
@@ -31,29 +31,20 @@ type
Memo1: TMemo;
AddressCb: TComboBox;
Splitter1: TSplitter;
- procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
- procedure FormCreate(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
+
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
- procedure Chromium1BeforeResourceLoad(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const request: ICefRequest; const callback: ICefCallback;
- out Result: TCefReturnValue);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+ procedure GoBtnClick(Sender: TObject);
+ procedure Timer1Timer(Sender: TObject);
+
+ procedure Chromium1AfterCreated(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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1BeforeResourceLoad(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback; out Result: TCefReturnValue);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
@@ -70,7 +61,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 ShowDataMsg(var aMessage : TMessage); message CEF_SHOWDATA;
procedure HandleRequest(const request : ICefRequest; aIsMain : boolean);
@@ -104,9 +94,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.
procedure CreateGlobalCEFApp;
begin
@@ -125,6 +114,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -374,24 +364,12 @@ 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.BrowserCreatedMsg(var aMessage : TMessage);
begin
Caption := 'POST Inspector Browser';
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
diff --git a/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.lfm b/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.lfm
index 5262a9d0..6c43de5e 100644
--- a/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.lfm
+++ b/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.lfm
@@ -15,7 +15,6 @@ object ResponseFilterBrowserFrm: TResponseFilterBrowserFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.2.0.0'
object Splitter1: TSplitter
Cursor = crVSplit
Left = 0
@@ -165,7 +164,6 @@ object ResponseFilterBrowserFrm: TResponseFilterBrowserFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnBeforeResourceLoad = Chromium1BeforeResourceLoad
OnResourceResponse = Chromium1ResourceResponse
OnGetResourceResponseFilter = Chromium1GetResourceResponseFilter
diff --git a/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.pas b/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.pas
index be9bdbc6..a5590095 100644
--- a/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.pas
+++ b/demos/Lazarus_Windows/ResponseFilterBrowser/uResponseFilterBrowser.pas
@@ -37,7 +37,6 @@ type
procedure Chromium1GetResourceResponseFilter(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; out Result: ICefResponseFilter);
procedure Chromium1ResourceLoadComplete(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; status: TCefUrlRequestStatus; receivedContentLength: Int64);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium1LoadStart(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; transitionType: Cardinal);
procedure Chromium1BeforeResourceLoad(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback; out Result: TCefReturnValue);
@@ -71,7 +70,6 @@ type
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 StreamCopyCompleteMsg(var aMessage : TMessage); message STREAM_COPY_COMPLETE;
procedure Filter_OnFilter(Sender: TObject; data_in: Pointer; data_in_size: NativeUInt; var data_in_read: NativeUInt; data_out: Pointer; data_out_size : NativeUInt; var data_out_written: NativeUInt; var aResult : TCefResponseFilterStatus);
@@ -109,12 +107,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.
// TCustomResponseFilter.OnFilter event might be called multiple times
// when the resource is too big. In that case the resource will be split into
@@ -403,6 +397,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -514,12 +509,6 @@ begin
end;
end;
-procedure TResponseFilterBrowserFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TResponseFilterBrowserFrm.Chromium1GetResourceResponseFilter( Sender : TObject;
const browser : ICefBrowser;
const frame : ICefFrame;
@@ -668,11 +657,6 @@ begin
GoBtn.Click;
end;
-procedure TResponseFilterBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
// This procedure handles the stream contents after it's fully downloaded
procedure TResponseFilterBrowserFrm.StreamCopyCompleteMsg(var aMessage : TMessage);
var
diff --git a/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.lfm b/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.lfm
index bff94441..56968ce9 100644
--- a/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.lfm
+++ b/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.lfm
@@ -14,7 +14,6 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.12.0'
object AddressBarPnl: TPanel
Left = 0
Height = 21
@@ -26,6 +25,7 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
ClientWidth = 980
DoubleBuffered = True
Enabled = False
+ ParentBackground = False
ParentDoubleBuffered = False
TabOrder = 0
object GoBtn: TButton
@@ -35,16 +35,16 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object AddressCbx: TComboBox
Left = 0
- Height = 21
+ Height = 22
Top = 0
Width = 949
Align = alClient
- ItemHeight = 13
+ ItemHeight = 14
ItemIndex = 1
Items.Strings = (
'https://www.google.com'
@@ -68,7 +68,6 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 16
Top = 40
end
diff --git a/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas b/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas
index f81b77fc..c674564d 100644
--- a/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas
+++ b/demos/Lazarus_Windows/SchemeRegistrationBrowser/uSchemeRegistrationBrowser.pas
@@ -34,42 +34,26 @@ type
Chromium1: TChromium;
AddressCbx: TComboBox;
Timer1: TTimer;
- procedure CEFSentinel1Close(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject;
- const browser: ICefBrowser);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
+
procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
- private
- { Private declarations }
+
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ 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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -92,9 +76,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.
procedure GlobalCEFApp_OnRegCustomSchemes(const registrar: TCefSchemeRegistrarRef);
begin
@@ -113,11 +96,6 @@ begin
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
end;
-procedure TSchemeRegistrationBrowserFrm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TSchemeRegistrationBrowserFrm.Chromium1BeforeClose(
Sender: TObject; const browser: ICefBrowser);
begin
@@ -146,13 +124,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 TSchemeRegistrationBrowserFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TSchemeRegistrationBrowserFrm.Chromium1ContextMenuCommand(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -194,6 +165,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -229,11 +201,6 @@ begin
GoBtn.Click;
end;
-procedure TSchemeRegistrationBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TSchemeRegistrationBrowserFrm.WMMove(var aMessage : TWMMove);
begin
inherited;
diff --git a/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.lfm b/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.lfm
index bff94441..56968ce9 100644
--- a/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.lfm
+++ b/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.lfm
@@ -14,7 +14,6 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.12.0'
object AddressBarPnl: TPanel
Left = 0
Height = 21
@@ -26,6 +25,7 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
ClientWidth = 980
DoubleBuffered = True
Enabled = False
+ ParentBackground = False
ParentDoubleBuffered = False
TabOrder = 0
object GoBtn: TButton
@@ -35,16 +35,16 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object AddressCbx: TComboBox
Left = 0
- Height = 21
+ Height = 22
Top = 0
Width = 949
Align = alClient
- ItemHeight = 13
+ ItemHeight = 14
ItemIndex = 1
Items.Strings = (
'https://www.google.com'
@@ -68,7 +68,6 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
Left = 16
Top = 40
end
diff --git a/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.pas b/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.pas
index 9324b345..171b0041 100644
--- a/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.pas
+++ b/demos/Lazarus_Windows/SchemeRegistrationBrowser_subprocess/uSchemeRegistrationBrowser.pas
@@ -34,41 +34,26 @@ type
Chromium1: TChromium;
AddressCbx: TComboBox;
Timer1: TTimer;
- procedure Chromium1AfterCreated(Sender: TObject;
- const browser: ICefBrowser);
- procedure Chromium1BeforeContextMenu(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; const model: ICefMenuModel);
- procedure Chromium1ContextMenuCommand(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const params: ICefContextMenuParams; commandId: Integer;
- eventFlags: Cardinal; out Result: Boolean);
- procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
+
+ procedure GoBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- 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: Boolean; var Result: Boolean);
+
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1BeforeClose(Sender: TObject;
- const browser: ICefBrowser);
- private
- { Private declarations }
+
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
+ procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
+ 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: Boolean; var Result: Boolean);
+ procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
FClosing : boolean; // Set to True in the CloseQuery event.
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -91,9 +76,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.
procedure GlobalCEFApp_OnRegCustomSchemes(const registrar: TCefSchemeRegistrarRef);
begin
@@ -143,13 +127,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 TSchemeRegistrationBrowserFrm.Chromium1Close(Sender: TObject;
- const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEF_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TSchemeRegistrationBrowserFrm.Chromium1ContextMenuCommand(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer;
@@ -191,6 +168,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -226,11 +204,6 @@ begin
GoBtn.Click;
end;
-procedure TSchemeRegistrationBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
procedure TSchemeRegistrationBrowserFrm.WMMove(var aMessage : TWMMove);
begin
inherited;
diff --git a/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.lfm b/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.lfm
index 4e9fbb7e..91e7e389 100644
--- a/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.lfm
+++ b/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.lfm
@@ -14,7 +14,7 @@ object Form1: TForm1
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.10.0'
+ LCLVersion = '3.4.0.0'
object ChromiumWindow1: TChromiumWindow
Left = 0
Height = 603
@@ -36,6 +36,7 @@ object Form1: TForm1
ClientHeight = 21
ClientWidth = 1038
Enabled = False
+ ParentBackground = False
TabOrder = 1
object AddressEdt: TEdit
Left = 0
@@ -53,8 +54,8 @@ object Form1: TForm1
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object Timer1: TTimer
diff --git a/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.pas b/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.pas
index d7cd15c0..77f8471e 100644
--- a/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.pas
+++ b/demos/Lazarus_Windows/SimpleBrowser/uSimpleBrowser.pas
@@ -105,7 +105,8 @@ begin
FClosing := False;
// The browser will load the URL in AddressEdt initially.
- ChromiumWindow1.ChromiumBrowser.DefaultURL := AddressEdt.Text;
+ ChromiumWindow1.ChromiumBrowser.DefaultURL := AddressEdt.Text;
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.FormShow(Sender: TObject);
diff --git a/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.lfm b/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.lfm
index f94471d2..c47ad302 100644
--- a/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.lfm
+++ b/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.lfm
@@ -10,7 +10,6 @@ object Form1: TForm1
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object AddressPnl: TPanel
Left = 0
Height = 23
@@ -38,8 +37,8 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object CEFWindowParent1: TCEFWindowParent
@@ -54,16 +53,15 @@ object Form1: TForm1
Enabled = False
Interval = 500
OnTimer = Timer1Timer
- left = 40
- top = 64
+ Left = 40
+ Top = 64
end
object Chromium1: TChromium
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
OnOpenUrlFromTab = Chromium1OpenUrlFromTab
- left = 40
- top = 136
+ Left = 40
+ Top = 136
end
end
diff --git a/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.pas b/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.pas
index 1df3545e..bd6117b7 100644
--- a/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.pas
+++ b/demos/Lazarus_Windows/SimpleBrowser2/uSimpleBrowser2.pas
@@ -18,27 +18,19 @@ type
AddressEdt: TEdit;
AddressPnl: TPanel;
Timer1: TTimer;
- procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser
- );
+
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
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: Boolean; var Result: Boolean);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1OpenUrlFromTab(Sender: TObject;
- const browser: ICefBrowser; const frame: ICefFrame;
- const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition;
- userGesture: Boolean; out Result: Boolean);
+ 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: Boolean; var Result: Boolean);
+ procedure Chromium1OpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
+
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
+
procedure GoBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
+
protected
// Variables to control when can we destroy the form safely
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
@@ -52,7 +44,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;
public
end;
@@ -80,9 +71,8 @@ implementation
// 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.
uses
uCEFApplication;
@@ -104,6 +94,7 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -142,12 +133,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.FormShow(Sender: TObject);
begin
// You *MUST* call CreateBrowser to create and initialize the browser.
@@ -207,10 +192,5 @@ begin
GoBtn.Click;
end;
-procedure TForm1.BrowserDestroyMsg(var aMessage: TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.lfm b/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.lfm
index a2641dfd..87d26989 100644
--- a/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.lfm
+++ b/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.lfm
@@ -14,7 +14,7 @@ object SimpleExternalPumpBrowserFrm: TSimpleExternalPumpBrowserFrm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 21
@@ -25,6 +25,7 @@ object SimpleExternalPumpBrowserFrm: TSimpleExternalPumpBrowserFrm
ClientHeight = 21
ClientWidth = 1038
Enabled = False
+ ParentBackground = False
TabOrder = 0
object GoBtn: TButton
Left = 1007
@@ -33,8 +34,8 @@ object SimpleExternalPumpBrowserFrm: TSimpleExternalPumpBrowserFrm
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object URLCbx: TComboBox
Left = 0
@@ -82,7 +83,7 @@ object SimpleExternalPumpBrowserFrm: TSimpleExternalPumpBrowserFrm
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 56
- top = 88
+ Left = 56
+ Top = 88
end
end
diff --git a/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas b/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas
index 1a83e8a5..d4f21912 100644
--- a/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas
+++ b/demos/Lazarus_Windows/SimpleExternalPumpBrowser/uSimpleExternalPumpBrowser.pas
@@ -26,11 +26,10 @@ type
URLCbx: TComboBox;
ChromiumWindow1: TChromiumWindow;
- procedure CEFSentinel1Close(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
+ procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -94,6 +93,7 @@ procedure TSimpleExternalPumpBrowserFrm.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TSimpleExternalPumpBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -161,11 +161,6 @@ begin
ChromiumWindow1.LoadURL(URLCbx.Text);
end;
-procedure TSimpleExternalPumpBrowserFrm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TSimpleExternalPumpBrowserFrm.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
diff --git a/demos/Lazarus_Windows/SimpleOSRBrowser2/usimplelazosrbrowser2.lfm b/demos/Lazarus_Windows/SimpleOSRBrowser2/usimplelazosrbrowser2.lfm
index 1cb3fc31..bdbd19e9 100644
--- a/demos/Lazarus_Windows/SimpleOSRBrowser2/usimplelazosrbrowser2.lfm
+++ b/demos/Lazarus_Windows/SimpleOSRBrowser2/usimplelazosrbrowser2.lfm
@@ -16,7 +16,6 @@ object Form1: TForm1
OnHide = FormHide
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
object NavControlPnl: TPanel
Left = 0
Height = 21
@@ -31,11 +30,11 @@ object Form1: TForm1
TabOrder = 0
object ComboBox1: TComboBox
Left = 0
- Height = 21
+ Height = 22
Top = 0
Width = 892
Align = alClient
- ItemHeight = 13
+ ItemHeight = 14
Items.Strings = (
'https://www.google.co'
'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_select_form'
diff --git a/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.lfm b/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.lfm
index b1f48676..6bd9927f 100644
--- a/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.lfm
+++ b/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.lfm
@@ -11,9 +11,9 @@ object Form1: TForm1
Font.Height = -11
Font.Name = 'Tahoma'
OnCloseQuery = FormCloseQuery
+ OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '2.0.6.0'
object ChromiumWindow1: TChromiumWindow
Left = 0
Height = 603
@@ -35,6 +35,7 @@ object Form1: TForm1
ClientHeight = 21
ClientWidth = 1038
Enabled = False
+ ParentBackground = False
TabOrder = 1
object AddressEdt: TEdit
Left = 0
@@ -52,15 +53,15 @@ object Form1: TForm1
Width = 31
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 1
+ OnClick = GoBtnClick
end
end
object Timer1: TTimer
Enabled = False
Interval = 300
OnTimer = Timer1Timer
- left = 80
- top = 88
+ Left = 80
+ Top = 88
end
end
diff --git a/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.pas b/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.pas
index 5597c0f5..248bfbca 100644
--- a/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.pas
+++ b/demos/Lazarus_Windows/SubProcess/uSimpleBrowser.pas
@@ -25,14 +25,18 @@ type
AddressEdt: TEdit;
GoBtn: TButton;
Timer1: TTimer;
- procedure CEFSentinel1Close(Sender: TObject);
+
+ procedure FormCreate(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure ChromiumWindow1AfterCreated(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
+
+ procedure FormShow(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+ procedure ChromiumWindow1AfterCreated(Sender: TObject);
procedure ChromiumWindow1Close(Sender: TObject);
procedure ChromiumWindow1BeforeClose(Sender: TObject);
+
private
// You have to handle this two messages to call NotifyMoveOrResizeStarted or some page elements will be misaligned.
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
@@ -155,9 +159,9 @@ begin
ChromiumWindow1.LoadURL(AddressEdt.Text);
end;
-procedure TForm1.CEFSentinel1Close(Sender: TObject);
+procedure TForm1.FormCreate(Sender: TObject);
begin
-
+ ChromiumWindow1.ChromiumBrowser.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
diff --git a/demos/Lazarus_Windows/TabbedBrowser/uMainForm.lfm b/demos/Lazarus_Windows/TabbedBrowser/uMainForm.lfm
index 42e04468..886e849b 100644
--- a/demos/Lazarus_Windows/TabbedBrowser/uMainForm.lfm
+++ b/demos/Lazarus_Windows/TabbedBrowser/uMainForm.lfm
@@ -14,7 +14,7 @@ object MainForm: TMainForm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.0.0.3'
+ LCLVersion = '3.4.0.0'
object ButtonPnl: TPanel
Left = 0
Height = 25
diff --git a/demos/Lazarus_Windows/TabbedBrowser/uMainForm.pas b/demos/Lazarus_Windows/TabbedBrowser/uMainForm.pas
index 455e1225..977763ed 100644
--- a/demos/Lazarus_Windows/TabbedBrowser/uMainForm.pas
+++ b/demos/Lazarus_Windows/TabbedBrowser/uMainForm.pas
@@ -39,18 +39,19 @@ type
URLCbx: TComboBox;
AddTabBtn: TButton;
RemoveTabBtn: TButton;
- procedure AddTabBtnClick(Sender: TObject);
- procedure CEFSentinel1Close(Sender: TObject);
- procedure RemoveTabBtnClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure PageControl1Change(Sender: TObject);
+
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+ procedure PageControl1Change(Sender: TObject);
+ procedure AddTabBtnClick(Sender: TObject);
+ procedure RemoveTabBtnClick(Sender: TObject);
procedure BackBtnClick(Sender: TObject);
procedure ForwardBtnClick(Sender: TObject);
procedure ReloadBtnClick(Sender: TObject);
procedure StopBtnClick(Sender: TObject);
procedure GoBtnClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
protected
FClosingTab : boolean;
@@ -153,15 +154,11 @@ begin
TempChromium.OnClose := Chromium_OnClose;
TempChromium.OnBeforeClose := Chromium_OnBeforeClose;
TempChromium.OnBeforePopup := Chromium_OnBeforePopup;
+ TempChromium.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
TempChromium.CreateBrowser(TempWindowParent, '');
end;
-procedure TMainForm.CEFSentinel1Close(Sender: TObject);
-begin
-
-end;
-
procedure TMainForm.RemoveTabBtnClick(Sender: TObject);
var
TempChromium : TChromium;
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/TabbedBrowser2.lpi b/demos/Lazarus_Windows/TabbedBrowser2/TabbedBrowser2.lpi
index ed38edf1..551d3add 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/TabbedBrowser2.lpi
+++ b/demos/Lazarus_Windows/TabbedBrowser2/TabbedBrowser2.lpi
@@ -50,7 +50,9 @@
+
+
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.lfm b/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.lfm
index ccf7dd8b..7385ae93 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.lfm
+++ b/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.lfm
@@ -1,82 +1,84 @@
object BrowserFrame: TBrowserFrame
Left = 0
+ Height = 670
Top = 0
Width = 932
- Height = 670
+ ClientHeight = 670
+ ClientWidth = 932
TabOrder = 0
object NavControlPnl: TPanel
Left = 0
+ Height = 35
Top = 0
Width = 932
- Height = 35
Align = alTop
BevelOuter = bvNone
+ ClientHeight = 35
+ ClientWidth = 932
Enabled = False
TabOrder = 0
object NavButtonPnl: TPanel
Left = 0
+ Height = 35
Top = 0
Width = 123
- Height = 35
Align = alLeft
BevelOuter = bvNone
+ ClientHeight = 35
+ ClientWidth = 123
TabOrder = 0
object BackBtn: TButton
Left = 3
+ Height = 25
Top = 3
Width = 25
- Height = 25
Caption = '3'
- Font.Charset = SYMBOL_CHARSET
+ Font.CharSet = SYMBOL_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- Font.Style = []
ParentFont = False
TabOrder = 0
OnClick = BackBtnClick
end
object ForwardBtn: TButton
Left = 33
+ Height = 25
Top = 3
Width = 25
- Height = 25
Caption = '4'
- Font.Charset = SYMBOL_CHARSET
+ Font.CharSet = SYMBOL_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- Font.Style = []
ParentFont = False
TabOrder = 1
OnClick = ForwardBtnClick
end
object ReloadBtn: TButton
Left = 62
+ Height = 25
Top = 3
Width = 25
- Height = 25
Caption = 'q'
- Font.Charset = SYMBOL_CHARSET
+ Font.CharSet = SYMBOL_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- Font.Style = []
ParentFont = False
TabOrder = 2
OnClick = ReloadBtnClick
end
object StopBtn: TButton
Left = 91
+ Height = 25
Top = 3
Width = 25
- Height = 25
Caption = '='
- Font.Charset = SYMBOL_CHARSET
+ Font.CharSet = SYMBOL_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
- Font.Style = []
ParentFont = False
TabOrder = 3
OnClick = StopBtnClick
@@ -84,32 +86,29 @@ object BrowserFrame: TBrowserFrame
end
object URLEditPnl: TPanel
Left = 121
+ Height = 35
Top = 0
Width = 774
- Height = 35
Align = alClient
BevelOuter = bvNone
+ ClientHeight = 35
+ ClientWidth = 774
TabOrder = 1
object URLCbx: TComboBox
Left = 0
+ Height = 21
Top = 5
Width = 770
- Height = 21
- Anchors = [akLeft, akTop, akRight]
+ Anchors = [akTop, akLeft, akRight]
+ ItemHeight = 0
ItemIndex = 0
- TabOrder = 0
- Text = 'https://www.google.com'
Items.Strings = (
'https://www.google.com'
-
- 'https://www.whatismybrowser.com/detect/what-http-headers-is-my-b' +
- 'rowser-sending'
+ 'https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending'
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close'
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert'
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_loc_assign'
-
- 'https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_styl' +
- 'e_backgroundcolor'
+ 'https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_backgroundcolor'
'https://www.w3schools.com/html/html5_video.asp'
'http://www.adobe.com/software/flash/about/'
'http://isflashinstalled.com/'
@@ -117,9 +116,7 @@ object BrowserFrame: TBrowserFrame
'https://www.ultrasounds.com/'
'https://www.whatismybrowser.com/detect/is-flash-installed'
'http://html5test.com/'
-
- 'https://webrtc.github.io/samples/src/content/devices/input-outpu' +
- 't/'
+ 'https://webrtc.github.io/samples/src/content/devices/input-output/'
'https://test.webrtc.org/'
'https://www.w3schools.com/'
'http://webglsamples.org/'
@@ -127,15 +124,9 @@ object BrowserFrame: TBrowserFrame
'https://www.briskbard.com'
'https://www.youtube.com'
'https://html5demos.com/drag/'
-
- 'https://developers.google.com/maps/documentation/javascript/exam' +
- 'ples/streetview-embed?hl=fr'
-
- 'https://www.w3schools.com/Tags/tryit.asp?filename=tryhtml_iframe' +
- '_name'
-
- 'http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/html/tryit' +
- '.asp-filename=tryhtml5_html_manifest.html'
+ 'https://developers.google.com/maps/documentation/javascript/examples/streetview-embed?hl=fr'
+ 'https://www.w3schools.com/Tags/tryit.asp?filename=tryhtml_iframe_name'
+ 'http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/html/tryit.asp-filename=tryhtml5_html_manifest.html'
'https://www.browserleaks.com/webrtc'
'https://frames-per-second.appspot.com/'
'chrome://version/'
@@ -155,24 +146,29 @@ object BrowserFrame: TBrowserFrame
'chrome://gpucrash'
'chrome://gpuhang'
'chrome://extensions-support'
- 'chrome://process-internals')
+ 'chrome://process-internals'
+ )
+ TabOrder = 0
+ Text = 'https://www.google.com'
end
end
object ConfigPnl: TPanel
Left = 895
+ Height = 35
Top = 0
Width = 35
- Height = 35
Align = alRight
BevelOuter = bvNone
+ ClientHeight = 35
+ ClientWidth = 35
TabOrder = 2
object GoBtn: TButton
Left = 3
+ Height = 25
Top = 3
Width = 25
- Height = 25
Caption = '►'
- Font.Charset = ANSI_CHARSET
+ Font.CharSet = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'Arial'
@@ -185,10 +181,10 @@ object BrowserFrame: TBrowserFrame
end
object StatusBar1: TStatusBar
Left = 0
+ Height = 19
Top = 651
Width = 932
- Height = 19
- Panels = <
+ Panels = <
item
Width = 500
end>
@@ -196,9 +192,9 @@ object BrowserFrame: TBrowserFrame
end
object CEFWindowParent1: TCEFWindowParent
Left = 0
+ Height = 616
Top = 35
Width = 932
- Height = 616
Align = alClient
TabOrder = 2
end
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.pas b/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.pas
index 737cfac2..7fd54fd5 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.pas
+++ b/demos/Lazarus_Windows/TabbedBrowser2/uBrowserFrame.pas
@@ -274,7 +274,8 @@ end;
procedure TBrowserFrame.CreateBrowser;
begin
- Chromium1.DefaultURL := FHomepage;
+ Chromium1.DefaultURL := FHomepage;
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
Chromium1.CreateBrowser(CEFWindowParent1);
end;
@@ -285,10 +286,6 @@ begin
FClosing := True;
NavControlPnl.Enabled := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
end;
end;
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.lfm b/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.lfm
index f5150d1d..2f9c73a8 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.lfm
+++ b/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.lfm
@@ -15,7 +15,7 @@ object ChildForm: TChildForm
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
- LCLVersion = '3.2.0.0'
+ LCLVersion = '3.4.0.0'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 256
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.pas b/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.pas
index 61ef613e..40cef7a1 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.pas
+++ b/demos/Lazarus_Windows/TabbedBrowser2/uChildForm.pas
@@ -237,10 +237,6 @@ begin
FClosing := True;
Visible := False;
Chromium1.CloseBrowser(True);
-
- // Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
- if GlobalCEFApp.ChromeRuntime then
- CEFWindowParent1.Free;
end;
end
else
@@ -253,6 +249,8 @@ begin
FBrowserWasCreated := False;
FCanClose := False;
FClosing := False;
+
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
end;
procedure TChildForm.FormDestroy(Sender: TObject);
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.lfm b/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.lfm
index 67226b76..9cade86f 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.lfm
+++ b/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.lfm
@@ -15,7 +15,7 @@ object MainForm: TMainForm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
- LCLVersion = '3.2.0.0'
+ LCLVersion = '3.4.0.0'
object BrowserPageCtrl: TPageControl
Left = 32
Height = 703
diff --git a/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.pas b/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.pas
index 458715ed..945de746 100644
--- a/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.pas
+++ b/demos/Lazarus_Windows/TabbedBrowser2/uMainForm.pas
@@ -160,7 +160,6 @@ begin
GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
GlobalCEFApp.SetCurrentDir := True;
- GlobalCEFApp.ChromeRuntime := True;
end;
procedure TMainForm.EnableButtonPnl;
@@ -498,61 +497,55 @@ function TMainForm.DoOnBeforePopup(var windowInfo : TCefWindowInfo;
const popupFeatures : TCefPopupFeatures;
targetDisposition : TCefWindowOpenDisposition) : boolean;
begin
- if GlobalCEFApp.ChromeRuntime then
- Result := False
- else
- try
- FCriticalSection.Acquire;
+ try
+ FCriticalSection.Acquire;
- case targetDisposition of
- CEF_WOD_NEW_FOREGROUND_TAB,
- CEF_WOD_NEW_BACKGROUND_TAB :
- Result := (FHiddenTab <> nil) and
- FHiddenTab.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
- PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(False));
+ case targetDisposition of
+ CEF_WOD_NEW_FOREGROUND_TAB,
+ CEF_WOD_NEW_BACKGROUND_TAB :
+ Result := (FHiddenTab <> nil) and
+ FHiddenTab.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
+ PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(False));
- CEF_WOD_NEW_WINDOW,
- CEF_WOD_NEW_POPUP :
- Result := (FChildForm <> nil) and
- FChildForm.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
- PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(False));
+ CEF_WOD_NEW_WINDOW,
+ CEF_WOD_NEW_POPUP :
+ Result := (FChildForm <> nil) and
+ FChildForm.CreateClientHandler(windowInfo, client, targetFrameName, popupFeatures) and
+ PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(False));
- else Result := False;
- end;
- finally
- FCriticalSection.Release;
+ else Result := False;
end;
+ finally
+ FCriticalSection.Release;
+ end;
end;
function TMainForm.DoOpenUrlFromTab(const targetUrl : string;
targetDisposition : TCefWindowOpenDisposition) : boolean;
begin
- if GlobalCEFApp.ChromeRuntime then
- Result := True
- else
- try
- FCriticalSection.Acquire;
+ try
+ FCriticalSection.Acquire;
- case targetDisposition of
- CEF_WOD_NEW_FOREGROUND_TAB,
- CEF_WOD_NEW_BACKGROUND_TAB :
- begin
- FPendingURL := targetUrl;
- Result := PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(True));
- end;
+ case targetDisposition of
+ CEF_WOD_NEW_FOREGROUND_TAB,
+ CEF_WOD_NEW_BACKGROUND_TAB :
+ begin
+ FPendingURL := targetUrl;
+ Result := PostMessage(Handle, CEF_CREATENEXTTAB, 0, ord(True));
+ end;
- CEF_WOD_NEW_WINDOW,
- CEF_WOD_NEW_POPUP :
- begin
- FPendingURL := targetUrl;
- Result := PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(True));
- end
+ CEF_WOD_NEW_WINDOW,
+ CEF_WOD_NEW_POPUP :
+ begin
+ FPendingURL := targetUrl;
+ Result := PostMessage(Handle, CEF_CREATENEXTCHILD, 0, ord(True));
+ end
- else Result := False;
- end;
- finally
- FCriticalSection.Release;
+ else Result := False;
end;
+ finally
+ FCriticalSection.Release;
+ end;
end;
end.
diff --git a/demos/Lazarus_Windows/TinyBrowser/uTinyBrowser.pas b/demos/Lazarus_Windows/TinyBrowser/uTinyBrowser.pas
index 8899a3ee..a653eddb 100644
--- a/demos/Lazarus_Windows/TinyBrowser/uTinyBrowser.pas
+++ b/demos/Lazarus_Windows/TinyBrowser/uTinyBrowser.pas
@@ -236,9 +236,8 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- GlobalCEFApp.ChromeRuntime := True; // Enable this line to test the new "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
GlobalCEFApp.SetCurrentDir := True;
end;
diff --git a/demos/Lazarus_Windows/TinyBrowser2/uTinyBrowser2.pas b/demos/Lazarus_Windows/TinyBrowser2/uTinyBrowser2.pas
index 5098f608..d2f611c2 100644
--- a/demos/Lazarus_Windows/TinyBrowser2/uTinyBrowser2.pas
+++ b/demos/Lazarus_Windows/TinyBrowser2/uTinyBrowser2.pas
@@ -68,12 +68,11 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
- GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.DisablePopupBlocking := True;
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.SetCurrentDir := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
- GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
+ GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient;
end;
procedure DestroyTinyBrowser;
diff --git a/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.lfm b/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.lfm
index d2531f6c..932cd90b 100644
--- a/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.lfm
+++ b/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.lfm
@@ -18,7 +18,6 @@ object ChildForm: TChildForm
OnShow = FormShow
Position = poScreenCenter
ShowInTaskBar = stAlways
- LCLVersion = '2.0.4.0'
object CEFWindowParent1: TCEFWindowParent
Left = 0
Height = 394
@@ -33,8 +32,7 @@ object ChildForm: TChildForm
OnBeforePopup = Chromium1BeforePopup
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
- OnClose = Chromium1Close
- left = 184
- top = 128
+ Left = 184
+ Top = 128
end
end
diff --git a/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.pas b/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.pas
index 54153dea..a801a1d5 100644
--- a/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.pas
+++ b/demos/Lazarus_Windows/ToolBoxBrowser/uChildForm.pas
@@ -22,31 +22,18 @@ type
TChildForm = class(TForm)
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
+
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormDestroy(Sender: TObject);
- procedure Chromium1AfterCreated(Sender: TObject;
- const browser: ICefBrowser);
- procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser;
- var aAction : TCefCloseBrowserAction);
- procedure Chromium1PreKeyEvent(Sender: TObject;
- const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
- out isKeyboardShortcut, Result: Boolean);
- procedure Chromium1KeyEvent(Sender: TObject;
- const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
- out Result: Boolean);
- 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: Boolean; var Result: Boolean);
+
+ procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
+ procedure Chromium1PreKeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
+ procedure Chromium1KeyEvent(Sender: TObject; const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out Result: Boolean);
+ 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: Boolean; var Result: Boolean);
private
// Variables to control when can we destroy the form safely
@@ -56,7 +43,6 @@ type
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
- procedure BrowserDestroyMsg(var aMessage : TMessage); message CEFBROWSER_DESTROY;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
@@ -79,9 +65,8 @@ uses
// Destruction steps
// =================
-// 1. FormCloseQuery calls TChromium.CloseBrowser
-// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread.
-// 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.
procedure TChildForm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
@@ -108,12 +93,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 TChildForm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
-begin
- PostMessage(Handle, CEFBROWSER_DESTROY, 0, 0);
- aAction := cbaDelay;
-end;
-
procedure TChildForm.Chromium1KeyEvent(Sender: TObject;
const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle;
out Result: Boolean);
@@ -194,6 +173,7 @@ begin
begin
FClosing := True;
Chromium1.CloseBrowser(True);
+ CEFWindowParent1.Free;
end;
end;
@@ -249,9 +229,4 @@ begin
Chromium1.LoadURL(FHomepage);
end;
-procedure TChildForm.BrowserDestroyMsg(var aMessage : TMessage);
-begin
- CEFWindowParent1.Free;
-end;
-
end.
diff --git a/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.lfm b/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.lfm
index c06ca3bc..da48ff41 100644
--- a/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.lfm
+++ b/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.lfm
@@ -9,7 +9,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.2.6.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 23
@@ -27,16 +27,16 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object AddressEdt: TComboBox
Left = 0
- Height = 24
+ Height = 23
Top = 0
Width = 932
Align = alClient
- ItemHeight = 16
+ ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
diff --git a/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.pas b/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.pas
index 32236b05..a3d2207e 100644
--- a/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.pas
+++ b/demos/Lazarus_any_OS/BrowserWindow/uBrowserWindow.pas
@@ -139,6 +139,7 @@ end;
procedure TForm1.FormCreate(Sender: TObject);
begin
+ BrowserWindow1.Chromium.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
BrowserWindow1.LoadURL(UTF8Decode(AddressEdt.Text));
end;
diff --git a/demos/Lazarus_any_OS/BrowserWindowDom/uBrowserWindowDom.pas b/demos/Lazarus_any_OS/BrowserWindowDom/uBrowserWindowDom.pas
index b5caaba8..7dfb4e07 100644
--- a/demos/Lazarus_any_OS/BrowserWindowDom/uBrowserWindowDom.pas
+++ b/demos/Lazarus_any_OS/BrowserWindowDom/uBrowserWindowDom.pas
@@ -193,7 +193,7 @@ begin
BrowserWindow1.Chromium.OnBeforeContextMenu := @DoBeforeContextMenu;
BrowserWindow1.Chromium.OnContextMenuCommand := @DoContextMenuCmd;
BrowserWindow1.Chromium.OnProcessMessageReceived := @DoProcessMessageReceived;
-
+ BrowserWindow1.Chromium.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
BrowserWindow1.LoadURL(UTF8Decode(AddressEdt.Text));
end;
diff --git a/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.lfm b/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.lfm
index 19044f03..b0cf3b6e 100644
--- a/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.lfm
+++ b/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.lfm
@@ -9,7 +9,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.2.6.0'
+ LCLVersion = '3.4.0.0'
object PanelLeft: TPanel
Left = 0
Height = 556
@@ -37,16 +37,16 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
- OnClick = GoBtnLeftClick
TabOrder = 0
+ OnClick = GoBtnLeftClick
end
object AddressEdtLeft: TComboBox
Left = 0
- Height = 24
+ Height = 23
Top = 0
Width = 424
Align = alClient
- ItemHeight = 16
+ ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
@@ -127,16 +127,16 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
- OnClick = GoBtnRightClick
TabOrder = 0
+ OnClick = GoBtnRightClick
end
object AddressEdtRight: TComboBox
Left = 0
- Height = 24
+ Height = 23
Top = 0
Width = 418
Align = alClient
- ItemHeight = 16
+ ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
@@ -201,31 +201,31 @@ object Form1: TForm1
ClientWidth = 967
TabOrder = 3
object BtnCloseApp: TButton
- Left = 5
- Height = 26
- Top = 3
+ Left = 6
+ Height = 25
+ Top = 4
Width = 80
Caption = 'Close App'
- OnClick = BtnCloseAppClick
TabOrder = 0
+ OnClick = BtnCloseAppClick
end
object BtnCloseForm: TButton
- Left = 95
- Height = 26
- Top = 3
+ Left = 96
+ Height = 25
+ Top = 4
Width = 86
Caption = 'Close Form'
- OnClick = BtnCloseFormClick
TabOrder = 1
+ OnClick = BtnCloseFormClick
end
object BtnModal: TButton
- Left = 191
- Height = 26
- Top = 3
- Width = 93
+ Left = 192
+ Height = 25
+ Top = 4
+ Width = 92
Caption = 'Show Modal'
- OnClick = BtnModalClick
TabOrder = 2
+ OnClick = BtnModalClick
end
end
object ImageList1: TImageList
diff --git a/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.pas b/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.pas
index 6bee50bc..77d36a7d 100644
--- a/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.pas
+++ b/demos/Lazarus_any_OS/BrowserWindowEx/uBrowserWindowEx.pas
@@ -120,7 +120,7 @@ begin
FBrowserLeft.OnBrowserClosed := @LeftBrowserClosed;
FBrowserLeft.Align := alClient;
FBrowserLeft.Parent := PanelLeft;
-
+ FBrowserLeft.Chromium.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
OpenBtnLeft.Enabled := False;
GoBtnLeftClick(nil);
end;
@@ -163,6 +163,7 @@ begin
{$ENDIF}
FBrowserRight.Align := alClient;
FBrowserRight.Parent := PanelRight;
+ FBrowserRight.Chromium.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
OpenBtnRight.Enabled := False;
GoBtnRightClick(nil);
diff --git a/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.lfm b/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.lfm
index 96b97a0f..1d9e304c 100644
--- a/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.lfm
+++ b/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.lfm
@@ -10,7 +10,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
- LCLVersion = '2.2.6.0'
+ LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 23
@@ -29,16 +29,16 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
- OnClick = GoBtnClick
TabOrder = 0
+ OnClick = GoBtnClick
end
object AddressEdt: TComboBox
Left = 0
- Height = 24
+ Height = 23
Top = 0
Width = 932
Align = alClient
- ItemHeight = 16
+ ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
diff --git a/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.pas b/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.pas
index bc372a7c..b6b3b395 100644
--- a/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.pas
+++ b/demos/Lazarus_any_OS/ExternalPumpBrowser/uExternalPumpBrowser.pas
@@ -104,7 +104,7 @@ procedure TForm1.FormCreate(Sender: TObject);
begin
FCanClose := False;
FClosing := False;
-
+ Chromium1.RuntimeStyle := CEF_RUNTIME_STYLE_ALLOY;
Chromium1.DefaultURL := UTF8Decode(AddressEdt.Text);
end;
diff --git a/docs/cef4delphi.chm b/docs/cef4delphi.chm
index 4d8e2c31..dcfd609b 100644
Binary files a/docs/cef4delphi.chm and b/docs/cef4delphi.chm differ
diff --git a/docs/html/AllClasses.html b/docs/html/AllClasses.html
index 9cb25c1f..66ab3c20 100644
--- a/docs/html/AllClasses.html
+++ b/docs/html/AllClasses.html
@@ -241,16 +241,6 @@
Implement this interface to receive notification when tracing has completed. The functions of this interface will be called on the browser process UI thread.
Implement this interface to handle events related to browser extensions. The functions of this interface will be called on the UI thread. See ICefRequestContext.LoadExtension for information about extension loading.
Container for a single image represented at different scale factors. All image representations should be the same size in density independent pixel (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels then the image at scale factor 2.0 should be 200x200 pixels – both images will display with a DIP size of 100x100 units. The functions of this interface can be called on any browser process thread.
A Layout handles the sizing of the children of a Panel according to implementation-specific heuristics. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle events related to browser life span. The functions of this interface will be called on the UI thread unless otherwise indicated.
Implement this interface to handle events related to browser load status. The functions of this interface will be called on the browser process UI thread or render process main thread (TID_RENDERER).
Implement this interface to handle events related to media access permission requests. The functions of this interface will be called on the browser process UI thread.
Implemented by the client to observe MediaRouter events and registered via ICefMediaRouter.AddObserver. The functions of this interface will be called on the browser process UI thread.
Represents the route between a media source and sink. Instances of this object are created via ICefMediaRouter.CreateRoute and retrieved via ICefMediaObserver.OnRoutes. Contains the status and metadata of a routing operation. The functions of this interface may be called on any browser process thread unless otherwise indicated.
Supports discovery of and communication with media devices on the local network via the Cast and DIAL protocols. The functions of this interface may be called on any browser process thread unless otherwise indicated.
Represents a sink to which media can be routed. Instances of this object are retrieved via ICefMediaObserver.OnSinks. The functions of this interface may be called on any browser process thread unless otherwise indicated.
Represents a source from which media can be routed. Instances of this object are retrieved via ICefMediaRouter.GetSource. The functions of this interface may be called on any browser process thread unless otherwise indicated.
MenuButton is a button with optional text, icon and/or menu marker that shows a menu when clicked with the left mouse button. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle MenuButton events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
Supports creation and modification of menus. See TCefMenuId for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of this interface can only be accessed on the browser process the UI thread.
Implement this interface to handle menu model events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
Controller for an overlay that contains a contents View added via ICefWindow.AddOverlayView. Methods exposed by this controller should be called in preference to functions of the same name exposed by the contents View unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
A Panel is a container in the views hierarchy that can contain other Views as children. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle Panel events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle events related to permission requests. The functions of this interface will be called on the browser process UI thread.
Manage access to preferences. Many built-in preferences are registered by Chromium. Custom preferences can be registered in ICefBrowserProcessHandler.OnRegisterCustomPreferences.
Implement this interface to handle printing on Linux. Each browser will have only one print job in progress at a time. The functions of this interface will be called on the browser process UI thread.
Interface used to implement render process callbacks. The functions of this interface will be called on the render process main thread (TID_RENDERER) unless otherwise indicated.
A request context provides request handling for a set of related browser or URL request objects. A request context can be specified when creating a new browser via the ICefBrowserHost static factory functions or when creating a new URL request via the ICefUrlRequest static factory functions. Browser objects with different request contexts will never be hosted in the same render process. Browser objects with the same request context may or may not be hosted in the same render process depending on the process model. Browser objects created indirectly via the JavaScript window.open function or targeted links will share the same render process and the same request context as the source browser. When running in single-process mode there is only a single render process (the main process) and so all browsers created in single-process mode will share the same request context. This will be the first request context passed into a ICefBrowserHost static factory function and all other request context objects will be ignored.
Implement this interface to provide handler implementations. The handler instance will not be released until all objects related to the context have been destroyed.
Interface used for retrieving resources from the resource bundle (*.pak) files loaded by CEF during startup or via the ICefResourceBundleHandler returned from ICefApp.GetResourceBundleHandler. See TCefSettings for additional options related to resource bundle loading. The functions of this interface may be called on any thread unless otherwise indicated.
Interface used to implement a custom resource bundle interface. See TCefSettings for additional options related to resource bundle loading. The functions of this interface may be called on multiple threads.
Interface used to implement a custom request handler interface. The functions of this interface will be called on the IO thread unless otherwise indicated.
Implement this interface to handle events related to browser requests. The functions of this interface will be called on the IO thread unless otherwise indicated.
Interface that creates ICefResourceHandler instances for handling scheme requests. The functions of this interface will always be called on the IO thread.
A ScrollView will show horizontal and/or vertical scrollbars when necessary based on the size of the attached content view. Methods must be called on the browser process UI thread unless otherwise indicated.
Interface representing a server that supports HTTP and WebSocket requests. Server capacity is limited and is intended to handle only a small number of simultaneous connections (e.g. for communicating between applications on localhost). The functions of this interface are safe to call from any thread in the brower process unless otherwise indicated.
Implement this interface to handle HTTP server requests. A new thread will be created for each ICefServer.CreateServer call (the "dedicated server thread"), and the functions of this interface will be called on that thread. It is therefore recommended to use a different ICefServerHandler instance for each ICefServer.CreateServer call to avoid thread safety issues in the ICefServerHandler implementation.
Interface that builds a ICefProcessMessage containing a shared memory region. This interface is not thread-safe but may be used exclusively on a different thread from the one which constructed it.
Implement this interface for asynchronous task execution. If the task is posted successfully and if the associated message loop is still running then the execute() function will be called on the target thread. If the task fails to post then the task object may be destroyed on the source thread instead of the target thread. For this reason be cautious when performing work in the task object destructor.
Implement this structure to handle events related to browser extensions. The functions of this structure will be called on the UI thread. See ICefRequestContext.LoadExtension for information about extension loading.
A simple Layout that causes the associated Panel's one child to be sized to match the bounds of its parent. Methods must be called on the browser process UI thread unless otherwise indicated.
A simple Layout that causes the associated Panel's one child to be sized to match the bounds of its parent. Methods must be called on the browser process UI thread unless otherwise indicated.
Structure used to represent a frame in the browser window. When used in the browser process the functions of this structure may be called on any thread unless otherwise indicated in the comments. When used in the render process the functions of this structure may only be called on the main thread.
Container for a single image represented at different scale factors. All image representations should be the same size in density independent pixel (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels then the image at scale factor 2.0 should be 200x200 pixels – both images will display with a DIP size of 100x100 units. The functions of this structure can be called on any browser process thread.
A Layout handles the sizing of the children of a Panel according to implementation-specific heuristics. Methods must be called on the browser process UI thread unless otherwise indicated.
A Layout handles the sizing of the children of a Panel according to implementation-specific heuristics. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this structure to handle events related to browser life span. The functions of this structure will be called on the UI thread unless otherwise indicated.
TCEFLinkedWinControlBase is a custom TWinControl to host the child controls created by the web browser to show the web contents and it's linked to the TChromium instance that handles that web browser. TCEFLinkedWinControlBase is the parent class of TChromiumWindow, TBrowserWindow and TCEFLinkedWindowParent.
This component can be used by VCL and LCL applications. It has the same purpose as TCEFWindowParent but it has a Chromium property to link it directly to a TChromium component. TCEFLinkedWindowParent resizes the child controls created by CEF for browsers in normal mode and sets the browser focus using the linked TChromium component. TCEFWindowParent and TCEFLinkedWindowParent work fine in Windows and you can used any of them but you can't use TCEFWindowParent in Linux or MacOS.
Linux window properties, such as X11's WM_CLASS or Wayland's app_id. Those are passed to CefWindowDelegate, so the client can set them for the CefWindow's top-level. Thus, allowing window managers to correctly display the application's information (e.g., icons).
Implement this structure for asynchronous task execution. If the task is posted successfully and if the associated message loop is still running then the execute() function will be called on the target thread. If the task fails to post then the task object may be destroyed on the source thread instead of the target thread. For this reason be cautious when performing work in the task object destructor.
Structure that asynchronously executes tasks on the associated thread. It is safe to call the functions of this structure on any thread.
CEF maintains multiple internal threads that are used for handling different types of tasks in different processes. The TCefThreadId definitions in cef_types.h list the common CEF threads. Task runners are also available for other CEF threads as appropriate (for example, V8 WebWorker threads).
A Textfield supports editing of text. This control is custom rendered with no platform-specific code. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this structure to handle Textfield events. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle Textfield events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A Textfield supports editing of text. This control is custom rendered with no platform-specific code. Methods must be called on the browser process UI thread unless otherwise indicated.
A simple thread abstraction that establishes a message loop on a new thread. The consumer uses ICefTaskRunner to execute code on the thread's message loop. The thread is terminated when the ICefThread object is destroyed or stop() is called. All pending tasks queued on the thread's message loop will run to completion before the thread is terminated. cef_thread_create() can be called on any valid CEF thread in either the browser or render process. This structure should only be used for tasks that require a dedicated thread. In most cases you can post tasks to an existing CEF thread instead of creating a new one; see cef_task.h for details.
Structure used to make a URL request. URL requests are not associated with a browser instance so no ICefClient callbacks will be executed. URL requests can be created on any valid CEF thread in either the browser or render process. Once created the functions of the URL request object must be accessed on the same thread that created it.
Structure that should be implemented by the ICefUrlRequest client. The functions of this structure will be called on the same thread that created the request unless otherwise documented.
Structure that should be implemented to handle V8 accessor calls. Accessor identifiers are registered by calling ICefv8value.SetValue(). The functions of this structure will be called on the thread associated with the V8 accessor.
Structure representing a V8 context handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Structure that should be implemented to handle V8 function calls. The functions of this structure will be called on the thread associated with the V8 function.
Structure that should be implemented to handle V8 interceptor calls. The functions of this structure will be called on the thread associated with the V8 interceptor. Interceptor's named property handlers (with first argument of type CefString) are called when object is indexed by string. Indexed property handlers (with first argument of type int) are called when object is indexed by integer.
Structure representing a V8 stack frame handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Structure representing a V8 stack trace handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Structure representing a V8 value handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Structure that wraps other data value types. Complex types (binary, dictionary and list) will be referenced but not owned by this object. Can be used on any process and thread.
A View is a rectangle within the views View hierarchy. It is the base structure for all Views. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this structure to handle view events. All size and position values are in density independent pixels (DIP) unless otherwise indicated. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle view events. All size and position values are in density independent pixels (DIP) unless otherwise indicated. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A View is a rectangle within the views View hierarchy. It is the base interface for all Views. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
WaitableEvent is a thread synchronization tool that allows one thread to wait for another thread to finish some work. This is equivalent to using a Lock+ConditionVariable to protect a simple boolean value. However, using WaitableEvent in conjunction with a Lock to wait for a more complex state change (e.g., for an item to be added to a queue) is not recommended. In that case consider using a ConditionVariable instead of a WaitableEvent. It is safe to create and/or signal a WaitableEvent from any thread. Blocking on a WaitableEvent by calling the *wait() functions is not allowed on the browser process UI or IO threads.
A Window is a top-level Window/widget in the Views hierarchy. By default it will have a non-client area with title bar, icon and buttons that supports moving and resizing. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this structure to handle window events. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle window events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A Window is a top-level Window/widget in the Views hierarchy. By default it will have a non-client area with title bar, icon and buttons that supports moving and resizing. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Structure that supports the reading of XML data via the libxml streaming API. The functions of this structure should only be called on the thread that creates the object.
Structure that supports the reading of zip archives via the zlib unzip API. The functions of this structure should only be called on the thread that creates the object.
Class that supports the reading of zip archives via the zlib unzip API. The functions of this interface should only be called on the thread that creates the object.
VCL and LCL version of TChromiumCore that puts together all browser procedures, functions, properties and events in one place. It has all you need to create, modify and destroy a web browser.
Parent class of TChromium and TFMXChromium that puts together all browser procedures, functions, properties and events in one place. It has all you need to create, modify and destroy a web browser.
This class handles all the ICefBrowserViewDelegate methods which call the ICefBrowserViewDelegateEvents methods. ICefBrowserViewDelegateEvents will be implemented by the control receiving the ICefBrowserViewDelegate events.
This class handles all the ICefButtonDelegate methods which call the ICefButtonDelegateEvents methods. ICefButtonDelegateEvents will be implemented by the control receiving the ICefButtonDelegate events.
This class handles all the ICefTextfieldDelegate and ICefViewDelegate methods which call the ICefTextfieldDelegateEvents methods. ICefTextfieldDelegateEvents will be implemented by the control receiving the ICefTextfieldDelegate events.
This class handles all the ICefViewDelegate methods which call the ICefViewDelegateEvents methods. ICefViewDelegateEvents will be implemented by the control receiving the ICefViewDelegate events.
This class handles all the TCustomWindowDelegate methods which call the ICefWindowDelegateEvents methods. ICefWindowDelegateEvents will be implemented by the control receiving the TCustomWindowDelegate events.
2) TEmbeddedChromium adds InternalEvents that can be hooked by the component that owns the TEmbeddedChromium. This means the default published events are available to the end user. Published events that should not be available are hidden via THiddenPropertyEditor * Hidden event properties must not be assigned by any end user code. *
FMX version of TChromiumCore that puts together all browser procedures, functions, properties and events in one place. It has all you need to create, modify and destroy a web browser.
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's permissions::RequestType type.
+
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's permissions::RequestType type.
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.
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.
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.
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.
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.
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.
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.
If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS requests. This value should be set in most cases where CEF_SCHEME_OPTION_STANDARD is set.
If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content- Security-Policy (CSP) checks. This value should not be set in most cases where CEF_SCHEME_OPTION_STANDARD is set.
If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be displayed from other content hosted with the same scheme. For example, pages in other origins cannot create iframes or hyperlinks to URLs with the scheme. For schemes that must be accessible from other schemes don't set this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS "Access-Control-Allow-Origin" headers to further restrict access.
If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same security rules as those applied to "file" URLs. Normal pages cannot link to or access local URLs. Also, by default, local URLs can only perform XMLHttpRequest calls to the same URL (origin + path) that originated the request. To allow XMLHttpRequest calls from a local URL to other URLs with the same origin set the CefSettings.file_access_from_file_urls_allowed value to true (1). To allow XMLHttpRequest calls from a local URL to all origins set the CefSettings.universal_access_from_file_urls_allowed value to true (1).
If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the same security rules as those applied to "https" URLs. For example, loading this scheme from other secure schemes will not trigger mixed content warnings.
If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a standard scheme. Standard schemes are subject to URL canonicalization and parsing rules as defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt
@@ -1044,4692 +1049,4692 @@
For non-standard scheme URLs only the "scheme:" component is parsed and canonicalized. The remainder of the URL will be passed to the handler as- is. For example, "scheme:///some%20text" will remain the same. Non-standard scheme URLs cannot be used as a target for form submission.
Supported certificate status code values. See net\cert\cert_status_flags.h for more information. CERT_STATUS_NONE is new in CEF because we use an enum while cert_status_flags.h uses a typedef and static const variables.
This constant is defined by Chromium in chrome/app/main_dll_loader_win.cc It's used with SetProcessShutdownParameters to set a shutdown priority for the subprocesses. $280 is the default value for applications.
Supported context menu edit state bit flags. These constants match their equivalents in Chromium's ContextMenuDataEditFlags and should not be renumbered.
Supported context menu media state bit flags. These constants match their equivalents in Chromium's ContextMenuData::MediaFlags and should not be renumbered.
command_id constants declared in cef_command_ids.h and used by some callbacks in ICefCommandHandler cef_command_ids.h is generated in /include/cef_command_ids.h
This option instructs the writer that if a Binary value is encountered, the value (and key if within a dictionary) will be omitted from the output, and success will be returned. Otherwise, if a binary value is encountered, failure will be returned.
This option instructs the writer to write doubles that have no fractional part as a normal integer (i.e., without using exponential notation or appending a '.0') as long as the value is within the range of a 64-bit int.
All user-defined menu IDs should come between MENU_ID_USER_FIRST and MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges defined in the tools/gritsettings/resource_ids file.
Source is a subframe navigation. This is any content that is automatically loaded in a non-toplevel frame. For example, if a page consists of several frames containing ads, those ad URLs will have this transition type. The user may not even realize the content in these pages is a separate frame, so may not care about the URL.
This is a toplevel navigation. This is any content that is automatically loaded in a toplevel frame. For example, opening a tab to show the ASH screen saver, opening the devtools window, opening the NTP after the safe browsing warning, opening web-based dialog boxes are examples of AUTO_TOPLEVEL navigations. Chrome runtime only.
+
This is a toplevel navigation. This is any content that is automatically loaded in a toplevel frame. For example, opening a tab to show the ASH screen saver, opening the devtools window, opening the NTP after the safe browsing warning, opening web-based dialog boxes are examples of AUTO_TOPLEVEL navigations. Chrome style only.
Source is a form submission by the user. NOTE: In some situations submitting a form does not result in this transition type. This can happen if the form uses a script to submit the contents.
User got to this page by typing in the URL bar and selecting an entry that did not look like a URL. For example, a match might have the URL of a Google search result page, but appear like "Search Google for ...". These are not quite the same as EXPLICIT navigations because the user didn't type or see the destination URL. Chrome runtime only. See also TT_KEYWORD.
+
The transition originated from an external application; the exact definition of this is embedder dependent. Chrome style only.
User is navigating to the home page. Chrome runtime only.
+
User got to this page by typing in the URL bar and selecting an entry that did not look like a URL. For example, a match might have the URL of a Google search result page, but appear like "Search Google for ...". These are not quite the same as EXPLICIT navigations because the user didn't type or see the destination URL. Chrome style only. See also TT_KEYWORD.
The url was generated from a replaceable keyword other than the default search provider. If the user types a keyword (which also applies to tab-to-search) in the omnibox this qualifier is applied to the transition type of the generated url. TemplateURLModel then may generate an additional visit with a transition type of TT_KEYWORD_GENERATED against the url 'http://' + keyword. For example, if you do a tab-to-search against wikipedia the generated url has a transition qualifer of TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' with a transition type of TT_KEYWORD_GENERATED. Chrome runtime only.
Corresponds to a visit generated for a keyword. See description of TT_KEYWORD for more details. Chrome runtime only.
+
The url was generated from a replaceable keyword other than the default search provider. If the user types a keyword (which also applies to tab-to-search) in the omnibox this qualifier is applied to the transition type of the generated url. TemplateURLModel then may generate an additional visit with a transition type of TT_KEYWORD_GENERATED against the url 'http://' + keyword. For example, if you do a tab-to-search against wikipedia the generated url has a transition qualifer of TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' with a transition type of TT_KEYWORD_GENERATED. Chrome style only.
Source is a link click or the JavaScript window.open function. This is also the default value for requests like sub-resource loads that are not navigations.
Source is a subframe navigation explicitly requested by the user that will generate new navigation entries in the back/forward list. These are probably more important than frames that were automatically loaded in the background because the user probably cares about the fact that this link was loaded.
Source is a "reload" of the page via the Reload function or by re-visiting the same URL. NOTE: This is distinct from the concept of whether a particular load uses "reload semantics" (i.e. bypasses cached data).
If set the cache will not be used at all. Setting this value is equivalent to specifying the "Cache-Control: no-store" request header. Setting this value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request to fail.
If set 5XX redirect errors will be propagated to the observer instead of automatically re-tried. This currently only applies for requests originated in the browser process.
If set the request will fail if it cannot be served from the cache (or some equivalent local store). Setting this value is equivalent to specifying the "Cache-Control: only-if-cached" request header. Setting this value in combination with UR_FLAG_SKIP_CACHE or UR_FLAG_DISABLE_CACHE will cause the request to fail.
If set the cache will be skipped when handling the request. Setting this value is equivalent to specifying the "Cache-Control: no-cache" request header. Setting this value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request to fail.
Don't unescape anything special, but all normal unescaping will happen. This is a placeholder and can't be combined with other flags (since it's just the absence of them). All other unescape rules imply "normal" in addition to their special meaning. Things like escaped letters, digits, and most symbols will get unescaped with this mode.
Unescapes '/' and '\\'. If these characters were unescaped, the resulting URL won't be the same as the source one. Moreover, they are dangerous to unescape in strings that will be used as file paths or names. This value should only be used when slashes don't have special meaning, like data URLs.
Convert %20 to spaces. In some places where we're showing URLs, we may want this. In places where the URL may be copied and pasted out, then you wouldn't want this since it might not be interpreted in one piece by other applications.
Unescapes various characters that will change the meaning of URLs, including '%', '+', '&', '#'. Does not unescape path separators. If these characters were unescaped, the resulting URL won't be the same as the source one. This flag is used when generating final output like filenames for URLs where we won't be interpreting as a URL and want to do as much unescaping as possible.
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's permissions::RequestType type.
+
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's permissions::RequestType type.
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.
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.
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.
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.
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.
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.
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.
If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS requests. This value should be set in most cases where CEF_SCHEME_OPTION_STANDARD is set.
If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content- Security-Policy (CSP) checks. This value should not be set in most cases where CEF_SCHEME_OPTION_STANDARD is set.
If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be displayed from other content hosted with the same scheme. For example, pages in other origins cannot create iframes or hyperlinks to URLs with the scheme. For schemes that must be accessible from other schemes don't set this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS "Access-Control-Allow-Origin" headers to further restrict access.
If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same security rules as those applied to "file" URLs. Normal pages cannot link to or access local URLs. Also, by default, local URLs can only perform XMLHttpRequest calls to the same URL (origin + path) that originated the request. To allow XMLHttpRequest calls from a local URL to other URLs with the same origin set the CefSettings.file_access_from_file_urls_allowed value to true (1). To allow XMLHttpRequest calls from a local URL to all origins set the CefSettings.universal_access_from_file_urls_allowed value to true (1).
If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the same security rules as those applied to "https" URLs. For example, loading this scheme from other secure schemes will not trigger mixed content warnings.
If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a standard scheme. Standard schemes are subject to URL canonicalization and parsing rules as defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt
@@ -1882,411 +1897,416 @@
For non-standard scheme URLs only the "scheme:" component is parsed and canonicalized. The remainder of the URL will be passed to the handler as- is. For example, "scheme:///some%20text" will remain the same. Non-standard scheme URLs cannot be used as a target for form submission.
Supported certificate status code values. See net\cert\cert_status_flags.h for more information. CERT_STATUS_NONE is new in CEF because we use an enum while cert_status_flags.h uses a typedef and static const variables.
This constant is defined by Chromium in chrome/app/main_dll_loader_win.cc It's used with SetProcessShutdownParameters to set a shutdown priority for the subprocesses. $280 is the default value for applications.
Supported context menu edit state bit flags. These constants match their equivalents in Chromium's ContextMenuDataEditFlags and should not be renumbered.
Supported context menu media state bit flags. These constants match their equivalents in Chromium's ContextMenuData::MediaFlags and should not be renumbered.
command_id constants declared in cef_command_ids.h and used by some callbacks in ICefCommandHandler cef_command_ids.h is generated in /include/cef_command_ids.h
Converts TCefTime from a double which is the number of seconds since epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 means "not initialized".
Implement this interface to receive accessibility notification when accessibility events have been registered. The functions of this interface will be called on the UI thread.
A Layout manager that arranges child views vertically or horizontally in a side-by-side fashion with spacing around and between the child views. The child views are always sized according to their preferred size. If the host's bounds provide insufficient space, child views will be clamped. Excess space will not be distributed. Methods must be called on the browser process UI thread unless otherwise indicated.
Interface used to represent a browser. When used in the browser process the functions of this interface may be called on any thread unless otherwise indicated in the comments. When used in the render process the functions of this interface may only be called on the main thread.
Interface used to represent the browser process aspects of a browser. The functions of this interface can only be called in the browser process. They may be called on any thread in that process unless otherwise indicated in the comments.
Interface used to implement browser process callbacks. The functions of this interface will be called on the browser process main thread unless otherwise indicated.
Implement this interface to handle BrowserView events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A View representing a button. Depending on the specific type, the button could be implemented by a native control or custom rendered. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle Button events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
Interface used to create and/or parse command line arguments. Arguments with "–", "-" and, on Windows, "/" prefixes are considered switches. Switches will always precede any arguments without switch prefixes. Switches can optionally have a value specified using the "=" delimiter (e.g. "-switch=value"). An argument of "–" will terminate switch parsing with all subsequent tokens, regardless of prefix, being interpreted as non-switch arguments. Switch names should be lowercase ASCII and will be converted to such if necessary. Switch values will retain the original case and UTF8 encoding. This interface can be used before cef_initialize() is called.
Implement this interface to filter cookies that may be sent or received from resource requests. The functions of this interface will be called on the IO thread unless otherwise indicated.
This interface typically, but not always, corresponds to a physical display connected to the system. A fake Display may exist on a headless system, or a Display may correspond to a remote, virtual display. All size and position values are in density independent pixel (DIP) coordinates unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to receive notification when tracing has completed. The functions of this interface will be called on the browser process UI thread.
Implement this interface to handle events related to browser extensions. The functions of this interface will be called on the UI thread. See ICefRequestContext.LoadExtension for information about extension loading.
A simple Layout that causes the associated Panel's one child to be sized to match the bounds of its parent. Methods must be called on the browser process UI thread unless otherwise indicated.
Interface used to represent a frame in the browser window. When used in the browser process the functions of this interface may be called on any thread unless otherwise indicated in the comments. When used in the render process the functions of this interface may only be called on the main thread.
Implement this interface for asynchronous task execution. If the task is posted successfully and if the associated message loop is still running then the execute() function will be called on the target thread. If the task fails to post then the task object may be destroyed on the source thread instead of the target thread. For this reason be cautious when performing work in the task object destructor.
Interface that asynchronously executes tasks on the associated thread. It is safe to call the functions of this interface on any thread.
CEF maintains multiple internal threads that are used for handling different types of tasks in different processes. The TCefThreadId definitions in cef_types.h list the common CEF threads. Task runners are also available for other CEF threads as appropriate (for example, V8 WebWorker threads).
A Textfield supports editing of text. This control is custom rendered with no platform-specific code. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle Textfield events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A simple thread abstraction that establishes a message loop on a new thread. The consumer uses ICefTaskRunner to execute code on the thread's message loop. The thread is terminated when the ICefThread object is destroyed or stop() is called. All pending tasks queued on the thread's message loop will run to completion before the thread is terminated. cef_thread_create() can be called on any valid CEF thread in either the browser or render process. This interface should only be used for tasks that require a dedicated thread. In most cases you can post tasks to an existing CEF thread instead of creating a new one; see cef_task.h for details.
Interface used to make a URL request. URL requests are not associated with a browser instance so no ICefClient callbacks will be executed. URL requests can be created on any valid CEF thread in either the browser or render process. Once created the functions of the URL request object must be accessed on the same thread that created it.
Interface that should be implemented by the ICefUrlRequest client. The functions of this interface will be called on the same thread that created the request unless otherwise documented.
Interface that should be implemented to handle V8 accessor calls. Accessor identifiers are registered by calling ICefV8value.SetValue(). The functions of this interface will be called on the thread associated with the V8 accessor.
Interface representing a V8 context handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefV8context.GetTaskRunner() function.
Interface that should be implemented to handle V8 function calls. The functions of this interface will be called on the thread associated with the V8 function.
Interface that should be implemented to handle V8 interceptor calls. The functions of this interface will be called on the thread associated with the V8 interceptor. Interceptor's named property handlers (with first argument of type CefString) are called when object is indexed by string. Indexed property handlers (with first argument of type int) are called when object is indexed by integer.
Interface representing a V8 stack frame handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Interface representing a V8 stack trace handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Interface representing a V8 value handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the ICefv8context.GetTaskRunner() function.
Interface that wraps other data value types. Complex types (binary, dictionary and list) will be referenced but not owned by this object. Can be used on any process and thread.
A View is a rectangle within the views View hierarchy. It is the base interface for all Views. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle view events. All size and position values are in density independent pixels (DIP) unless otherwise indicated. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
WaitableEvent is a thread synchronization tool that allows one thread to wait for another thread to finish some work. This is equivalent to using a Lock+ConditionVariable to protect a simple boolean value. However, using WaitableEvent in conjunction with a Lock to wait for a more complex state change (e.g., for an item to be added to a queue) is not recommended. In that case consider using a ConditionVariable instead of a WaitableEvent. It is safe to create and/or signal a WaitableEvent from any thread. Blocking on a WaitableEvent by calling the *wait() functions is not allowed on the browser process UI or IO threads.
A Window is a top-level Window/widget in the Views hierarchy. By default it will have a non-client area with title bar, icon and buttons that supports moving and resizing. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle window events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
Interface that supports the reading of XML data via the libxml streaming API. The functions of this interface should only be called on the thread that creates the object.
Interface that supports the reading of zip archives via the zlib unzip API. The functions of this interface should only be called on the thread that creates the object.
This option instructs the writer that if a Binary value is encountered, the value (and key if within a dictionary) will be omitted from the output, and success will be returned. Otherwise, if a binary value is encountered, failure will be returned.
This option instructs the writer to write doubles that have no fractional part as a normal integer (i.e., without using exponential notation or appending a '.0') as long as the value is within the range of a 64-bit int.
All user-defined menu IDs should come between MENU_ID_USER_FIRST and MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges defined in the tools/gritsettings/resource_ids file.
TBufferPanel is used by VCL and LCL applications with browsers in OSR mode to draw the browser contents. See the SimpleOSRBrowser demo for more details.
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.
Implement this structure to receive accessibility notification when accessibility events have been registered. The functions of this structure will be called on the UI thread.
The complete list of compiler versions is here : http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions Delphi 5 Delphi 6 Delphi 7 Delphi 8 Delphi 2005 Delphi 2009 Delphi 2010 Delphi XE Delphi XE2 (First FireMonkey and 64bit compiler) Delphi XE3 Delphi XE4 Delphi XE5 Delphi XE6 Delphi XE7 Delphi XE8 Rad Studio 10 - Delphi Seattle Rad Studio 10.1 - Delphi Berlin Rad Studio 10.2 - Delphi Tokyo Rad Studio 10.3 - Delphi Rio Rad Studio 10.4 - Delphi Sydney Rad Studio 11.0 - Delphi Alexandria Rad Studio 12.0 - Delphi Yukon Delphi uses MACOS for the new MacOSX and DARWIN is not defined FPC uses DARWIN for the new MacOSX and MACOS is defined for the classic Macintosh OS (System 7) We define MACOSX to avoid conflicts in both situations OS_POSIX is defined for AIX, ANDROID, ASMJS, CHROMEOS, FREEBSD, IOS, LINUX, MAC, NACL, NETBSD, OPENBSD, QNX and SOLARIS in /include/base/cef_build.h
Represents a wall clock time in UTC. Values are not guaranteed to be monotonically non-decreasing and are subject to large amounts of skew. Time is stored internally as microseconds since the Windows epoch (1601).
This is equivalent of Chromium `base::Time` (see base/time/time.h).
A Layout manager that arranges child views vertically or horizontally in a side-by-side fashion with spacing around and between the child views. The child views are always sized according to their preferred size. If the host's bounds provide insufficient space, child views will be clamped. Excess space will not be distributed. Methods must be called on the browser process UI thread unless otherwise indicated.
A Layout manager that arranges child views vertically or horizontally in a side-by-side fashion with spacing around and between the child views. The child views are always sized according to their preferred size. If the host's bounds provide insufficient space, child views will be clamped. Excess space will not be distributed. Methods must be called on the browser process UI thread unless otherwise indicated.
Initialization settings. Specify NULL or 0 to get the recommended default values. Many of these and other settings can also configured using command- line switches.
Structure used to represent a browser. When used in the browser process the functions of this structure may be called on any thread unless otherwise indicated in the comments. When used in the render process the functions of this structure may only be called on the main thread.
Structure used to represent the browser process aspects of a browser. The functions of this structure can only be called in the browser process. They may be called on any thread in that process unless otherwise indicated in the comments.
Structure used to implement browser process callbacks. The functions of this structure will be called on the browser process main thread unless otherwise indicated.
Browser initialization settings. Specify NULL or 0 to get the recommended default values. The consequences of using custom values may not be well tested. Many of these and other settings can also configured using command- line switches.
Implement this structure to handle BrowserView events. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle BrowserView events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A View representing a button. Depending on the specific type, the button could be implemented by a native control or custom rendered. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this structure to handle Button events. The functions of this structure will be called on the browser process UI thread unless otherwise indicated.
Implement this interface to handle Button events. The functions of this interface will be called on the browser process UI thread unless otherwise indicated.
A View representing a button. Depending on the specific type, the button could be implemented by a native control or custom rendered. Methods must be called on the browser process UI thread unless otherwise indicated.
Supported certificate status code values. See net\cert\cert_status_flags.h for more information. CERT_STATUS_NONE is new in CEF because we use an enum while cert_status_flags.h uses a typedef and static const variables.
Enumerates the various representations of the ordering of audio channels. Must be kept synchronized with media::ChannelLayout from Chromium. See media\base\channel_layout.h
Structure used to create and/or parse command line arguments. Arguments with "–", "-" and, on Windows, "/" prefixes are considered switches. Switches will always precede any arguments without switch prefixes. Switches can optionally have a value specified using the "=" delimiter (e.g. "-switch=value"). An argument of "–" will terminate switch parsing with all subsequent tokens, regardless of prefix, being interpreted as non-switch arguments. Switch names should be lowercase ASCII and will be converted to such if necessary. Switch values will retain the original case and UTF8 encoding. This structure can be used before cef_initialize() is called.
Structure representing IME composition underline information. This is a thin wrapper around Blink's WebCompositionUnderline class and should be kept in sync with that.
Supported content setting types. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's ContentSettingsType type.
+
Supported content setting types. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's ContentSettingsType type.
Supported context menu edit state bit flags. These constants match their equivalents in Chromium's ContextMenuDataEditFlags and should not be renumbered.
Supported context menu media state bit flags. These constants match their equivalents in Chromium's ContextMenuData::MediaFlags and should not be renumbered.
Implement this structure to filter cookies that may be sent or received from resource requests. The functions of this structure will be called on the IO thread unless otherwise indicated.
Structure representing cursor information. |buffer| will be |size.width|*|size.height|*4 bytes in size and represents a BGRA image with an upper-left origin.
Implement this structure to handle events related to browser extensions. The functions of this structure will be called on the UI thread. See ICefRequestContext.LoadExtension for information about extension loading.
A simple Layout that causes the associated Panel's one child to be sized to match the bounds of its parent. Methods must be called on the browser process UI thread unless otherwise indicated.
A simple Layout that causes the associated Panel's one child to be sized to match the bounds of its parent. Methods must be called on the browser process UI thread unless otherwise indicated.
Structure used to represent a frame in the browser window. When used in the browser process the functions of this structure may be called on any thread unless otherwise indicated in the comments. When used in the render process the functions of this structure may only be called on the main thread.
Container for a single image represented at different scale factors. All image representations should be the same size in density independent pixel (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels then the image at scale factor 2.0 should be 200x200 pixels – both images will display with a DIP size of 100x100 units. The functions of this structure can be called on any browser process thread.
Notification that a character was typed. Use this for text input. Key down events may generate 0, 1, or more than one character event depending on the key, locale, and operating system.
A Layout handles the sizing of the children of a Panel according to implementation-specific heuristics. Methods must be called on the browser process UI thread unless otherwise indicated.
A Layout handles the sizing of the children of a Panel according to implementation-specific heuristics. Methods must be called on the browser process UI thread unless otherwise indicated.
Implement this structure to handle events related to browser life span. The functions of this structure will be called on the UI thread unless otherwise indicated.
TCEFLinkedWinControlBase is a custom TWinControl to host the child controls created by the web browser to show the web contents and it's linked to the TChromium instance that handles that web browser. TCEFLinkedWinControlBase is the parent class of TChromiumWindow, TBrowserWindow and TCEFLinkedWindowParent.
This component can be used by VCL and LCL applications. It has the same purpose as TCEFWindowParent but it has a Chromium property to link it directly to a TChromium component. TCEFLinkedWindowParent resizes the child controls created by CEF for browsers in normal mode and sets the browser focus using the linked TChromium component. TCEFWindowParent and TCEFLinkedWindowParent work fine in Windows and you can used any of them but you can't use TCEFWindowParent in Linux or MacOS.
Linux window properties, such as X11's WM_CLASS or Wayland's app_id. Those are passed to CefWindowDelegate, so the client can set them for the CefWindow's top-level. Thus, allowing window managers to correctly display the application's information (e.g., icons).
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's permissions::RequestType type.
+
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's permissions::RequestType type.
CEF supports both a Chrome runtime (based on the Chrome UI layer) and an Alloy runtime (based on the Chromium content layer). The Chrome runtime provides the full Chrome UI and browser functionality whereas the Alloy runtime provides less default browser functionality but adds additional client callbacks and support for windowless (off-screen) rendering. For additional comparative details on runtime types see https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
+
CEF supports both a Chrome runtime style (based on the Chrome UI layer) and an Alloy runtime style (based on the Chromium content layer). Chrome style provides the full Chrome UI and browser functionality whereas Alloy style provides less default browser functionality but adds additional client callbacks and support for windowless (off-screen) rendering. The style type is individually configured for each window/browser at creation time and different styles can be mixed during runtime. For additional comparative details on runtime styles see https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
-
Each runtime is composed of a bootstrap component and a style component. The bootstrap component is configured via CefSettings.chrome_runtime and cannot be changed after CefInitialize. The style component is individually configured for each window/browser at creation time and, in combination with the Chrome bootstrap, different styles can be mixed during runtime.
-
-
Windowless rendering will always use Alloy style. Windowed rendering with a default window or client-provided parent window can configure the style via CefWindowInfo.runtime_style. Windowed rendering with the Views framework can configure the style via CefWindowDelegate::GetWindowRuntimeStyle and CefBrowserViewDelegate::GetBrowserRuntimeStyle. Alloy style Windows with the Views framework can host only Alloy style BrowserViews but Chrome style Windows can host both style BrowserViews. Additionally, a Chrome style Window can host at most one Chrome style BrowserView but potentially multiple Alloy style BrowserViews. See CefWindowInfo.runtime_style documentation for any additional platform-specific limitations.
+
Windowless rendering will always use Alloy style. Windowed rendering with a default window or client-provided parent window can configure the style via TCefWindowInfo.runtime_style. Windowed rendering with the Views framework can configure the style via ICefWindowDelegate.GetWindowRuntimeStyle and ICefBrowserViewDelegate.GetBrowserRuntimeStyle. Alloy style Windows with the Views framework can host only Alloy style BrowserViews but Chrome style Windows can host both style BrowserViews. Additionally, a Chrome style Window can host at most one Chrome style BrowserView but potentially multiple Alloy style BrowserViews. See TCefWindowInfo.runtime_style documentation for any additional platform-specific limitations.
@@ -11899,27 +11887,47 @@ Ranges:
Implement this structure for asynchronous task execution. If the task is posted successfully and if the associated message loop is still running then the execute() function will be called on the target thread. If the task fails to post then the task object may be destroyed on the source thread instead of the target thread. For this reason be cautious when performing work in the task object destructor.
Structure that asynchronously executes tasks on the associated thread. It is safe to call the functions of this structure on any thread.
CEF maintains multiple internal threads that are used for handling different types of tasks in different processes. The TCefThreadId definitions in cef_types.h list the common CEF threads. Task runners are also available for other CEF threads as appropriate (for example, V8 WebWorker threads).
Class that supports the reading of zip archives via the zlib unzip API. The functions of this interface should only be called on the thread that creates the object.
This class handles all the ICefMenuButtonDelegate methods which call the ICefMenuButtonDelegateEvents methods. ICefMenuButtonDelegateEvents will be implemented by the control receiving the ICefMenuButtonDelegate events.
This class handles all the ICefPanelDelegate methods which call the ICefPanelDelegateEvents methods. ICefPanelDelegateEvents will be implemented by the control receiving the ICefPanelDelegate events.
This is a toplevel navigation. This is any content that is automatically loaded in a toplevel frame. For example, opening a tab to show the ASH screen saver, opening the devtools window, opening the NTP after the safe browsing warning, opening web-based dialog boxes are examples of AUTO_TOPLEVEL navigations. Chrome runtime only.
+
This is a toplevel navigation. This is any content that is automatically loaded in a toplevel frame. For example, opening a tab to show the ASH screen saver, opening the devtools window, opening the NTP after the safe browsing warning, opening web-based dialog boxes are examples of AUTO_TOPLEVEL navigations. Chrome style only.
User got to this page by typing in the URL bar and selecting an entry that did not look like a URL. For example, a match might have the URL of a Google search result page, but appear like "Search Google for ...". These are not quite the same as EXPLICIT navigations because the user didn't type or see the destination URL. Chrome runtime only. See also TT_KEYWORD.
+
User got to this page by typing in the URL bar and selecting an entry that did not look like a URL. For example, a match might have the URL of a Google search result page, but appear like "Search Google for ...". These are not quite the same as EXPLICIT navigations because the user didn't type or see the destination URL. Chrome style only. See also TT_KEYWORD.
The url was generated from a replaceable keyword other than the default search provider. If the user types a keyword (which also applies to tab-to-search) in the omnibox this qualifier is applied to the transition type of the generated url. TemplateURLModel then may generate an additional visit with a transition type of TT_KEYWORD_GENERATED against the url 'http://' + keyword. For example, if you do a tab-to-search against wikipedia the generated url has a transition qualifer of TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' with a transition type of TT_KEYWORD_GENERATED. Chrome runtime only.
+
The url was generated from a replaceable keyword other than the default search provider. If the user types a keyword (which also applies to tab-to-search) in the omnibox this qualifier is applied to the transition type of the generated url. TemplateURLModel then may generate an additional visit with a transition type of TT_KEYWORD_GENERATED against the url 'http://' + keyword. For example, if you do a tab-to-search against wikipedia the generated url has a transition qualifer of TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' with a transition type of TT_KEYWORD_GENERATED. Chrome style only.
Supported content setting types. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's ContentSettingsType type.
+
Supported content setting types. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's ContentSettingsType type.
"Verb" of a drag-and-drop operation as negotiated between the source and destination. These constants match their equivalents in WebCore's DragActions.h and should not be renumbered.
Notification that a character was typed. Use this for text input. Key down events may generate 0, 1, or more than one character event depending on the key, locale, and operating system.
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's permissions::RequestType type.
+
Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's permissions::RequestType type.
Policy for how the Referrer HTTP header value will be sent during navigation. If the `–no-referrers` command-line flag is specified then the policy value will be ignored and the Referrer value will never be sent. Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium.
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.
CEF supports both a Chrome runtime (based on the Chrome UI layer) and an Alloy runtime (based on the Chromium content layer). The Chrome runtime provides the full Chrome UI and browser functionality whereas the Alloy runtime provides less default browser functionality but adds additional client callbacks and support for windowless (off-screen) rendering. For additional comparative details on runtime types see https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
+
CEF supports both a Chrome runtime style (based on the Chrome UI layer) and an Alloy runtime style (based on the Chromium content layer). Chrome style provides the full Chrome UI and browser functionality whereas Alloy style provides less default browser functionality but adds additional client callbacks and support for windowless (off-screen) rendering. The style type is individually configured for each window/browser at creation time and different styles can be mixed during runtime. For additional comparative details on runtime styles see https://bitbucket.org/chromiumembedded/cef/wiki/Architecture.md#markdown-header-cef3
-
Each runtime is composed of a bootstrap component and a style component. The bootstrap component is configured via CefSettings.chrome_runtime and cannot be changed after CefInitialize. The style component is individually configured for each window/browser at creation time and, in combination with the Chrome bootstrap, different styles can be mixed during runtime.
-
-
Windowless rendering will always use Alloy style. Windowed rendering with a default window or client-provided parent window can configure the style via CefWindowInfo.runtime_style. Windowed rendering with the Views framework can configure the style via CefWindowDelegate::GetWindowRuntimeStyle and CefBrowserViewDelegate::GetBrowserRuntimeStyle. Alloy style Windows with the Views framework can host only Alloy style BrowserViews but Chrome style Windows can host both style BrowserViews. Additionally, a Chrome style Window can host at most one Chrome style BrowserView but potentially multiple Alloy style BrowserViews. See CefWindowInfo.runtime_style documentation for any additional platform-specific limitations.
+
Windowless rendering will always use Alloy style. Windowed rendering with a default window or client-provided parent window can configure the style via TCefWindowInfo.runtime_style. Windowed rendering with the Views framework can configure the style via ICefWindowDelegate.GetWindowRuntimeStyle and ICefBrowserViewDelegate.GetBrowserRuntimeStyle. Alloy style Windows with the Views framework can host only Alloy style BrowserViews but Chrome style Windows can host both style BrowserViews. Additionally, a Chrome style Window can host at most one Chrome style BrowserView but potentially multiple Alloy style BrowserViews. See TCefWindowInfo.runtime_style documentation for any additional platform-specific limitations.
Supported UI scale factors for the platform. SCALE_FACTOR_NONE is used for density independent resources such as string, html/js files or an image that can be used for any scale factors (such as wallpapers).
- Return the handler for resource bundle events. If TCefSettings.pack_loading_disabled is true (1) a handler must be returned. If no handler is returned resources will be loaded from pack files. This function is called by the browser and render processes on multiple threads.
+ Return the handler for resource bundle events. If no handler is returned resources will be loaded from pack files. This function is called by the browser and render processes on multiple threads.
- Return the handler for resource bundle events. If TCefSettings.pack_loading_disabled is true (1) a handler must be returned. If no handler is returned resources will be loaded from pack files. This function is called by the browser and render processes on multiple threads.
+ Return the handler for resource bundle events. If no handler is returned resources will be loaded from pack files. This function is called by the browser and render processes on multiple threads.
function Load_cef_dump_without_crashing_internal_h: boolean;
+
+
+
This item has no description.
+
+
+
+
function Load_cef_file_util_capi_h: boolean;
@@ -3512,6 +3504,14 @@ ICefLoadHandler
+
function Load_cef_task_manager_capi_h: boolean;
+
+
+
This item has no description.
+
+
+
+
function Load_cef_thread_capi_h: boolean;
@@ -4229,6 +4229,36 @@ ICefLoadHandler
Removes a component ID from the valid ID list when a component is destroyed.
+
+
+
+
function DumpWithoutCrashing(mseconds_between_dumps: int64; const function_name, file_name: ustring; line_number: integer): boolean;
+
+
+
+ DumpWithoutCrashing allows for generating crash dumps with a throttling mechanism, preventing frequent dumps from being generated in a short period of time from the same location. The |function_name|, |file_name|, and |line_number| determine the location of the dump. The |mseconds_between_dumps| is an interval between consecutive dumps in milliseconds from the same location.
- Set to true (1) to enable use of the Chrome runtime in CEF. This feature is considered experimental and is not recommended for most users at this time. See issue #2969 for details.
- The directory where data for the global browser cache will be stored on disk. If this value is non-empty then it must be an absolute path that is either equal to or a child directory of TCefSettings.root_cache_path. If this value is empty then browsers will be created in "incognito mode" where in-memory caches are used for storage and no profile-specific data is persisted to disk (installation-specific data will still be persisted in root_cache_path). HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. Can be overridden for individual ICefRequestContext instances via the ICefRequestContextSettings.cache_path value. When using the Chrome runtime any child directory value will be ignored and the "default" profile (also a child directory) will be used instead.
+ The directory where data for the global browser cache will be stored on disk. If this value is non-empty then it must be an absolute path that is either equal to or a child directory of CefSettings.root_cache_path. If this value is empty then browsers will be created in "incognito mode" where in-memory caches are used for storage and no profile-specific data is persisted to disk (installation-specific data will still be persisted in root_cache_path). HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. Can be overridden for individual CefRequestContext instances via the TCefRequestContextSettings.cache_path value. Any child directory value will be ignored and the "default" profile (also a child directory) will be used instead.
- To persist user preferences as a JSON file in the cache path directory set this value to true (1). A |cache_path| value must also be specified to enable this feature. Also configurable using the "persist-user-preferences" command-line switch. Can be overridden for individual CefRequestContext instances via the TCefRequestContextSettings.persist_user_preferences value.
- Set to true (1) to disable loading of pack files for resources and locales. A resource bundle handler must be provided for the browser and render processes via ICefApp.GetResourceBundleHandler() if loading of pack files is disabled. Also configurable using the "disable-pack-loading" command- line switch.
Specify an ID to enable Chrome policy management via Platform and OS-user policies. On Windows, this is a registry key like "SOFTWARE\\Policies\\Google\\Chrome". On MacOS, this is a bundle ID like "com.google.Chrome". On Linux, this is an absolute directory path like "/etc/opt/chrome/policies". Only supported with the Chrome runtime. See https://support.google.com/chrome/a/answer/9037717 for details.
+
Specify an ID to enable Chrome policy management via Platform and OS-user policies. On Windows, this is a registry key like "SOFTWARE\\Policies\\Google\\Chrome". On MacOS, this is a bundle ID like "com.google.Chrome". On Linux, this is an absolute directory path like "/etc/opt/chrome/policies". Only supported with Chrome style. See https://support.google.com/chrome/a/answer/9037717 for details.
Chrome Browser Cloud Management integration, when enabled via the "enable-chrome-browser-cloud-management" command-line flag, will also use the specified ID. See https://support.google.com/chrome/a/answer/9116814 for details.
@@ -4551,7 +4551,7 @@ ICefLoadHandler
- Specify an ID for an ICON resource that can be loaded from the main executable and used when creating default Chrome windows such as DevTools and Task Manager. If unspecified the default Chromium ICON (IDR_MAINFRAME [101]) will be loaded from libcef.dll. Only supported with the Chrome runtime on Windows.
+ Specify an ID for an ICON resource that can be loaded from the main executable and used when creating default Chrome windows such as DevTools and Task Manager. If unspecified the default Chromium ICON (IDR_MAINFRAME [101]) will be loaded from libcef.dll. Only supported with Chrome style on Windows.
@@ -4867,7 +4867,7 @@ ICefLoadHandler
- Delegate all login requests to the client GetAuthCredentials callback when using the Chrome runtime.
+ Delegate all login requests to the client GetAuthCredentials callback.
- Provides an opportunity to register custom preferences prior to global and request context initialization.
-
If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via ICefPreferenceManager.GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related TCefSettings.cache_path and TCefSettings.persist_user_preferences configuration.
-
If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the ICefRequestContext after ICefRequestContextHandler.OnRequestContextInitialized is called. Request context preferences are registered each time a new ICefRequestContext is created. It is intended but not required that all request contexts have the same registered preferences. See related TCefRequestContextSettings.cache_path and TCefRequestContextSettings.persist_user_preferences configuration.
+
Provides an opportunity to register custom preferences prior to global and request context initialization.
-
Do not keep a reference to the |registrar| object. This function is called on the browser process UI thread.
+
If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via ICefPreferenceManager.GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related TCefSettings.cache_path configuration.
+
+
If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the ICefRequestContext after ICefRequestContextHandler.OnRequestContextInitialized is called. Request context preferences are registered each time a new ICefRequestContext is created. It is intended but not required that all request contexts have the same registered preferences. See related TCefRequestContextSettings.cache_path configuration.
+
+
Do not keep a reference to the |registrar| object. This function is called on the browser process UI thread.
+
+
@@ -5999,7 +6013,7 @@ ICefLoadHandler
- Return the default client for use with a newly created browser window (TCefBrowser object). If null is returned the TCefBrowser will be unmanaged (no callbacks will be executed for that TCefBrowser) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with the Chrome runtime when creating new browser windows via Chrome UI.
+ Return the default client for use with a newly created browser window (TCefBrowser object). If null is returned the TCefBrowser will be unmanaged (no callbacks will be executed for that TCefBrowser) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with Chrome style when creating new browser windows via Chrome UI.
@@ -6013,7 +6027,7 @@ ICefLoadHandler
- Return the default handler for use with a new user or incognito profile (TCefRequestContext object). If null is returned the TCefRequestContext will be unmanaged (no callbacks will be executed for that TCefRequestContext). This function is currently only used with the Chrome runtime when creating new browser windows via Chrome UI.
+ Return the default handler for use with a new user or incognito profile (TCefRequestContext object). If null is returned the TCefRequestContext will be unmanaged (no callbacks will be executed for that TCefRequestContext). This function is currently only used with Chrome style when creating new browser windows via Chrome UI.
- Get the default zoom level. This value will be 0.0 by default but can be configured with the Chrome runtime. This function can only be called on the UI thread.
+ Get the default zoom level. This value will be 0.0 by default but can be configured. This function can only be called on the UI thread.
- Returns true (1) if this browser is hosting an extension background script. Background hosts do not have a window and are not displayable. See ICefRequestContext.LoadExtension for details.
-
-
WARNING: This API is deprecated and will be removed in ~M127.
- Requests the renderer to exit browser fullscreen. In most cases exiting window fullscreen should also exit browser fullscreen. With the Alloy runtime this function should be called in response to a user action such as clicking the green traffic light button on MacOS (ICefWindowDelegate.OnWindowFullscreenTransition callback) or pressing the "ESC" key (ICefKeyboardHandler.OnPreKeyEvent callback). With the Chrome runtime these standard exit actions are handled internally but new/additional user actions can use this function. Set |will_cause_resize| to true (1) if exiting browser fullscreen will cause a view resize.
+ Requests the renderer to exit browser fullscreen. In most cases exiting window fullscreen should also exit browser fullscreen. With Alloy style this function should be called in response to a user action such as clicking the green traffic light button on MacOS (ICefWindowDelegate.OnWindowFullscreenTransition callback) or pressing the "ESC" key (ICefKeyboardHandler.OnPreKeyEvent callback). With Chrome style these standard exit actions are handled internally but new/additional user actions can use this function. Set |will_cause_resize| to true (1) if exiting browser fullscreen will cause a view resize.
- Returns true (1) if a Chrome command is supported and enabled. Values for |command_id| can be found in the cef_command_ids.h file. This function can only be called on the UI thread. Only used with the Chrome runtime.
+ Returns true (1) if a Chrome command is supported and enabled. Values for |command_id| can be found in the cef_command_ids.h file. This function can only be called on the UI thread. Only used with Chrome style.
- Execute a Chrome command. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Only used with the Chrome runtime.
+ Execute a Chrome command. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Only used with Chrome style.
See the IDC_* constants in uCEFConstants.pas for all the |command_id| values.
diff --git a/docs/html/uCEFBrowserProcessHandler.TCefBrowserProcessHandlerOwn.html b/docs/html/uCEFBrowserProcessHandler.TCefBrowserProcessHandlerOwn.html
index 8cfa497b..683e4024 100644
--- a/docs/html/uCEFBrowserProcessHandler.TCefBrowserProcessHandlerOwn.html
+++ b/docs/html/uCEFBrowserProcessHandler.TCefBrowserProcessHandlerOwn.html
@@ -74,9 +74,9 @@
Provides an opportunity to register custom preferences prior to global and request context initialization.
-
If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via ICefPreferenceManager.GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related TCefSettings.cache_path and TCefSettings.persist_user_preferences configuration.
+
If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via ICefPreferenceManager.GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related TCefSettings.cache_path configuration.
-
If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the ICefRequestContext after ICefRequestContextHandler.OnRequestContextInitialized is called. Request context preferences are registered each time a new ICefRequestContext is created. It is intended but not required that all request contexts have the same registered preferences. See related TCefRequestContextSettings.cache_path and TCefRequestContextSettings.persist_user_preferences configuration.
+
If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the ICefRequestContext after ICefRequestContextHandler.OnRequestContextInitialized is called. Request context preferences are registered each time a new ICefRequestContext is created. It is intended but not required that all request contexts have the same registered preferences. See related TCefRequestContextSettings.cache_path configuration.
Do not keep a reference to the |registrar| object. This function is called on the browser process UI thread.
@@ -138,7 +138,7 @@
- Return the default client for use with a newly created browser window (TCefBrowser object). If null is returned the TCefBrowser will be unmanaged (no callbacks will be executed for that TCefBrowser) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with the Chrome runtime when creating new browser windows via Chrome UI.
+ Return the default client for use with a newly created browser window (TCefBrowser object). If null is returned the TCefBrowser will be unmanaged (no callbacks will be executed for that TCefBrowser) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with Chrome style when creating new browser windows via Chrome UI.
- Return the default handler for use with a new user or incognito profile (TCefRequestContext object). If null is returned the TCefRequestContext will be unmanaged (no callbacks will be executed for that TCefRequestContext). This function is currently only used with the Chrome runtime when creating new browser windows via Chrome UI.
+ Return the default handler for use with a new user or incognito profile (TCefRequestContext object). If null is returned the TCefRequestContext will be unmanaged (no callbacks will be executed for that TCefRequestContext). This function is currently only used with Chrome style when creating new browser windows via Chrome UI.
Provides an opportunity to register custom preferences prior to global and request context initialization.
-
If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via ICefPreferenceManager.GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related TCefSettings.cache_path and TCefSettings.persist_user_preferences configuration.
+
If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be accessed via ICefPreferenceManager.GetGlobalPreferences after OnContextInitialized is called. Global preferences are registered a single time at application startup. See related TCefSettings.cache_path configuration.
-
If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the ICefRequestContext after ICefRequestContextHandler.OnRequestContextInitialized is called. Request context preferences are registered each time a new ICefRequestContext is created. It is intended but not required that all request contexts have the same registered preferences. See related TCefRequestContextSettings.cache_path and TCefRequestContextSettings.persist_user_preferences configuration.
+
If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be accessed via the ICefRequestContext after ICefRequestContextHandler.OnRequestContextInitialized is called. Request context preferences are registered each time a new ICefRequestContext is created. It is intended but not required that all request contexts have the same registered preferences. See related TCefRequestContextSettings.cache_path configuration.
Do not keep a reference to the |registrar| object. This function is called on the browser process UI thread.
@@ -159,7 +159,7 @@
- Return the default client for use with a newly created browser window (TCefBrowser object). If null is returned the TCefBrowser will be unmanaged (no callbacks will be executed for that TCefBrowser) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with the Chrome runtime when creating new browser windows via Chrome UI.
+ Return the default client for use with a newly created browser window (TCefBrowser object). If null is returned the TCefBrowser will be unmanaged (no callbacks will be executed for that TCefBrowser) and application shutdown will be blocked until the browser window is closed manually. This function is currently only used with Chrome style when creating new browser windows via Chrome UI.
- Return the default handler for use with a new user or incognito profile (TCefRequestContext object). If null is returned the TCefRequestContext will be unmanaged (no callbacks will be executed for that TCefRequestContext). This function is currently only used with the Chrome runtime when creating new browser windows via Chrome UI.
+ Return the default handler for use with a new user or incognito profile (TCefRequestContext object). If null is returned the TCefRequestContext will be unmanaged (no callbacks will be executed for that TCefRequestContext). This function is currently only used with Chrome style when creating new browser windows via Chrome UI.
- Returns the Chrome toolbar associated with this BrowserView. Only supported when using the Chrome runtime. The ICefBrowserViewDelegate.GetChromeToolbarType function must return a value other than CEF_CTT_NONE and the toolbar will not be available until after this BrowserView is added to a ICefWindow and ICefViewDelegate.OnWindowChanged() has been called.
+ Returns the Chrome toolbar associated with this BrowserView. Only supported when using Chrome style. The ICefBrowserViewDelegate.GetChromeToolbarType function must return a value other than CEF_CTT_NONE and the toolbar will not be available until after this BrowserView is added to a ICefWindow and ICefViewDelegate.OnWindowChanged() has been called.
@@ -89,7 +89,7 @@
- Sets whether accelerators registered with ICefWindow.SetAccelerator are triggered before or after the event is sent to the ICefBrowser. If |prefer_accelerators| is true (1) then the matching accelerator will be triggered immediately and the event will not be sent to the ICefBrowser. If |prefer_accelerators| is false (0) then the matching accelerator will only be triggered if the event is not handled by web content or by ICefKeyboardHandler. The default value is false (0).
+ Sets whether normal priority accelerators are first forwarded to the web content (`keydown` event handler) or ICefKeyboardHandler. Normal priority accelerators can be registered via ICefWindow.SetAccelerator (with |high_priority|=false) or internally for standard accelerators supported by Chrome style. If |prefer_accelerators| is true then the matching accelerator will be triggered immediately (calling ICefWindowDelegate.OnAccelerator or ICefCommandHandler.OnChromeCommand respectively) and the event will not be forwarded to the web content or ICefKeyboardHandler first. If |prefer_accelerators| is false then the matching accelerator will only be triggered if the event is not handled by web content (`keydown` event handler that calls `event.preventDefault()`) or by ICefKeyboardHandler. The default value is false.
diff --git a/docs/html/uCEFBrowserViewComponent.TCEFBrowserViewComponent.html b/docs/html/uCEFBrowserViewComponent.TCEFBrowserViewComponent.html
index 9e54e73d..50e303b3 100644
--- a/docs/html/uCEFBrowserViewComponent.TCEFBrowserViewComponent.html
+++ b/docs/html/uCEFBrowserViewComponent.TCEFBrowserViewComponent.html
@@ -19,7 +19,7 @@
type TCEFBrowserViewComponent = class(TCEFViewComponent, ICefBrowserViewDelegateEvents)
Description
- Component hosting a ICefBrowserView instance. Used in Chrome runtime mode only.
- Sets whether accelerators registered with ICefWindow.SetAccelerator are triggered before or after the event is sent to the ICefBrowser. If |prefer_accelerators| is true (1) then the matching accelerator will be triggered immediately and the event will not be sent to the ICefBrowser. If |prefer_accelerators| is false (0) then the matching accelerator will only be triggered if the event is not handled by web content or by ICefKeyboardHandler. The default value is false (0).
+ Sets whether normal priority accelerators are first forwarded to the web content (`keydown` event handler) or ICefKeyboardHandler. Normal priority accelerators can be registered via ICefWindow.SetAccelerator (with |high_priority|=false) or internally for standard accelerators supported by Chrome style. If |prefer_accelerators| is true then the matching accelerator will be triggered immediately (calling ICefWindowDelegate.OnAccelerator or ICefCommandHandler.OnChromeCommand respectively) and the event will not be forwarded to the web content or ICefKeyboardHandler first. If |prefer_accelerators| is false then the matching accelerator will only be triggered if the event is not handled by web content (`keydown` event handler that calls `event.preventDefault()`) or by ICefKeyboardHandler. The default value is false.
+ Returns the Chrome toolbar associated with this BrowserView. Only supported when using Chrome style. The ICefBrowserViewDelegate.GetChromeToolbarType function must return a value other than CEF_CTT_NONE and the toolbar will not be available until after this BrowserView is added to a ICefWindow and ICefViewDelegate.OnWindowChanged() has been called.
- Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With the Chrome runtime these commands can also be handled via cef_command_handler_t::OnChromeCommand.
+ Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With Chrome style these commands can also be handled via ICefCommandHandler.OnChromeCommand.
- Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With the Chrome runtime these commands can also be handled via cef_command_handler_t::OnChromeCommand.
+ Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With Chrome style these commands can also be handled via ICefCommandHandler.OnChromeCommand.
- Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With the Chrome runtime these commands can also be handled via cef_command_handler_t::OnChromeCommand.
+ Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With Chrome style these commands can also be handled via ICefCommandHandler.OnChromeCommand.
- Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With the Chrome runtime these commands can also be handled via cef_command_handler_t::OnChromeCommand.
+ Called when |browser_view| receives a gesture command. Return true (1) to handle (or disable) a |gesture_command| or false (0) to propagate the gesture to the browser for default handling. With Chrome style these commands can also be handled via ICefCommandHandler.OnChromeCommand.
function MustCreateExtensionHandler: boolean; virtual;
-
-
-
This item has no description.
-
-
-
-
function MustCreatePrintHandler: boolean; virtual;
@@ -9612,7 +9312,7 @@ Custom
- Requests the renderer to exit browser fullscreen. In most cases exiting window fullscreen should also exit browser fullscreen. With the Alloy runtime this function should be called in response to a user action such as clicking the green traffic light button on MacOS (ICefWindowDelegate.OnWindowFullscreenTransition callback) or pressing the "ESC" key (ICefKeyboardHandler.OnPreKeyEvent callback). With the Chrome runtime these standard exit actions are handled internally but new/additional user actions can use this function. Set |will_cause_resize| to true (1) if exiting browser fullscreen will cause a view resize.
+ Requests the renderer to exit browser fullscreen. In most cases exiting window fullscreen should also exit browser fullscreen. With Alloy style this function should be called in response to a user action such as clicking the green traffic light button on MacOS (ICefWindowDelegate.OnWindowFullscreenTransition callback) or pressing the "ESC" key (ICefKeyboardHandler.OnPreKeyEvent callback). With Chrome style these standard exit actions are handled internally but new/additional user actions can use this function. Set |will_cause_resize| to true (1) if exiting browser fullscreen will cause a view resize.
@@ -9622,7 +9322,7 @@ Custom
- Returns true (1) if a Chrome command is supported and enabled. Values for |command_id| can be found in the cef_command_ids.h file. This function can only be called on the UI thread. Only used with the Chrome runtime.
+ Returns true (1) if a Chrome command is supported and enabled. Values for |command_id| can be found in the cef_command_ids.h file. This function can only be called on the UI thread. Only used with Chrome style.
@@ -9638,7 +9338,7 @@ Custom
- Execute a Chrome command. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Only used with the Chrome runtime.
+ Execute a Chrome command. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Only used with Chrome style.
If extension resources will be read from disk using the default load implementation then |root_directory| should be the absolute path to the extension resources directory and |manifest| should be NULL. If extension resources will be provided by the client (e.g. via cef_request_handler_t and/or cef_extension_handler_t) then |root_directory| should be a path component unique to the extension (if not absolute this will be internally prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the contents that would otherwise be read from the "manifest.json" file on disk.
-
-
The loaded extension will be accessible in all contexts sharing the same storage (HasExtension returns true (1)). However, only the context on which this function was called is considered the loader (DidLoadExtension returns true (1)) and only the loader will receive TCustomRequestContextHandler callbacks for the extension.
-
-
TCustomExtensionHandler.OnExtensionLoaded will be called on load success or TCustomExtensionHandler.OnExtensionLoadFailed will be called on load failure.
-
-
If the extension specifies a background script via the "background" manifest key then TCustomExtensionHandler.OnBeforeBackgroundBrowser will be called to create the background browser. See that function for additional information about background scripts.
-
-
For visible extension views the client application should evaluate the manifest to determine the correct extension URL to load and then pass that URL to the ICefBrowserHost.CreateBrowser* function after the extension has loaded. For example, the client can look for the "browser_action" manifest key as documented at https://developer.chrome.com/extensions/browserAction. Extension URLs take the form "chrome-extension://<extension_id>/<path>".
-
-
Browsers that host extensions differ from normal browsers as follows:
-
-
-
-
-- Can access chrome.* JavaScript APIs if allowed by the manifest. Visit
- chrome://extensions-support for the list of extension APIs currently
- supported by CEF.
-- Main frame navigation to non-extension content is blocked.
-- Pinch-zooming is disabled.
-- ICefBrowserHost.GetExtension returns the hosted extension.
-- ICefBrowserHost.IsBackgroundHost returns true for background hosts.
WARNING: This function is deprecated and will be removed in ~M127.
-
-
-
-
-
-
function DidLoadExtension(const extension_id: ustring): boolean; deprecated;
-
-
-
Warning: this symbol is deprecated.
-
-
-
Returns true (1) if this context was used to load the extension identified by |extension_id|. Other contexts sharing the same storage will also have access to the extension (see HasExtension). This function must be called on the browser process UI thread.
-
-
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
-
-
-
-
function HasExtension(const extension_id: ustring): boolean; deprecated;
-
-
-
Warning: this symbol is deprecated.
-
-
-
Returns true (1) if this context has access to the extension identified by |extension_id|. This may not be the context that was used to load the extension (see DidLoadExtension). This function must be called on the browser process UI thread.
-
-
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
-
-
-
-
function GetExtensions(const extension_ids: TStringList): boolean; deprecated;
-
-
-
Warning: this symbol is deprecated.
- Retrieve the list of all extensions that this context has access to (see HasExtension). |extension_ids| will be populated with the list of extension ID values. Returns true (1) on success. This function must be called on the browser process UI thread.
-
-
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
Returns the extension matching |extension_id| or NULL if no matching extension is accessible in this context (see HasExtension). This function must be called on the browser process UI thread.
-
-
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
- Get the default zoom level. This value will be 0.0 by default but can be configured with the Chrome runtime. This function can only be called on the CEF UI thread.
+ Get the default zoom level. This value will be 0.0 by default but can be configured. This function can only be called on the UI thread.
@@ -11214,7 +10789,7 @@ Custom
- Enable the file download bubble when using the Chrome runtime.
+ Enable the file download bubble when using Chrome style.
@@ -11792,7 +11367,7 @@ Custom
- Called when web content in the page has toggled fullscreen mode. If |fullscreen| is true (1) the content will automatically be sized to fill the browser content area. If |fullscreen| is false (0) the content will automatically return to its original size and position. With the Alloy runtime the client is responsible for triggering the fullscreen transition (for example, by calling ICefWindow.SetFullscreen when using Views). With the Chrome runtime the fullscreen transition will be triggered automatically. The ICefWindowDelegate.OnWindowFullscreenTransition function will be called during the fullscreen transition for notification purposes.
+ Called when web content in the page has toggled fullscreen mode. If |fullscreen| is true (1) the content will automatically be sized to fill the browser content area. If |fullscreen| is false (0) the content will automatically return to its original size and position. With Alloy style the client is responsible for triggering the fullscreen transition (for example, by calling ICefWindow.SetFullscreen when using Views). With Chrome style the fullscreen transition will be triggered automatically. The ICefWindowDelegate.OnWindowFullscreenTransition function will be called during the fullscreen transition for notification purposes.
@@ -12054,7 +11629,7 @@ Custom
The |extra_info| parameter provides an opportunity to specify extra information specific to the created popup browser that will be passed to ICefRenderProcessHandler.OnBrowserCreated() in the render process. The existing |extra_info| object, if any, will be read-only but may be replaced with a new object.
-
Views-hosted source browsers will create Views-hosted DevTools popups unless |use_default_window| is set to to true (1). DevTools popups can be blocked by returning true (1) from ICefCommandHandler.OnChromeCommand for IDC_DEV_TOOLS. Only used with the Chrome runtime.
+
Views-hosted source browsers will create Views-hosted DevTools popups unless |use_default_window| is set to to true (1). DevTools popups can be blocked by returning true (1) from ICefCommandHandler.OnChromeCommand for IDC_DEV_TOOLS. Only used with Chrome style.
@@ -12290,7 +11865,7 @@ Custom
- 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.
+ 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 Alloy style or display of the "Page unresponsive" dialog with Chrome style. Return true (1) and don't execute the callback for an indefinite wait without display of the Chrome style 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.
- Called when an extension needs a browser to host a background script specified via the "background" manifest key. The browser will have no visible window and cannot be displayed. |extension| is the extension that is loading the background script. |url| is an internally generated reference to an HTML page that will be used to load the background script via a "<script>" src attribute. To allow creation of the browser optionally modify |client| and |settings| and return false (0). To cancel creation of the browser (and consequently cancel load of the background script) return true (1). Successful creation will be indicated by a call to ICefLifeSpanHandler.OnAfterCreated, and ICefBrowserHost.IsBackgroundHost will return true (1) for the resulting browser. See https://developer.chrome.com/extensions/event_pages for more information about extension background script usage.
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
This event will be called on the browser process CEF UI thread.
-
-
- Called when an extension API (e.g. chrome.tabs.create) requests creation of a new browser. |extension| and |browser| are the source of the API call. |active_browser| may optionally be specified via the windowId property or returned via the get_active_browser() callback and provides the default |client| and |settings| values for the new browser. |index| is the position value optionally specified via the index property. |url| is the URL that will be loaded in the browser. |active| is true (1) if the new browser should be active when opened. To allow creation of the browser optionally modify |windowInfo|, |client| and |settings| and return false (0). To cancel creation of the browser return true (1). Successful creation will be indicated by a call to ICefLifeSpanHandler.OnAfterCreated. Any modifications to |windowInfo| will be ignored if |active_browser| is wrapped in a ICefBrowserView.
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
This event will be called on the browser process CEF UI thread.
-
-
- Called when no tabId is specified to an extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the source of the API call. Return the browser that will be acted on by the API call or return NULL to act on |browser|. The returned browser must share the same ICefRequestContext as |browser|. Incognito browsers should not be considered unless the source extension has incognito access enabled, in which case |include_incognito| will be true (1).
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
This event will be called on the browser process CEF UI thread.
-
-
- Called when the tabId associated with |target_browser| is specified to an extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the source of the API call. Return true (1) to allow access of false (0) to deny access. Access to incognito browsers should not be allowed unless the source extension has incognito access enabled, in which case |include_incognito| will be true (1).
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
This event will be called on the browser process CEF UI thread.
-
-
- Called to retrieve an extension resource that would normally be loaded from disk (e.g. if a file parameter is specified to chrome.tabs.executeScript). |extension| and |browser| are the source of the resource request. |file| is the requested relative file path. To handle the resource request return true (1) and execute |callback| either synchronously or asynchronously. For the default behavior which reads the resource from the extension directory on disk return false (0). Localization substitutions will not be applied to resources handled via this function.
-
-
-
-
WARNING: This function is deprecated and will be removed in ~M127.
-
-
This event will be called on the browser process CEF UI thread.
-
-
This event will be called on the browser process CEF UI thread.
@@ -13458,7 +12889,7 @@ Custom
-
Only used with the Chrome runtime.
+
Only used with Chrome style.
This event will be called on the browser process CEF UI thread.
@@ -13476,7 +12907,7 @@ Custom
-
Only used with the Chrome runtime.
+
Only used with Chrome style.
This event will be called on the browser process CEF UI thread.
@@ -13494,7 +12925,7 @@ Custom
-
Only used with the Chrome runtime.
+
Only used with Chrome style.
This event will be called on the browser process CEF UI thread.
@@ -13512,7 +12943,7 @@ Custom
-
Only used with the Chrome runtime.
+
Only used with Chrome style.
This event will be called on the browser process CEF UI thread.
@@ -13528,11 +12959,17 @@ Custom
-
Called when a page requests permission to access media. |requesting_origin| is the URL origin requesting permission.
+
Called when a page requests permission to access media.
-
|requested_permissions| is a combination of values from TCefMediaAccessPermissionTypes that represent the requested permissions. Return true (1) and call ICefMediaAccessCallback functions either in this function or at a later time to continue or cancel the request. Return false (0) to proceed with default handling. With the Chrome runtime, default handling will display the permission request UI.
+
|requesting_origin| is the URL origin requesting permission.
-
With the Alloy runtime, default handling will deny the request. This function will not be called if the "–enable-media-stream" command-line switch is used to grant all permissions.
+
|requested_permissions| is a combination of values from TCefMediaAccessPermissionTypes that represent the requested permissions.
+
+
Return true (1) and call ICefMediaAccessCallback functions either in this function or at a later time to continue or cancel the request.
+
+
Return false (0) to proceed with default handling. With Chrome style, default handling will display the permission request UI.
+
+
With Alloy style, default handling will deny the request. This function will not be called if the "–enable-media-stream" command-line switch is used to grant all permissions.
@@ -13556,7 +12993,7 @@ Custom
Return true (1) and call ICefPermissionPromptCallback.Continue either in this function or at a later time to continue or cancel the request.
-
Return false (0) to proceed with default handling. With the Chrome runtime, default handling will display the permission prompt UI. With the Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
+
Return false (0) to proceed with default handling. With Chrome style, default handling will display the permission prompt UI. With Alloy style, default handling is CEF_PERMISSION_RESULT_IGNORE.
- Called to execute a Chrome command triggered via menu selection or keyboard shortcut. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Return true (1) if the command was handled or false (0) for the default implementation. For context menu commands this will be called after ICefContextMenuHandler.OnContextMenuCommand. Only used with the Chrome runtime.
+ Called to execute a Chrome command triggered via menu selection or keyboard shortcut. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Return true (1) if the command was handled or false (0) for the default implementation. For context menu commands this will be called after ICefContextMenuHandler.OnContextMenuCommand. Only used with Chrome style.
- Called to check if a Chrome app menu item should be visible. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be visible by default. Only used with the Chrome runtime.
+ Called to check if a Chrome app menu item should be visible. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be visible by default. Only used with Chrome style.
- Called to check if a Chrome app menu item should be enabled. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be enabled by default. Only used with the Chrome runtime.
+ Called to check if a Chrome app menu item should be enabled. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be enabled by default. Only used with Chrome style.
- Called during browser creation to check if a Chrome page action icon should be visible. Only called for icons that would be visible by default. Only used with the Chrome runtime.
+ Called during browser creation to check if a Chrome page action icon should be visible. Only called for icons that would be visible by default. Only used with Chrome style.
- Called during browser creation to check if a Chrome toolbar button should be visible. Only called for buttons that would be visible by default. Only used with the Chrome runtime.
+ Called during browser creation to check if a Chrome toolbar button should be visible. Only called for buttons that would be visible by default. Only used with Chrome style.
- Called to execute a Chrome command triggered via menu selection or keyboard shortcut. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Return true (1) if the command was handled or false (0) for the default implementation. For context menu commands this will be called after ICefContextMenuHandler.OnContextMenuCommand. Only used with the Chrome runtime.
+ Called to execute a Chrome command triggered via menu selection or keyboard shortcut. Values for |command_id| can be found in the cef_command_ids.h file. |disposition| provides information about the intended command target. Return true (1) if the command was handled or false (0) for the default implementation. For context menu commands this will be called after ICefContextMenuHandler.OnContextMenuCommand. Only used with Chrome style.
- Called to check if a Chrome app menu item should be visible. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be visible by default. Only used with the Chrome runtime.
+ Called to check if a Chrome app menu item should be visible. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be visible by default. Only used with Chrome style.
- Called to check if a Chrome app menu item should be enabled. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be enabled by default. Only used with the Chrome runtime.
+ Called to check if a Chrome app menu item should be enabled. Values for |command_id| can be found in the cef_command_ids.h file. Only called for menu items that would be enabled by default. Only used with Chrome style.
- Called during browser creation to check if a Chrome page action icon should be visible. Only called for icons that would be visible by default. Only used with the Chrome runtime.
+ Called during browser creation to check if a Chrome page action icon should be visible. Only called for icons that would be visible by default. Only used with Chrome style.
- Called during browser creation to check if a Chrome toolbar button should be visible. Only called for buttons that would be visible by default. Only used with the Chrome runtime.
+ Called during browser creation to check if a Chrome toolbar button should be visible. Only called for buttons that would be visible by default. Only used with Chrome style.
- User got to this page through a suggestion in the UI (for example, via the destinations page). Chrome runtime only.
+ User got to this page through a suggestion in the UI (for example, via the destinations page). Chrome style only.
@@ -8037,7 +8040,7 @@ Not configurable
- User got to this page by typing in the URL bar and selecting an entry that did not look like a URL. For example, a match might have the URL of a Google search result page, but appear like "Search Google for ...". These are not quite the same as EXPLICIT navigations because the user didn't type or see the destination URL. Chrome runtime only. See also TT_KEYWORD.
+ User got to this page by typing in the URL bar and selecting an entry that did not look like a URL. For example, a match might have the URL of a Google search result page, but appear like "Search Google for ...". These are not quite the same as EXPLICIT navigations because the user didn't type or see the destination URL. Chrome style only. See also TT_KEYWORD.
@@ -8052,7 +8055,7 @@ Not configurable
- This is a toplevel navigation. This is any content that is automatically loaded in a toplevel frame. For example, opening a tab to show the ASH screen saver, opening the devtools window, opening the NTP after the safe browsing warning, opening web-based dialog boxes are examples of AUTO_TOPLEVEL navigations. Chrome runtime only.
+ This is a toplevel navigation. This is any content that is automatically loaded in a toplevel frame. For example, opening a tab to show the ASH screen saver, opening the devtools window, opening the NTP after the safe browsing warning, opening web-based dialog boxes are examples of AUTO_TOPLEVEL navigations. Chrome style only.
@@ -8097,7 +8100,7 @@ Not configurable
- The url was generated from a replaceable keyword other than the default search provider. If the user types a keyword (which also applies to tab-to-search) in the omnibox this qualifier is applied to the transition type of the generated url. TemplateURLModel then may generate an additional visit with a transition type of TT_KEYWORD_GENERATED against the url 'http://' + keyword. For example, if you do a tab-to-search against wikipedia the generated url has a transition qualifer of TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' with a transition type of TT_KEYWORD_GENERATED. Chrome runtime only.
+ The url was generated from a replaceable keyword other than the default search provider. If the user types a keyword (which also applies to tab-to-search) in the omnibox this qualifier is applied to the transition type of the generated url. TemplateURLModel then may generate an additional visit with a transition type of TT_KEYWORD_GENERATED against the url 'http://' + keyword. For example, if you do a tab-to-search against wikipedia the generated url has a transition qualifer of TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' with a transition type of TT_KEYWORD_GENERATED. Chrome style only.
@@ -8112,7 +8115,7 @@ Not configurable
- Corresponds to a visit generated for a keyword. See description of TT_KEYWORD for more details. Chrome runtime only.
+ Corresponds to a visit generated for a keyword. See description of TT_KEYWORD for more details. Chrome style only.
@@ -8187,7 +8190,7 @@ Not configurable
- User is navigating to the home page. Chrome runtime only.
+ User is navigating to the home page. Chrome style only.
@@ -8202,7 +8205,7 @@ Not configurable
- The transition originated from an external application; the exact definition of this is embedder dependent. Chrome runtime and extension system only.
+ The transition originated from an external application; the exact definition of this is embedder dependent. Chrome style only.
@@ -10618,7 +10621,7 @@ Custom menu items originating from the renderer process.
- Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with the Chrome runtime. Should be kept in sync with Chromium's permissions::RequestType type.
+ Permission types used with OnShowPermissionPrompt. Some types are platform-specific or only supported with Chrome style. Should be kept in sync with Chromium's permissions::RequestType type.
@@ -13008,6 +13011,19 @@ If any of the platform IDs are not defined then we set them as 0 to avoid build
This item has no description.
+
+
+
CEF_ONEDAYINMILLISECONDS = 86400000;
+
+
+
+ This value may be used with the mseconds_between_dumps parameter in GlobalCEFApp.DumpWithoutCrashing.