1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-08-04 21:32:54 +02:00

MiniBrowser with open file menu option and certificate chain fix

This commit is contained in:
Salvador Diaz Fau
2017-06-13 19:12:40 +02:00
parent 062c045fa2
commit 967b041bb1
13 changed files with 302 additions and 168 deletions

View File

@ -5,7 +5,7 @@
<ProjectVersion>18.0</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Package</AppType>
@ -257,16 +257,7 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceResourceRules"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
@ -580,7 +571,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceResourceRules"/>
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>

View File

@ -1,27 +1,53 @@
[Closed Files]
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFStringMultimap.pas',0,1,58,64,110,0,0,,
File_1=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.pas',0,1,1002,1,1002,0,0,,
File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,465,20,490,0,0,,
File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Handler.pas',0,1,160,19,179,0,0,,
File_4=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLifeSpanHandler.pas',0,1,213,102,238,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRenderHandler.pas',0,1,390,60,415,0,0,,
File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFJsDialogHandler.pas',0,1,182,15,203,0,0,,
File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFKeyboardHandler.pas',0,1,122,99,150,0,0,,
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFContextMenuHandler.pas',0,1,166,71,178,0,0,,
File_9=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFCustomStreamReader.pas',0,1,116,20,135,0,0,,
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,1,1,1,0,0,,
File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,592,72,623,0,0,,
File_2=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.SysUtils.pas',0,1,25193,1,25222,0,0,,
File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFStringMultimap.pas',0,1,58,64,110,0,0,,
File_4=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.pas',0,1,1002,1,1002,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,465,20,490,0,0,,
File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Handler.pas',0,1,160,19,179,0,0,,
File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLifeSpanHandler.pas',0,1,213,102,238,0,0,,
[Modules]
Module0=default.htm
Count=1
Module0=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas
Module1=default.htm
Module2=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509Certificate.pas
Module3=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas
Module4=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas
Count=5
EditWindowCount=1
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[default.htm]
ModuleType=TURLModule
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509Certificate.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[EditWindow0]
ViewCount=1
CurrentView=0
ViewCount=5
CurrentEditView=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas
View0=0
View1=1
View2=2
View3=3
View4=4
PercentageSizes=1
Create=1
Visible=1
@ -41,10 +67,10 @@ TopPanelSize=0
LeftPanelSize=0
RightPanelSize=2000
RightPanelClients=DockSite2
RightPanelData=00000800010000000000201900000000000000D90A00000000000001000000002019000009000000446F636B5369746532FFFFFFFF
RightPanelData=00000800010100000000AA1900000000000001D0070000000000000100000000A123000009000000446F636B5369746532FFFFFFFF
BottomPanelSize=0
BottomPanelClients=DockSite1,MessageView
BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D3B3600000000000002D40E00000000000001000000003B3600000F0000004D65737361676556696577466F726DFFFFFFFF
BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D3B3600000000000002660B000000000000FFFFFFFF
BottomMiddlePanelSize=0
BottomMiddlePanelClients=DockSite0,GraphDrawingModel
BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF
@ -55,6 +81,50 @@ TabDockRightClients=DockSite4=0
CustomEditViewType=TWelcomePageView
WelcomePageURL=bds:/default.htm
[View1]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas
CursorX=74
CursorY=1103
TopLine=1075
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas
[View2]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509Certificate.pas
CursorX=17
CursorY=123
TopLine=115
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509Certificate.pas
[View3]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas
CursorX=1
CursorY=738
TopLine=709
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas
[View4]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas
CursorX=3
CursorY=1545
TopLine=1525
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas
[Watches]
Count=0
@ -135,13 +205,13 @@ Docked=1
State=0
Left=0
Top=23
Width=10000
Height=3666
Width=2773
Height=2758
MaxLeft=-1
MaxTop=-1
ClientWidth=10000
ClientHeight=3666
TBDockHeight=3666
ClientWidth=2773
ClientHeight=2758
TBDockHeight=2758
LRDockWidth=2773
Dockable=1
StayOnTop=0
@ -154,12 +224,12 @@ Docked=1
State=0
Left=0
Top=0
Width=2000
Height=4339
Width=1875
Height=6738
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=4339
ClientWidth=1875
ClientHeight=6738
TBDockHeight=7152
LRDockWidth=2000
Dockable=1
@ -209,8 +279,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=-148
Top=-137
Left=-8
Top=-30
Width=1844
Height=3139
MaxLeft=-1
@ -266,14 +336,14 @@ Create=1
Visible=0
Docked=1
State=0
Left=0
Top=362
Left=78
Top=386
Width=1898
Height=5370
Height=7164
MaxLeft=-1
MaxTop=-1
ClientWidth=1898
ClientHeight=5370
ClientHeight=7164
TBDockHeight=7164
LRDockWidth=1898
Dockable=1
@ -289,11 +359,11 @@ State=0
Left=0
Top=0
Width=2000
Height=6861
Height=6816
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=6861
ClientHeight=6816
TBDockHeight=5964
LRDockWidth=2508
Dockable=1
@ -305,8 +375,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=-898
Top=-137
Left=-946
Top=1
Width=2844
Height=6200
MaxLeft=-1
@ -324,8 +394,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=-1026
Top=-137
Left=-8
Top=287
Width=273
Height=359
MaxLeft=-1
@ -381,6 +451,7 @@ Column0Width=145
Column1Width=100
Column2Width=115
Column3Width=250
Column4Width=250
[LocalVarsWindow]
PercentageSizes=1
@ -429,11 +500,11 @@ State=0
Left=0
Top=0
Width=2336
Height=1177
Height=942
MaxLeft=-1
MaxTop=-1
ClientWidth=2336
ClientHeight=1177
ClientHeight=942
TBDockHeight=2321
LRDockWidth=2820
Dockable=1
@ -494,11 +565,11 @@ State=0
Left=0
Top=0
Width=2000
Height=6861
Height=6816
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=6861
ClientHeight=6816
TBDockHeight=4888
LRDockWidth=7148
Dockable=1
@ -510,8 +581,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=0
Top=0
Left=249
Top=709
Width=2859
Height=3206
MaxLeft=-1
@ -557,12 +628,12 @@ Docked=1
State=0
Left=0
Top=0
Width=1898
Height=9170
Width=1773
Height=6738
MaxLeft=-1
MaxTop=-1
ClientWidth=1898
ClientHeight=9170
ClientWidth=1773
ClientHeight=6738
TBDockHeight=3677
LRDockWidth=1898
Dockable=1
@ -577,11 +648,11 @@ State=0
Left=0
Top=0
Width=2000
Height=6861
Height=6816
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=6861
ClientHeight=6816
TBDockHeight=4888
LRDockWidth=5305
Dockable=1
@ -642,7 +713,7 @@ Visible=0
Docked=1
State=0
Left=0
Top=0
Top=23
Width=3820
Height=1424
MaxLeft=-1
@ -690,13 +761,13 @@ Visible=0
Docked=1
State=0
Left=0
Top=23
Top=0
Width=1898
Height=9170
Height=7164
MaxLeft=-1
MaxTop=-1
ClientWidth=1898
ClientHeight=9170
ClientWidth=1773
ClientHeight=6738
TBDockHeight=7164
LRDockWidth=1898
Dockable=1
@ -714,13 +785,13 @@ Visible=0
Docked=1
State=0
Left=0
Top=454
Top=0
Width=2000
Height=4339
Height=7164
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=4339
ClientWidth=1875
ClientHeight=6738
TBDockHeight=7164
LRDockWidth=2000
Dockable=1

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,9 @@
[Stats]
EditorSecs=107998
EditorSecs=110344
DesignerSecs=97
InspectorSecs=323
CompileSecs=2832127
OtherSecs=11141
CompileSecs=2929512
OtherSecs=11393
StartTime=22/01/2017 10:49:52
RealKeys=0
EffectiveKeys=0

View File

@ -1099,8 +1099,8 @@ type
get_derencoded: function(self: PCefX509Certificate): PCefBinaryValue; stdcall;
get_pemencoded: function(self: PCefX509Certificate): PCefBinaryValue; stdcall;
get_issuer_chain_size: function(self: PCefX509Certificate): NativeUInt; stdcall;
get_derencoded_issuer_chain: procedure(self: PCefX509Certificate; out chainCount: NativeUInt; chain: PPCefBinaryValue); stdcall;
get_pemencoded_issuer_chain: procedure(self: PCefX509Certificate; out chainCount: NativeUInt; chain: PPCefBinaryValue); stdcall;
get_derencoded_issuer_chain: procedure(self: PCefX509Certificate; var chainCount: NativeUInt; chain: PPCefBinaryValue); stdcall;
get_pemencoded_issuer_chain: procedure(self: PCefX509Certificate; var chainCount: NativeUInt; chain: PPCefBinaryValue); stdcall;
end;
// /include/capi/cef_ssl_info_capi.h (cef_sslinfo_t)

View File

@ -48,9 +48,9 @@ interface
uses
{$IFDEF DELPHI16_UP}
System.Classes,
System.Classes, System.SysUtils,
{$ELSE}
Classes,
Classes, SysUtils,
{$ENDIF}
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
@ -119,33 +119,75 @@ end;
function TCEFX509CertificateRef.GetDEREncodedIssuerChain(chainCount: NativeUInt): IInterfaceList;
var
arr: PPCefBinaryValue;
i: Integer;
TempArray : PPCefBinaryValue;
i : NativeUInt;
begin
Result := TInterfaceList.Create;
GetMem(arr, chainCount * SizeOf(Pointer));
Result := nil;
TempArray := nil;
try
PCefX509Certificate(FData).get_derencoded_issuer_chain(FData, chainCount, arr);
for i := 0 to chainCount - 1 do
Result.Add(TCefBinaryValueRef.UnWrap(PPointerArray(arr)[i]));
try
if (chainCount > 0) then
begin
GetMem(TempArray, chainCount * SizeOf(Pointer));
PCefX509Certificate(FData).get_derencoded_issuer_chain(FData, chainCount, TempArray);
if (chainCount > 0) then
begin
i := 0;
Result := TInterfaceList.Create;
while (i < chainCount) do
begin
Result.Add(TCefBinaryValueRef.UnWrap(PPointerArray(TempArray)[i]));
inc(i);
end;
end;
end;
except
on e : exception do
if CustomExceptionHandler('TCEFX509CertificateRef.GetDEREncodedIssuerChain', e) then raise;
end;
finally
FreeMem(arr);
if (TempArray <> nil) then FreeMem(TempArray);
end;
end;
function TCEFX509CertificateRef.GetPEMEncodedIssuerChain(chainCount: NativeUInt): IInterfaceList;
var
arr: PPCefBinaryValue;
i: Integer;
TempArray : PPCefBinaryValue;
i : NativeUInt;
begin
Result := TInterfaceList.Create;
GetMem(arr, chainCount * SizeOf(Pointer));
Result := nil;
TempArray := nil;
try
PCefX509Certificate(FData).get_pemencoded_issuer_chain(FData, chainCount, arr);
for i := 0 to chainCount - 1 do
Result.Add(TCefBinaryValueRef.UnWrap(PPointerArray(arr)[i]));
try
if (chainCount > 0) then
begin
GetMem(TempArray, chainCount * SizeOf(Pointer));
PCefX509Certificate(FData).get_pemencoded_issuer_chain(FData, chainCount, TempArray);
if (chainCount > 0) then
begin
i := 0;
Result := TInterfaceList.Create;
while (i < chainCount) do
begin
Result.Add(TCefBinaryValueRef.UnWrap(PPointerArray(TempArray)[i]));
inc(i);
end;
end;
end;
except
on e : exception do
if CustomExceptionHandler('TCEFX509CertificateRef.GetPEMEncodedIssuerChain', e) then raise;
end;
finally
FreeMem(arr);
if (TempArray <> nil) then FreeMem(TempArray);
end;
end;