diff --git a/source/uCEFApplicationCore.pas b/source/uCEFApplicationCore.pas index 1c4e5dc1..add3669b 100644 --- a/source/uCEFApplicationCore.pas +++ b/source/uCEFApplicationCore.pas @@ -317,7 +317,7 @@ type function CheckCEFLibrary : boolean; procedure RegisterWidevineCDM; {$IFDEF MSWINDOWS} - function FindFlashDLL(var aFileName : string) : boolean; + function FindFlashDLL(var aFileName : ustring) : boolean; {$ENDIF} procedure ShowErrorMessageDlg(const aError : string); virtual; procedure UpdateSupportedSchemes(aIncludeDefaults : boolean = True); virtual; @@ -1355,10 +1355,10 @@ begin end; {$IFDEF MSWINDOWS} -function TCefApplicationCore.FindFlashDLL(var aFileName : string) : boolean; +function TCefApplicationCore.FindFlashDLL(var aFileName : ustring) : boolean; var TempSearchRec : TSearchRec; - TempProductName, TempPath : string; + TempProductName, TempPath : ustring; begin Result := False; aFileName := ''; @@ -1593,7 +1593,7 @@ var i : integer; {$IFDEF MSWINDOWS} TempVersionInfo : TFileVersionInfo; - TempFileName : string; + TempFileName : ustring; {$ENDIF} begin if (commandLine <> nil) and (FProcessType = ptBrowser) and (processType = '') then diff --git a/source/uCEFDomVisitor.pas b/source/uCEFDomVisitor.pas index 9491d1ea..102d15f7 100644 --- a/source/uCEFDomVisitor.pas +++ b/source/uCEFDomVisitor.pas @@ -49,7 +49,7 @@ unit uCEFDomVisitor; interface uses - uCEFBaseRefCounted, uCEFInterfaces; + uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes; type TCefDomVisitorOwn = class(TCefBaseRefCountedOwn, ICefDomVisitor) @@ -83,10 +83,25 @@ type destructor Destroy; override; end; + TCefFastDomVisitor3 = class(TCefDomVisitorOwn) + protected + FProc : TCefDomVisitorProc3; + FBrowser : ICefBrowser; + FFrame : ICefFrame; + FValue : ustring; + + procedure visit(const document: ICefDomDocument); override; + + public + constructor Create(const browser: ICefBrowser; const frame: ICefFrame; const proc: TCefDomVisitorProc3; const aValue : ustring); reintroduce; virtual; + destructor Destroy; override; + end; + + implementation uses - uCEFMiscFunctions, uCEFLibFunctions, uCEFTypes, uCEFDomDocument; + uCEFMiscFunctions, uCEFLibFunctions, uCEFDomDocument; procedure cef_dom_visitor_visite(self: PCefDomVisitor; document: PCefDomDocument); stdcall; var @@ -151,4 +166,30 @@ begin FProc(FBrowser, FFrame, document); end; + +// TCefFastDomVisitor3 + +constructor TCefFastDomVisitor3.Create(const browser: ICefBrowser; const frame: ICefFrame; const proc: TCefDomVisitorProc3; const aValue : ustring); +begin + inherited Create; + + FBrowser := browser; + FFrame := frame; + FProc := proc; + FValue := aValue; +end; + +destructor TCefFastDomVisitor3.Destroy; +begin + FBrowser := nil; + FFrame := nil; + + inherited Destroy; +end; + +procedure TCefFastDomVisitor3.visit(const document: ICefDomDocument); +begin + FProc(FBrowser, FFrame, document, FValue); +end; + end. diff --git a/source/uCEFInterfaces.pas b/source/uCEFInterfaces.pas index 48e0c69c..8daaa81a 100644 --- a/source/uCEFInterfaces.pas +++ b/source/uCEFInterfaces.pas @@ -236,6 +236,7 @@ type TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean); TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument); TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument); + TCefDomVisitorProc3 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument; const aValue : ustring); TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring); TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(selectedAcceptFilter: Integer; const filePaths: TStrings); TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(); diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index 1fda6248..3f88f1bc 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -213,7 +213,7 @@ function CefClearCrossOriginWhitelist: Boolean; procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo); {$IFDEF MSWINDOWS} function GetExtendedFileVersion(const aFileName : ustring) : uint64; -function GetStringFileInfo(const aFileName, aField : string; var aValue : string) : boolean; +function GetStringFileInfo(const aFileName, aField : ustring; var aValue : ustring) : boolean; function GetDLLVersion(const aDLLFile : ustring; var aVersionInfo : TFileVersionInfo) : boolean; procedure OutputLastErrorMessage; {$ENDIF} @@ -1305,7 +1305,7 @@ begin {$ENDIF} end; -function GetStringFileInfo(const aFileName, aField : string; var aValue : string) : boolean; +function GetStringFileInfo(const aFileName, aField : ustring; var aValue : ustring) : boolean; type PLangAndCodepage = ^TLangAndCodepage; TLangAndCodepage = record @@ -1317,7 +1317,7 @@ var TempBuffer : pointer; TempHandle : cardinal; TempPointer : pointer; - TempSubBlock : string; + TempSubBlock : ustring; TempLang : PLangAndCodepage; TempArray : array of TLangAndCodepage; i, j : DWORD; diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index c8963c8e..45b5cf75 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 145, + "InternalVersion" : 146, "Name" : "cef4delphi_lazarus.lpk", "Version" : "83.3.12.0" }