diff --git a/README.md b/README.md index af6c9294..f9ca7897 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file. -CEF4Delphi uses CEF 85.2.11 which includes Chromium 85.0.4183.83. +CEF4Delphi uses CEF 85.3.5 which includes Chromium 85.0.4183.102. The CEF binaries used by CEF4Delphi are available for download at spotify : -* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_85.2.11%2Bg0202816%2Bchromium-85.0.4183.83_windows32.tar.bz2) -* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_85.2.11%2Bg0202816%2Bchromium-85.0.4183.83_windows64.tar.bz2) +* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_85.3.5%2Bgd7ff358%2Bchromium-85.0.4183.102_windows32.tar.bz2) +* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_85.3.5%2Bgd7ff358%2Bchromium-85.0.4183.102_windows64.tar.bz2) CEF4Delphi was developed and tested on Delphi 10.4 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.10/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components. diff --git a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas index 90e1b5fb..f2c68958 100644 --- a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas +++ b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas @@ -283,6 +283,10 @@ procedure CreateGlobalCEFApp; GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO; GlobalCEFApp.cache := 'cache'; GlobalCEFApp.EnablePrintPreview := True; + + // Workaround for the issue #301 + // https://github.com/salvadordf/CEF4Delphi/issues/301 + GlobalCEFApp.DisableFeatures := 'OutOfBlinkCors'; end; procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject); diff --git a/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj b/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj index 26db1208..13080961 100644 --- a/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj +++ b/demos/Delphi_VCL/ToolBoxBrowser2/ToolBoxBrowser2.dproj @@ -1,7 +1,7 @@  {699A2237-C3B7-4C84-AC7C-9F9BC9BCC85E} - 18.8 + 19.0 VCL ToolBoxBrowser2.dpr True @@ -654,6 +654,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -665,6 +675,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -764,6 +784,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -775,6 +805,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -819,6 +859,26 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -866,6 +926,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + 1 diff --git a/demos/Lazarus/MiniBrowser/MiniBrowser.lps b/demos/Lazarus/MiniBrowser/MiniBrowser.lps index f92df71e..c90dbd8a 100644 --- a/demos/Lazarus/MiniBrowser/MiniBrowser.lps +++ b/demos/Lazarus/MiniBrowser/MiniBrowser.lps @@ -23,7 +23,7 @@ - + diff --git a/demos/Lazarus/MiniBrowser/uMiniBrowser.pas b/demos/Lazarus/MiniBrowser/uMiniBrowser.pas index af895cfc..475b3ff9 100644 --- a/demos/Lazarus/MiniBrowser/uMiniBrowser.pas +++ b/demos/Lazarus/MiniBrowser/uMiniBrowser.pas @@ -303,7 +303,11 @@ procedure CreateGlobalCEFApp; GlobalCEFApp.cache := 'cache'; GlobalCEFApp.LogFile := 'debug.log'; GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO; - GlobalCEFApp.EnablePrintPreview := True; + GlobalCEFApp.EnablePrintPreview := True; + + // Workaround for the issue #301 + // https://github.com/salvadordf/CEF4Delphi/issues/301 + GlobalCEFApp.DisableFeatures := 'OutOfBlinkCors'; end; procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject); diff --git a/packages/cef4delphi_lazarus.lpk b/packages/cef4delphi_lazarus.lpk index f01b1879..2b695e2b 100644 --- a/packages/cef4delphi_lazarus.lpk +++ b/packages/cef4delphi_lazarus.lpk @@ -21,7 +21,7 @@ - + diff --git a/source/uCEFApplicationCore.pas b/source/uCEFApplicationCore.pas index 3ad021a7..104bb42d 100644 --- a/source/uCEFApplicationCore.pas +++ b/source/uCEFApplicationCore.pas @@ -58,14 +58,14 @@ interface const CEF_SUPPORTED_VERSION_MAJOR = 85; - CEF_SUPPORTED_VERSION_MINOR = 2; - CEF_SUPPORTED_VERSION_RELEASE = 11; + CEF_SUPPORTED_VERSION_MINOR = 3; + CEF_SUPPORTED_VERSION_RELEASE = 5; CEF_SUPPORTED_VERSION_BUILD = 0; CEF_CHROMEELF_VERSION_MAJOR = 85; CEF_CHROMEELF_VERSION_MINOR = 0; CEF_CHROMEELF_VERSION_RELEASE = 4183; - CEF_CHROMEELF_VERSION_BUILD = 83; + CEF_CHROMEELF_VERSION_BUILD = 102; {$IFDEF MSWINDOWS} LIBCEF_DLL = 'libcef.dll'; diff --git a/source/uCEFChromiumCore.pas b/source/uCEFChromiumCore.pas index 91e9f2e5..e11df930 100644 --- a/source/uCEFChromiumCore.pas +++ b/source/uCEFChromiumCore.pas @@ -138,7 +138,7 @@ TChromiumCore = class(TComponent, IChromiumEvents) FAcceptLanguageList : ustring; FAcceptCookies : TCefCookiePref; FBlock3rdPartyCookies : boolean; - FDefaultWindowInfoExStyle : cardinal; + FDefaultWindowInfoExStyle : DWORD; FNetworkPredictions : TCefNetworkPredictionOptions; FQuicAllowed : boolean; FJavascriptEnabled : boolean; @@ -880,7 +880,7 @@ TChromiumCore = class(TComponent, IChromiumEvents) property AcceptCookies : TCefCookiePref read FAcceptCookies write SetAcceptCookies; property Block3rdPartyCookies : boolean read FBlock3rdPartyCookies write SetBlock3rdPartyCookies; property MultiBrowserMode : boolean read FMultiBrowserMode write SetMultiBrowserMode; - property DefaultWindowInfoExStyle : cardinal read FDefaultWindowInfoExStyle write FDefaultWindowInfoExStyle; + property DefaultWindowInfoExStyle : DWORD read FDefaultWindowInfoExStyle write FDefaultWindowInfoExStyle; property Offline : boolean read FOffline write SetOffline; property NetworkPredictions : TCefNetworkPredictionOptions read FNetworkPredictions write SetNetworkPredictions; property QuicAllowed : boolean read FQuicAllowed write SetQuicAllowed; diff --git a/source/uCEFInterfaces.pas b/source/uCEFInterfaces.pas index 56201aaf..e086d478 100644 --- a/source/uCEFInterfaces.pas +++ b/source/uCEFInterfaces.pas @@ -2894,6 +2894,7 @@ TCefMediaSourceInfo = record procedure OnWindowCreated(const window: ICefWindow); procedure OnWindowDestroyed(const window: ICefWindow); procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); + procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean); procedure OnCanResize(const window: ICefWindow; var aResult : boolean); procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean); @@ -2908,6 +2909,7 @@ TCefMediaSourceInfo = record procedure doOnWindowCreated(const window: ICefWindow); procedure doOnWindowDestroyed(const window: ICefWindow); procedure doOnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); + procedure doOnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); procedure doOnIsFrameless(const window: ICefWindow; var aResult : boolean); procedure doOnCanResize(const window: ICefWindow; var aResult : boolean); procedure doOnCanMaximize(const window: ICefWindow; var aResult : boolean); diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index 2b3b8510..0cafddb3 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -140,9 +140,9 @@ function cef_string_utf16_copy(const src: PChar16; src_len: NativeUInt; output: function cef_string_copy(const src: PCefChar; src_len: NativeUInt; output: PCefString): Integer; {$IFDEF MSWINDOWS} -procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring = ''; aExStyle : cardinal = 0); -procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : cardinal = 0); -procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : cardinal = 0); +procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring = ''; aExStyle : DWORD = 0); +procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : DWORD = 0); +procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : DWORD = 0); {$ENDIF} {$IFDEF MACOS} @@ -626,7 +626,7 @@ function cef_string_copy(const src: PCefChar; src_len: NativeUInt; output: PCefS end; {$IFDEF MSWINDOWS} -procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring; aExStyle : cardinal); +procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring; aExStyle : DWORD); begin aWindowInfo.ex_style := aExStyle; aWindowInfo.window_name := CefString(aWindowName); @@ -643,7 +643,7 @@ procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWind aWindowInfo.window := 0; end; -procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : cardinal); +procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : DWORD); begin aWindowInfo.ex_style := aExStyle; aWindowInfo.window_name := CefString(aWindowName); @@ -660,7 +660,7 @@ procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWind aWindowInfo.window := 0; end; -procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : cardinal); +procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : DWORD); begin aWindowInfo.ex_style := aExStyle; aWindowInfo.window_name := CefString(aWindowName); diff --git a/source/uCEFTypes.pas b/source/uCEFTypes.pas index beff69c4..ec6a9b88 100644 --- a/source/uCEFTypes.pas +++ b/source/uCEFTypes.pas @@ -3358,6 +3358,7 @@ TCefWindowDelegate = record on_window_created : procedure(self: PCefWindowDelegate; window: PCefWindow); stdcall; on_window_destroyed : procedure(self: PCefWindowDelegate; window: PCefWindow); stdcall; get_parent_window : function(self: PCefWindowDelegate; window: PCefWindow; is_menu, can_activate_menu: PInteger): PCefWindow; stdcall; + get_initial_bounds : function(self: PCefWindowDelegate; window: PCefWindow): TCefRect; stdcall; is_frameless : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall; can_resize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall; can_maximize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall; diff --git a/source/uCEFViewsFrameworkEvents.pas b/source/uCEFViewsFrameworkEvents.pas index 5b0178e7..a0ea2e84 100644 --- a/source/uCEFViewsFrameworkEvents.pas +++ b/source/uCEFViewsFrameworkEvents.pas @@ -87,16 +87,17 @@ interface TOnMenuButtonPressedEvent = procedure(const Sender: TObject; const menu_button: ICefMenuButton; const screen_point: TCefPoint; const button_pressed_lock: ICefMenuButtonPressedLock) of object; // ICefWindowDelegate - TOnWindowCreatedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object; - TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object; - TOnGetParentWindowEvent = procedure(const Sender: TObject; const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object; - TOnIsFramelessEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; - TOnCanResizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; - TOnCanMaximizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; - TOnCanMinimizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; - TOnCanCloseEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; - TOnAcceleratorEvent = procedure(const Sender: TObject; const window: ICefWindow; command_id: Integer; var aResult : boolean) of object; - TOnWindowKeyEventEvent = procedure(const Sender: TObject; const window: ICefWindow; const event: TCefKeyEvent; var aResult : boolean) of object; + TOnWindowCreatedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object; + TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object; + TOnGetParentWindowEvent = procedure(const Sender: TObject; const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object; + TOnGetInitialBoundsEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : TCefRect) of object; + TOnIsFramelessEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; + TOnCanResizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; + TOnCanMaximizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; + TOnCanMinimizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; + TOnCanCloseEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object; + TOnAcceleratorEvent = procedure(const Sender: TObject; const window: ICefWindow; command_id: Integer; var aResult : boolean) of object; + TOnWindowKeyEventEvent = procedure(const Sender: TObject; const window: ICefWindow; const event: TCefKeyEvent; var aResult : boolean) of object; implementation diff --git a/source/uCEFWindowComponent.pas b/source/uCEFWindowComponent.pas index dc998f75..098fec6b 100644 --- a/source/uCEFWindowComponent.pas +++ b/source/uCEFWindowComponent.pas @@ -70,6 +70,7 @@ TCEFWindowComponent = class(TCEFPanelComponent, ICefWindowDelegateEvents) FOnWindowCreated : TOnWindowCreatedEvent; FOnWindowDestroyed : TOnWindowDestroyedEvent; FOnGetParentWindow : TOnGetParentWindowEvent; + FOnGetInitialBounds : TOnGetInitialBoundsEvent; FOnIsFrameless : TOnIsFramelessEvent; FOnCanResize : TOnCanResizeEvent; FOnCanMaximize : TOnCanMaximizeEvent; @@ -108,6 +109,7 @@ TCEFWindowComponent = class(TCEFPanelComponent, ICefWindowDelegateEvents) procedure doOnWindowCreated(const window_: ICefWindow); procedure doOnWindowDestroyed(const window_: ICefWindow); procedure doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); + procedure doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); procedure doOnIsFrameless(const window_: ICefWindow; var aResult : boolean); procedure doOnCanResize(const window_: ICefWindow; var aResult : boolean); procedure doOnCanMaximize(const window_: ICefWindow; var aResult : boolean); @@ -158,6 +160,7 @@ TCEFWindowComponent = class(TCEFPanelComponent, ICefWindowDelegateEvents) property OnWindowCreated : TOnWindowCreatedEvent read FOnWindowCreated write FOnWindowCreated; property OnWindowDestroyed : TOnWindowDestroyedEvent read FOnWindowDestroyed write FOnWindowDestroyed; property OnGetParentWindow : TOnGetParentWindowEvent read FOnGetParentWindow write FOnGetParentWindow; + property OnGetInitialBounds : TOnGetInitialBoundsEvent read FOnGetInitialBounds write FOnGetInitialBounds; property OnIsFrameless : TOnIsFramelessEvent read FOnIsFrameless write FOnIsFrameless; property OnCanResize : TOnCanResizeEvent read FOnCanResize write FOnCanResize; property OnCanMaximize : TOnCanMaximizeEvent read FOnCanMaximize write FOnCanMaximize; @@ -212,6 +215,7 @@ procedure TCEFWindowComponent.Initialize; FOnWindowCreated := nil; FOnWindowDestroyed := nil; FOnGetParentWindow := nil; + FOnGetInitialBounds := nil; FOnIsFrameless := nil; FOnCanResize := nil; FOnCanMaximize := nil; @@ -297,6 +301,12 @@ procedure TCEFWindowComponent.doOnGetParentWindow(const window_: ICefWindow; var FOnGetParentWindow(self, window_, is_menu, can_activate_menu, aResult); end; +procedure TCEFWindowComponent.doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); +begin + if assigned(FOnGetInitialBounds) then + FOnGetInitialBounds(self, window_, aResult); +end; + procedure TCEFWindowComponent.doOnIsFrameless(const window_: ICefWindow; var aResult : boolean); begin if assigned(FOnIsFrameless) then diff --git a/source/uCEFWindowDelegate.pas b/source/uCEFWindowDelegate.pas index 08f815a1..81b1e97d 100644 --- a/source/uCEFWindowDelegate.pas +++ b/source/uCEFWindowDelegate.pas @@ -62,6 +62,7 @@ TCefWindowDelegateRef = class(TCefPanelDelegateRef, ICefWindowDelegate) procedure OnWindowCreated(const window: ICefWindow); procedure OnWindowDestroyed(const window: ICefWindow); procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); + procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean); procedure OnCanResize(const window: ICefWindow; var aResult : boolean); procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean); @@ -79,6 +80,7 @@ TCefWindowDelegateOwn = class(TCefPanelDelegateOwn, ICefWindowDelegate) procedure OnWindowCreated(const window: ICefWindow); virtual; procedure OnWindowDestroyed(const window: ICefWindow); virtual; procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); virtual; + procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); virtual; procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean); virtual; procedure OnCanResize(const window: ICefWindow; var aResult : boolean); virtual; procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean); virtual; @@ -111,6 +113,7 @@ TCustomWindowDelegate = class(TCefWindowDelegateOwn) procedure OnWindowCreated(const window: ICefWindow); override; procedure OnWindowDestroyed(const window: ICefWindow); override; procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override; + procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); override; procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean); override; procedure OnCanResize(const window: ICefWindow; var aResult : boolean); override; procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean); override; @@ -160,6 +163,11 @@ procedure TCefWindowDelegateRef.OnGetParentWindow(const window : ICef can_activate_menu := TempCanActivateMenu <> 0; end; +procedure TCefWindowDelegateRef.OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); +begin + aResult := PCefWindowDelegate(FData)^.get_initial_bounds(PCefWindowDelegate(FData), CefGetData(window)); +end; + procedure TCefWindowDelegateRef.OnIsFrameless(const window: ICefWindow; var aResult : boolean); begin aResult := (PCefWindowDelegate(FData)^.is_frameless(PCefWindowDelegate(FData), CefGetData(window)) <> 0); @@ -240,7 +248,6 @@ function cef_window_delegate_get_parent_window(self : PCefWindowDel TempObject := CefGetObject(self); TempWindow := nil; - if (TempObject <> nil) and (TempObject is TCefWindowDelegateOwn) and (is_menu <> nil) and (can_activate_menu <> nil) then begin TempIsMenu := (is_menu^ <> 0); @@ -257,6 +264,24 @@ function cef_window_delegate_get_parent_window(self : PCefWindowDel Result := CefGetData(TempWindow); end; +function cef_window_delegate_get_initial_bounds(self: PCefWindowDelegate; window: PCefWindow): TCefRect; stdcall; +var + TempObject : TObject; + TempRect : TCefRect; +begin + TempObject := CefGetObject(self); + TempRect.x := 0; + TempRect.y := 0; + TempRect.width := 0; + TempRect.height := 0; + + if (TempObject <> nil) and (TempObject is TCefWindowDelegateOwn) then + TCefWindowDelegateOwn(TempObject).OnGetInitialBounds(TCefWindowRef.UnWrap(window), + TempRect); + + Result := TempRect; +end; + function cef_window_delegate_is_frameless(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall; var TempObject : TObject; @@ -375,6 +400,7 @@ procedure TCefWindowDelegateOwn.InitializeCEFMethods; on_window_created := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_created; on_window_destroyed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_destroyed; get_parent_window := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_parent_window; + get_initial_bounds := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_bounds; is_frameless := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_is_frameless; can_resize := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_resize; can_maximize := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_maximize; @@ -400,6 +426,11 @@ procedure TCefWindowDelegateOwn.OnGetParentWindow(const window: ICefWindow; var // end; +procedure TCefWindowDelegateOwn.OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); +begin + // +end; + procedure TCefWindowDelegateOwn.OnIsFrameless(const window: ICefWindow; var aResult : boolean); begin // @@ -568,6 +599,17 @@ procedure TCustomWindowDelegate.OnGetParentWindow(const window: ICefWindow; var end; end; +procedure TCustomWindowDelegate.OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); +begin + try + if (FEvents <> nil) then + ICefWindowDelegateEvents(FEvents).doOnGetInitialBounds(window, aResult); + except + on e : exception do + if CustomExceptionHandler('TCustomWindowDelegate.OnGetInitialBounds', e) then raise; + end; +end; + procedure TCustomWindowDelegate.OnIsFrameless(const window: ICefWindow; var aResult : boolean); begin try diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index 99c24bff..c85c9f88 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,9 +2,9 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 179, + "InternalVersion" : 180, "Name" : "cef4delphi_lazarus.lpk", - "Version" : "85.2.11.0" + "Version" : "85.3.5.0" } ], "UpdatePackageData" : {