From b2db728cbf36c35b242d5baee3f082f01b3f0ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Sat, 20 Oct 2018 14:46:24 +0200 Subject: [PATCH] Update to CEF 3.3497.1841.g7f37a0a --- demos/MiniBrowser/uMiniBrowser.pas | 3 +-- demos/SimpleBrowser2/uSimpleBrowser2.pas | 9 ++++++++- source/uCEFApplication.pas | 14 +++++--------- source/uCEFChromium.pas | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/demos/MiniBrowser/uMiniBrowser.pas b/demos/MiniBrowser/uMiniBrowser.pas index 717804ed..0dd7c287 100644 --- a/demos/MiniBrowser/uMiniBrowser.pas +++ b/demos/MiniBrowser/uMiniBrowser.pas @@ -804,6 +804,7 @@ begin FClosing := False; FResponse := TStringList.Create; FRequest := TStringList.Create; + Chromium1.DefaultURL := MINIBROWSER_HOMEPAGE; end; procedure TMiniBrowserFrm.FormDestroy(Sender: TObject); @@ -838,8 +839,6 @@ procedure TMiniBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage); begin CEFWindowParent1.UpdateSize; NavControlPnl.Enabled := True; - AddURL(MINIBROWSER_HOMEPAGE); - Chromium1.LoadURL(MINIBROWSER_HOMEPAGE); end; procedure TMiniBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage); diff --git a/demos/SimpleBrowser2/uSimpleBrowser2.pas b/demos/SimpleBrowser2/uSimpleBrowser2.pas index 0042a830..67446562 100644 --- a/demos/SimpleBrowser2/uSimpleBrowser2.pas +++ b/demos/SimpleBrowser2/uSimpleBrowser2.pas @@ -49,7 +49,8 @@ uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, {$ENDIF} - uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes; + uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, + uCEFWinControl; type TForm1 = class(TForm) @@ -118,6 +119,12 @@ uses // This demo uses a TChromium and a TCEFWindowParent +// 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 TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose := FCanClose; diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index f2a06265..916cf136 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -61,7 +61,7 @@ uses const CEF_SUPPORTED_VERSION_MAJOR = 3; CEF_SUPPORTED_VERSION_MINOR = 3497; - CEF_SUPPORTED_VERSION_RELEASE = 1840; + CEF_SUPPORTED_VERSION_RELEASE = 1841; CEF_SUPPORTED_VERSION_BUILD = 0; CEF_CHROMEELF_VERSION_MAJOR = 69; @@ -128,6 +128,7 @@ type FSitePerProcess : boolean; FDisableWebSecurity : boolean; FDisablePDFExtension : boolean; + FLogProcessInfo : boolean; FChromeVersionInfo : TFileVersionInfo; {$IFDEF FPC} FLibHandle : TLibHandle; @@ -353,6 +354,7 @@ type property SitePerProcess : boolean read FSitePerProcess write FSitePerProcess; property DisableWebSecurity : boolean read FDisableWebSecurity write FDisableWebSecurity; property DisablePDFExtension : boolean read FDisablePDFExtension write FDisablePDFExtension; + property LogProcessInfo : boolean read FLogProcessInfo write FLogProcessInfo; property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions; property DeviceScaleFactor : single read FDeviceScaleFactor; property CheckDevToolsResources : boolean read FCheckDevToolsResources write FCheckDevToolsResources; @@ -503,6 +505,7 @@ begin FSitePerProcess := True; FDisableWebSecurity := False; FDisablePDFExtension := False; + FLogProcessInfo := False; FReRaiseExceptions := False; FLibLoaded := False; FShowMessageDlg := True; @@ -1633,14 +1636,7 @@ begin FLibLoaded := True; Result := True; - {$IFDEF DEBUG} - // Enable the following code line to add the PROCESSID of each process - // to the "debug.log" file. That information will help you select the - // right process when you need to debug the render process. - - //CefDebugLog('Process started', CEF_LOG_SEVERITY_INFO); - {$ENDIF} - + if FLogProcessInfo then CefDebugLog('Process started', CEF_LOG_SEVERITY_INFO); if FEnableHighDPISupport then cef_enable_highdpi_support(); end else diff --git a/source/uCEFChromium.pas b/source/uCEFChromium.pas index 14106e98..59947c72 100644 --- a/source/uCEFChromium.pas +++ b/source/uCEFChromium.pas @@ -125,7 +125,7 @@ type FBrowserCompStub : Pointer; FWidgetCompStub : Pointer; FRenderCompStub : Pointer; - {$ENDIF} + {$ENDIF} FBrowserCompHWND : THandle; FWidgetCompHWND : THandle; FRenderCompHWND : THandle;