1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-01-13 10:22:04 +02:00

Update to CEF 3.3202.1677.gd04a869

This commit is contained in:
Salvador Díaz Fau 2017-11-01 09:38:38 +01:00
parent 38098cc91b
commit 8becf848e9
46 changed files with 150 additions and 91 deletions

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -46,7 +46,6 @@ uses
Forms, Windows, Forms, Windows,
{$ENDIF } {$ENDIF }
uCEFApplication, uCEFApplication,
uCEFTypes,
uMainForm in 'uMainForm.pas' {MainForm}, uMainForm in 'uMainForm.pas' {MainForm},
uChildForm in 'uChildForm.pas' {ChildForm}; uChildForm in 'uChildForm.pas' {ChildForm};

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -67,6 +67,8 @@ begin
GlobalCEFApp.FrameworkDirPath := 'cef'; GlobalCEFApp.FrameworkDirPath := 'cef';
GlobalCEFApp.ResourcesDirPath := 'cef'; GlobalCEFApp.ResourcesDirPath := 'cef';
GlobalCEFApp.LocalesDirPath := 'cef\locales'; GlobalCEFApp.LocalesDirPath := 'cef\locales';
GlobalCEFApp.EnableGPU := True; // Enable hardware acceleration
GlobalCEFApp.DisableGPUCache := True; // Disable the creation of a 'GPUCache' directory in the hard drive.
GlobalCEFApp.cache := 'cef\cache'; GlobalCEFApp.cache := 'cef\cache';
GlobalCEFApp.cookies := 'cef\cookies'; GlobalCEFApp.cookies := 'cef\cookies';
GlobalCEFApp.UserDataPath := 'cef\User Data'; GlobalCEFApp.UserDataPath := 'cef\User Data';

Binary file not shown.

View File

@ -139,6 +139,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
'http://html5test.com/' 'http://html5test.com/'
'https://www.w3schools.com/' 'https://www.w3schools.com/'
'http://webglsamples.org/' 'http://webglsamples.org/'
'https://get.webgl.org/'
'https://www.youtube.com' 'https://www.youtube.com'
'https://html5demos.com/drag/' 'https://html5demos.com/drag/'
@ -306,4 +307,11 @@ object MiniBrowserFrm: TMiniBrowserFrm
Left = 32 Left = 32
Top = 280 Top = 280
end end
object Timer1: TTimer
Enabled = False
Interval = 200
OnTimer = Timer1Timer
Left = 32
Top = 344
end
end end

View File

@ -107,6 +107,7 @@ type
N4: TMenuItem; N4: TMenuItem;
Openfile1: TMenuItem; Openfile1: TMenuItem;
Resolvehost1: TMenuItem; Resolvehost1: TMenuItem;
Timer1: TTimer;
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure BackBtnClick(Sender: TObject); procedure BackBtnClick(Sender: TObject);
procedure ForwardBtnClick(Sender: TObject); procedure ForwardBtnClick(Sender: TObject);
@ -163,6 +164,7 @@ type
procedure Resolvehost1Click(Sender: TObject); procedure Resolvehost1Click(Sender: TObject);
procedure Chromium1ResolvedHostAvailable(Sender: TObject; procedure Chromium1ResolvedHostAvailable(Sender: TObject;
result: Integer; const resolvedIps: TStrings); result: Integer; const resolvedIps: TStrings);
procedure Timer1Timer(Sender: TObject);
protected protected
FResponse : string; FResponse : string;
@ -494,7 +496,15 @@ end;
procedure TMiniBrowserFrm.FormShow(Sender: TObject); procedure TMiniBrowserFrm.FormShow(Sender: TObject);
begin begin
Chromium1.CreateBrowser(CEFWindowParent1, ''); // GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
// If it's not initialized yet, we use a simple timer to create the browser later.
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then Timer1.Enabled := True;
end;
procedure TMiniBrowserFrm.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then Timer1.Enabled := True;
end; end;
procedure TMiniBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage); procedure TMiniBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage);

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -63,6 +63,8 @@ begin
GlobalCEFApp.FrameworkDirPath := 'cef'; GlobalCEFApp.FrameworkDirPath := 'cef';
GlobalCEFApp.ResourcesDirPath := 'cef'; GlobalCEFApp.ResourcesDirPath := 'cef';
GlobalCEFApp.LocalesDirPath := 'cef\locales'; GlobalCEFApp.LocalesDirPath := 'cef\locales';
GlobalCEFApp.EnableGPU := True; // Enable hardware acceleration
GlobalCEFApp.DisableGPUCache := True; // Disable the creation of a 'GPUCache' directory in the hard drive.
GlobalCEFApp.cache := 'cef\cache'; GlobalCEFApp.cache := 'cef\cache';
GlobalCEFApp.cookies := 'cef\cookies'; GlobalCEFApp.cookies := 'cef\cookies';
GlobalCEFApp.UserDataPath := 'cef\User Data'; GlobalCEFApp.UserDataPath := 'cef\User Data';

View File

@ -61,4 +61,11 @@ object Form1: TForm1
OnClick = GoBtnClick OnClick = GoBtnClick
end end
end end
object Timer1: TTimer
Enabled = False
Interval = 200
OnTimer = Timer1Timer
Left = 552
Top = 264
end
end end

View File

@ -57,9 +57,11 @@ type
AddressPnl: TPanel; AddressPnl: TPanel;
AddressEdt: TEdit; AddressEdt: TEdit;
GoBtn: TButton; GoBtn: TButton;
Timer1: TTimer;
procedure GoBtnClick(Sender: TObject); procedure GoBtnClick(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure ChromiumWindow1AfterCreated(Sender: TObject); procedure ChromiumWindow1AfterCreated(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private private
// You have to handle this two messages to call NotifyMoveOrResizeStarted or some page elements will be misaligned. // 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; procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
@ -92,7 +94,10 @@ begin
// You *MUST* call CreateBrowser to create and initialize the browser. // You *MUST* call CreateBrowser to create and initialize the browser.
// This will trigger the AfterCreated event when the browser is fully // This will trigger the AfterCreated event when the browser is fully
// initialized and ready to receive commands. // initialized and ready to receive commands.
ChromiumWindow1.CreateBrowser;
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
// If it's not initialized yet, we use a simple timer to create the browser later.
if not(ChromiumWindow1.CreateBrowser) then Timer1.Enabled := True;
end; end;
procedure TForm1.ChromiumWindow1AfterCreated(Sender: TObject); procedure TForm1.ChromiumWindow1AfterCreated(Sender: TObject);
@ -108,6 +113,12 @@ begin
ChromiumWindow1.LoadURL(AddressEdt.Text); ChromiumWindow1.LoadURL(AddressEdt.Text);
end; end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
if not(ChromiumWindow1.CreateBrowser) then Timer1.Enabled := True;
end;
procedure TForm1.WMMove(var aMessage : TWMMove); procedure TForm1.WMMove(var aMessage : TWMMove);
begin begin
inherited; inherited;

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

Binary file not shown.

View File

@ -1,9 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.dcp
del /s /q *.bpl
del /s /q *.bpi
del /s /q *.hpp
del /s /q *.exe del /s /q *.exe
del /s /q *.res
del /s /q *.log del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
@ -14,3 +11,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery

View File

@ -1,4 +1,6 @@
del /s /q *.dcu del /s /q *.dcu
del /s /q *.exe
del /s /q *.log
del /s /q *.dsk del /s /q *.dsk
del /s /q *.identcache del /s /q *.identcache
del /s /q *.stat del /s /q *.stat
@ -8,4 +10,4 @@ rmdir Win32\Debug
rmdir Win32\Release rmdir Win32\Release
rmdir Win32 rmdir Win32
rmdir __history rmdir __history
rmdir __recovery rmdir __recovery

View File

@ -57,7 +57,7 @@ uses
const const
CEF_SUPPORTED_VERSION_MAJOR = 3; CEF_SUPPORTED_VERSION_MAJOR = 3;
CEF_SUPPORTED_VERSION_MINOR = 3202; CEF_SUPPORTED_VERSION_MINOR = 3202;
CEF_SUPPORTED_VERSION_RELEASE = 1674; CEF_SUPPORTED_VERSION_RELEASE = 1677;
CEF_SUPPORTED_VERSION_BUILD = 0; CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 62; CEF_CHROMEELF_VERSION_MAJOR = 62;
@ -122,7 +122,6 @@ type
FEnableHighDPISupport : boolean; FEnableHighDPISupport : boolean;
FMuteAudio : boolean; FMuteAudio : boolean;
FReRaiseExceptions : boolean; FReRaiseExceptions : boolean;
FUpdateChromeVer : boolean;
FShowMessageDlg : boolean; FShowMessageDlg : boolean;
FSetCurrentDir : boolean; FSetCurrentDir : boolean;
FGlobalContextInitialized : boolean; FGlobalContextInitialized : boolean;
@ -135,6 +134,8 @@ type
FAppSettings : TCefSettings; FAppSettings : TCefSettings;
FDeviceScaleFactor : single; FDeviceScaleFactor : single;
FCheckDevToolsResources : boolean; FCheckDevToolsResources : boolean;
FDisableGPUCache : boolean;
FProcessType : TCefProcessType;
// ICefBrowserProcessHandler // ICefBrowserProcessHandler
FOnContextInitializedEvent : TOnContextInitializedEvent; FOnContextInitializedEvent : TOnContextInitializedEvent;
@ -203,9 +204,10 @@ type
procedure DeleteDirContents(const aDirectory : string); procedure DeleteDirContents(const aDirectory : string);
function FindFlashDLL(var aFileName : string) : boolean; function FindFlashDLL(var aFileName : string) : boolean;
procedure ShowErrorMessageDlg(const aError : string); virtual; procedure ShowErrorMessageDlg(const aError : string); virtual;
function ParseProcessType : TCefProcessType;
public public
constructor Create(aUpdateChromeVer : boolean = True); constructor Create;
destructor Destroy; override; destructor Destroy; override;
procedure AfterConstruction; override; procedure AfterConstruction; override;
procedure AddCustomCommandLine(const aCommandLine : string; const aValue : string = ''); procedure AddCustomCommandLine(const aCommandLine : string; const aValue : string = '');
@ -283,8 +285,10 @@ type
property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions; property ReRaiseExceptions : boolean read FReRaiseExceptions write FReRaiseExceptions;
property DeviceScaleFactor : single read FDeviceScaleFactor; property DeviceScaleFactor : single read FDeviceScaleFactor;
property CheckDevToolsResources : boolean read FCheckDevToolsResources write FCheckDevToolsResources; property CheckDevToolsResources : boolean read FCheckDevToolsResources write FCheckDevToolsResources;
property DisableGPUCache : boolean read FDisableGPUCache write FDisableGPUCache;
property LocalesRequired : ustring read FLocalesRequired write FLocalesRequired; property LocalesRequired : ustring read FLocalesRequired write FLocalesRequired;
property CustomFlashPath : ustring read FCustomFlashPath write FCustomFlashPath; property CustomFlashPath : ustring read FCustomFlashPath write FCustomFlashPath;
property ProcessType : TCefProcessType read FProcessType;
property OnContextInitialized : TOnContextInitializedEvent read FOnContextInitializedEvent write FOnContextInitializedEvent; property OnContextInitialized : TOnContextInitializedEvent read FOnContextInitializedEvent write FOnContextInitializedEvent;
property OnBeforeChildProcessLaunch : TOnBeforeChildProcessLaunchEvent read FOnBeforeChildProcessLaunchEvent write FOnBeforeChildProcessLaunchEvent; property OnBeforeChildProcessLaunch : TOnBeforeChildProcessLaunchEvent read FOnBeforeChildProcessLaunchEvent write FOnBeforeChildProcessLaunchEvent;
property OnRenderProcessThreadCreated : TOnRenderProcessThreadCreatedEvent read FOnRenderProcessThreadCreatedEvent write FOnRenderProcessThreadCreatedEvent; property OnRenderProcessThreadCreated : TOnRenderProcessThreadCreatedEvent read FOnRenderProcessThreadCreatedEvent write FOnRenderProcessThreadCreatedEvent;
@ -346,7 +350,7 @@ uses
uCEFLibFunctions, uCEFMiscFunctions, uCEFCommandLine, uCEFConstants, uCEFLibFunctions, uCEFMiscFunctions, uCEFCommandLine, uCEFConstants,
uCEFSchemeHandlerFactory, uCEFCookieManager; uCEFSchemeHandlerFactory, uCEFCookieManager;
constructor TCefApplication.Create(aUpdateChromeVer : boolean); constructor TCefApplication.Create;
begin begin
inherited Create; inherited Create;
@ -406,9 +410,10 @@ begin
FShowMessageDlg := True; FShowMessageDlg := True;
FSetCurrentDir := False; FSetCurrentDir := False;
FGlobalContextInitialized := False; FGlobalContextInitialized := False;
FUpdateChromeVer := aUpdateChromeVer;
FCheckDevToolsResources := True; FCheckDevToolsResources := True;
FDisableGPUCache := False;
FLocalesRequired := ''; FLocalesRequired := '';
FProcessType := ParseProcessType;
// ICefBrowserProcessHandler // ICefBrowserProcessHandler
FOnContextInitializedEvent := nil; FOnContextInitializedEvent := nil;
@ -426,7 +431,7 @@ begin
FChromeVersionInfo.Release := CEF_CHROMEELF_VERSION_RELEASE; FChromeVersionInfo.Release := CEF_CHROMEELF_VERSION_RELEASE;
FChromeVersionInfo.Build := CEF_CHROMEELF_VERSION_BUILD; FChromeVersionInfo.Build := CEF_CHROMEELF_VERSION_BUILD;
if FUpdateChromeVer then GetDLLVersion(ChromeElfPath, FChromeVersionInfo); if (FProcessType = ptBrowser) then GetDLLVersion(ChromeElfPath, FChromeVersionInfo);
IsMultiThread := True; IsMultiThread := True;
@ -537,7 +542,7 @@ begin
else else
FFrameworkDirPath := ''; FFrameworkDirPath := '';
if FUpdateChromeVer then GetDLLVersion(ChromeElfPath, FChromeVersionInfo); if (FProcessType = ptBrowser) then GetDLLVersion(ChromeElfPath, FChromeVersionInfo);
end; end;
procedure TCefApplication.SetResourcesDirPath(const aValue : ustring); procedure TCefApplication.SetResourcesDirPath(const aValue : ustring);
@ -733,6 +738,8 @@ begin
end; end;
function TCefApplication.InitializeLibrary(const aApp : ICefApp) : boolean; function TCefApplication.InitializeLibrary(const aApp : ICefApp) : boolean;
var
TempArgs : TCefMainArgs;
begin begin
Result := False; Result := False;
@ -742,7 +749,8 @@ begin
InitializeSettings(FAppSettings); InitializeSettings(FAppSettings);
Result := (cef_initialize(@HInstance, @FAppSettings, aApp.Wrap, FWindowsSandboxInfo) <> 0); TempArgs.instance := HINSTANCE;
Result := (cef_initialize(@TempArgs, @FAppSettings, aApp.Wrap, FWindowsSandboxInfo) <> 0);
except except
on e : exception do on e : exception do
if CustomExceptionHandler('TCefApplication.InitializeLibrary', e) then raise; if CustomExceptionHandler('TCefApplication.InitializeLibrary', e) then raise;
@ -851,6 +859,40 @@ begin
if FShowMessageDlg then MessageDlg(aError, mtError, [mbOk], 0); if FShowMessageDlg then MessageDlg(aError, mtError, [mbOk], 0);
end; end;
function TCefApplication.ParseProcessType : TCefProcessType;
const
TYPE_PARAMETER_NAME = '--type=';
TYPE_RENDERER_VALUE = 'renderer';
TYPE_ZYGOTE_VALUE = 'zygote';
var
i, TempLen : integer;
TempName, TempValue : string;
begin
Result := ptBrowser;
i := pred(paramCount);
TempLen := length(TYPE_PARAMETER_NAME);
while (i >= 0) and (Result = ptBrowser) do
begin
TempName := copy(paramstr(i), 1, TempLen);
if (CompareText(TempName, TYPE_PARAMETER_NAME) = 0) then
begin
TempValue := copy(paramstr(i), succ(TempLen), length(paramstr(i)));
if (CompareText(TempValue, TYPE_RENDERER_VALUE) = 0) then
Result := ptRenderer
else
if (CompareText(TempValue, TYPE_ZYGOTE_VALUE) = 0) then
Result := ptZygote
else
Result := ptOther;
end;
dec(i);
end;
end;
procedure TCefApplication.Internal_OnContextInitialized; procedure TCefApplication.Internal_OnContextInitialized;
begin begin
InitializeCookies; InitializeCookies;
@ -917,6 +959,9 @@ begin
if FFastUnload then if FFastUnload then
commandLine.AppendSwitch('--enable-fast-unload'); commandLine.AppendSwitch('--enable-fast-unload');
if FDisableGPUCache then
commandLine.AppendSwitch('--disable-gpu-shader-disk-cache');
if FDisableSafeBrowsing then if FDisableSafeBrowsing then
begin begin
commandLine.AppendSwitch('--disable-client-side-phishing-detection'); commandLine.AppendSwitch('--disable-client-side-phishing-detection');

View File

@ -749,7 +749,7 @@ begin
FileExists(TempDir + 'cef_100_percent.pak') and FileExists(TempDir + 'cef_100_percent.pak') and
FileExists(TempDir + 'cef_200_percent.pak') and FileExists(TempDir + 'cef_200_percent.pak') and
FileExists(TempDir + 'cef_extensions.pak') and FileExists(TempDir + 'cef_extensions.pak') and
(not aCheckDevResources or FileExists(TempDir + 'devtools_resources.pak')); (not(aCheckDevResources) or FileExists(TempDir + 'devtools_resources.pak'));
except except
on e : exception do on e : exception do
if CustomExceptionHandler('CheckResources', e) then raise; if CustomExceptionHandler('CheckResources', e) then raise;
@ -765,14 +765,16 @@ begin
try try
// The icudtl.dat file must be placed next to libcef.dll // The icudtl.dat file must be placed next to libcef.dll
// http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=14503#p32263 // http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=14503#p32263
Result := GetAbsoluteDirPath(aFrameworkDirPath, TempDir) and Result := GetAbsoluteDirPath(aFrameworkDirPath, TempDir) and
FileExists(TempDir + CHROMEELF_DLL) and FileExists(TempDir + CHROMEELF_DLL) and
FileExists(TempDir + LIBCEF_DLL) and FileExists(TempDir + LIBCEF_DLL) and
FileExists(TempDir + 'd3dcompiler_43.dll') and FileExists(TempDir + 'd3dcompiler_43.dll') and
FileExists(TempDir + 'd3dcompiler_47.dll') and FileExists(TempDir + 'd3dcompiler_47.dll') and
FileExists(TempDir + 'libEGL.dll') and FileExists(TempDir + 'libEGL.dll') and
FileExists(TempDir + 'libGLESv2.dll') and FileExists(TempDir + 'libGLESv2.dll') and
FileExists(TempDir + 'icudtl.dat') and FileExists(TempDir + 'swiftshader\libEGL.dll') and
FileExists(TempDir + 'swiftshader\libGLESv2.dll') and
FileExists(TempDir + 'icudtl.dat') and
FileExists(TempDir + 'widevinecdmadapter.dll'); FileExists(TempDir + 'widevinecdmadapter.dll');
except except
on e : exception do on e : exception do

View File

@ -278,10 +278,6 @@ type
TCefString = TCefStringUtf16; TCefString = TCefStringUtf16;
PCefString = PCefStringUtf16; PCefString = PCefStringUtf16;
TCefMainArgs = record
instance: HINST;
end;
TFileVersionInfo = record TFileVersionInfo = record
MajorVer : uint16; MajorVer : uint16;
MinorVer : uint16; MinorVer : uint16;
@ -289,6 +285,13 @@ type
Build : uint16; Build : uint16;
end; end;
TCefProcessType = (ptBrowser, ptRenderer, ptZygote, ptOther);
// /include/internal/cef_types_win.h (cef_main_args_t)
TCefMainArgs = record
instance: HINST;
end;
// /include/internal/cef_types.h (cef_rect_t) // /include/internal/cef_types.h (cef_rect_t)
TCefRect = record TCefRect = record
x: Integer; x: Integer;
@ -968,7 +971,7 @@ type
accept_language_list : TCefString; accept_language_list : TCefString;
end; end;
// /include/internal/cef_win.h (cef_window_info_t) // /include/internal/cef_types_win.h (cef_window_info_t)
TCefWindowInfo = record TCefWindowInfo = record
ex_style: DWORD; ex_style: DWORD;
window_name: TCefString; window_name: TCefString;

View File

@ -106,7 +106,7 @@ begin
hdwp := BeginDeferWindowPos(1); hdwp := BeginDeferWindowPos(1);
try try
hdwp := DeferWindowPos(hdwp, TempHandle, 0, hdwp := DeferWindowPos(hdwp, TempHandle, HWND_TOP,
TempRect.left, TempRect.top, TempRect.right - TempRect.left, TempRect.bottom - TempRect.top, TempRect.left, TempRect.top, TempRect.right - TempRect.left, TempRect.bottom - TempRect.top,
SWP_NOZORDER); SWP_NOZORDER);
finally finally