Update to CEF 3.3497.1827.ga4f7e36

- Added option to load PDF files in the MiniBrowser demo.
- Now the ResponseFilterBrowser replaces the logo with an external PNG file.
This commit is contained in:
Salvador Díaz Fau 2018-09-07 11:53:31 +02:00
parent e5bb0cd561
commit 7e270aa8ca
9 changed files with 59 additions and 15416 deletions

BIN
bin/jupiter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

View File

@ -49,6 +49,7 @@ uses
Windows, Windows,
{$ENDIF } {$ENDIF }
uCEFApplication, uCEFApplication,
uCEFTypes,
uMiniBrowser in 'uMiniBrowser.pas' {MiniBrowserFrm}, uMiniBrowser in 'uMiniBrowser.pas' {MiniBrowserFrm},
uPreferences in 'uPreferences.pas' {PreferencesFrm}, uPreferences in 'uPreferences.pas' {PreferencesFrm},
uSimpleTextViewer in 'uSimpleTextViewer.pas' {SimpleTextViewerFrm}; uSimpleTextViewer in 'uSimpleTextViewer.pas' {SimpleTextViewerFrm};
@ -72,6 +73,5 @@ begin
Application.Run; Application.Run;
end; end;
GlobalCEFApp.Free; DestroyGlobalCEFApp;
GlobalCEFApp := nil;
end. end.

View File

@ -144,6 +144,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
'https://www.w3schools.com/' 'https://www.w3schools.com/'
'http://webglsamples.org/' 'http://webglsamples.org/'
'https://get.webgl.org/' 'https://get.webgl.org/'
'https://www.briskbard.com'
'https://www.youtube.com' 'https://www.youtube.com'
'https://html5demos.com/drag/' 'https://html5demos.com/drag/'

View File

@ -892,7 +892,7 @@ begin
try try
try try
OpenDialog1.Filter := 'HTML files (*.html)|*.HTML;*.HTM'; OpenDialog1.Filter := 'HTML files (*.html)|*.HTML;*.HTM|PDF files (*.pdf)|*.PDF';
if OpenDialog1.Execute then if OpenDialog1.Execute then
begin begin
@ -900,7 +900,11 @@ begin
TempFile := TMemoryStream.Create; TempFile := TMemoryStream.Create;
TempFile.LoadFromFile(OpenDialog1.FileName); TempFile.LoadFromFile(OpenDialog1.FileName);
TempDATA := 'data:text/html;charset=utf-8;base64,' + CefBase64Encode(TempFile.Memory, TempFile.Size); if (OpenDialog1.FilterIndex = 0) then
TempDATA := 'data:text/html;charset=utf-8;base64,' + CefBase64Encode(TempFile.Memory, TempFile.Size)
else
TempDATA := 'data:application/pdf;charset=utf-8;base64,' + CefBase64Encode(TempFile.Memory, TempFile.Size);
Chromium1.LoadURL(TempDATA); Chromium1.LoadURL(TempDATA);
end; end;
except except

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,6 @@ type
Panel2: TPanel; Panel2: TPanel;
Memo1: TMemo; Memo1: TMemo;
StatusBar1: TStatusBar; StatusBar1: TStatusBar;
Image1: TImage;
CopyScriptBtn: TRadioButton; CopyScriptBtn: TRadioButton;
ReplaceLogoBtn: TRadioButton; ReplaceLogoBtn: TRadioButton;
@ -459,17 +458,28 @@ procedure TResponseFilterBrowserFrm.Chromium1LoadStart( Sender : TO
const browser : ICefBrowser; const browser : ICefBrowser;
const frame : ICefFrame; const frame : ICefFrame;
transitionType : Cardinal); transitionType : Cardinal);
const
IMAGE_FILENAME = 'jupiter.png';
var
TempPath : string;
begin begin
if frame.IsMain then if frame.IsMain then
try try
FStreamCS.Acquire; try
FStream.Clear; FStreamCS.Acquire;
FStream.Clear;
if ReplaceLogoBtn.Checked then TempPath := IncludeTrailingPathDelimiter(ExtractFileDir(GetModuleName(HInstance))) + IMAGE_FILENAME;
begin
Image1.Picture.SavetoStream(FStream); if ReplaceLogoBtn.Checked and FileExists(TempPath) then
FStream.Seek(0, soBeginning); begin
end; FStream.LoadFromFile(TempPath);
FStream.Seek(0, soBeginning);
end;
except
on e : exception do
if CustomExceptionHandler('TResponseFilterBrowserFrm.Chromium1LoadStart', e) then raise;
end;
finally finally
FStreamCS.Release; FStreamCS.Release;
end; end;

View File

@ -4,7 +4,7 @@
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Version Value="10"/> <Version Value="10"/>
<BuildModes Active="Default"/> <BuildModes Active="Default"/>
<Units Count="18"> <Units Count="19">
<Unit0> <Unit0>
<Filename Value="SimpleLazOSRBrowser.lpr"/> <Filename Value="SimpleLazOSRBrowser.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -20,7 +20,6 @@
<ComponentName Value="Form1"/> <ComponentName Value="Form1"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<TopLine Value="186"/> <TopLine Value="186"/>
<CursorPos X="15" Y="191"/> <CursorPos X="15" Y="191"/>
@ -107,10 +106,11 @@
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="..\..\source\uCEFMiscFunctions.pas"/> <Filename Value="..\..\source\uCEFMiscFunctions.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="3"/>
<TopLine Value="1505"/> <TopLine Value="1220"/>
<CursorPos X="51" Y="1534"/> <CursorPos Y="1231"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit11> </Unit11>
<Unit12> <Unit12>
<Filename Value="..\..\source\uCEFConstants.pas"/> <Filename Value="..\..\source\uCEFConstants.pas"/>
@ -156,8 +156,17 @@
<CursorPos X="15" Y="580"/> <CursorPos X="15" Y="580"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit17> </Unit17>
<Unit18>
<Filename Value="..\..\source\uCEFApplication.pas"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="4"/>
<TopLine Value="839"/>
<CursorPos X="58" Y="846"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit18>
</Units> </Units>
<JumpHistory Count="26" HistoryIndex="25"> <JumpHistory Count="28" HistoryIndex="27">
<Position1> <Position1>
<Filename Value="..\..\source\uBufferPanel.pas"/> <Filename Value="..\..\source\uBufferPanel.pas"/>
<Caret Line="163" Column="28" TopLine="43"/> <Caret Line="163" Column="28" TopLine="43"/>
@ -262,6 +271,14 @@
<Filename Value="usimplelazosrbrowser.pas"/> <Filename Value="usimplelazosrbrowser.pas"/>
<Caret Line="201" TopLine="186"/> <Caret Line="201" TopLine="186"/>
</Position26> </Position26>
<Position27>
<Filename Value="usimplelazosrbrowser.pas"/>
<Caret Line="191" Column="15" TopLine="186"/>
</Position27>
<Position28>
<Filename Value="..\..\source\uCEFMiscFunctions.pas"/>
<Caret Line="1231" TopLine="1220"/>
</Position28>
</JumpHistory> </JumpHistory>
</ProjectSession> </ProjectSession>
</CONFIG> </CONFIG>

View File

@ -20,8 +20,8 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="uSimpleLazarusBrowser"/> <UnitName Value="uSimpleLazarusBrowser"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="73"/> <TopLine Value="73"/>
<CursorPos X="53" Y="69"/> <CursorPos X="53" Y="69"/>
<UsageCount Value="38"/> <UsageCount Value="38"/>
@ -138,14 +138,15 @@
</Unit16> </Unit16>
<Unit17> <Unit17>
<Filename Value="..\..\source\uCEFApplication.pas"/> <Filename Value="..\..\source\uCEFApplication.pas"/>
<EditorIndex Value="-1"/> <IsVisibleTab Value="True"/>
<TopLine Value="43"/> <TopLine Value="2169"/>
<CursorPos Y="44"/> <CursorPos Y="44"/>
<UsageCount Value="13"/> <UsageCount Value="13"/>
<Bookmarks Count="2"> <Bookmarks Count="2">
<Item0 X="60" Y="956" ID="1"/> <Item0 X="60" Y="956" ID="1"/>
<Item1 X="9" Y="894" ID="3"/> <Item1 X="9" Y="894" ID="3"/>
</Bookmarks> </Bookmarks>
<Loaded Value="True"/>
</Unit17> </Unit17>
<Unit18> <Unit18>
<Filename Value="C:\lazarus\lcl\forms.pp"/> <Filename Value="C:\lazarus\lcl\forms.pp"/>
@ -264,9 +265,6 @@
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit33> </Unit33>
</Units> </Units>
<General>
<ActiveWindowIndexAtStart Value="-1"/>
</General>
<JumpHistory HistoryIndex="-1"/> <JumpHistory HistoryIndex="-1"/>
</ProjectSession> </ProjectSession>
</CONFIG> </CONFIG>

View File

@ -60,14 +60,14 @@ uses
const const
CEF_SUPPORTED_VERSION_MAJOR = 3; CEF_SUPPORTED_VERSION_MAJOR = 3;
CEF_SUPPORTED_VERSION_MINOR = 3440; CEF_SUPPORTED_VERSION_MINOR = 3497;
CEF_SUPPORTED_VERSION_RELEASE = 1806; CEF_SUPPORTED_VERSION_RELEASE = 1821;
CEF_SUPPORTED_VERSION_BUILD = 0; CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 68; CEF_CHROMEELF_VERSION_MAJOR = 69;
CEF_CHROMEELF_VERSION_MINOR = 0; CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 3440; CEF_CHROMEELF_VERSION_RELEASE = 3497;
CEF_CHROMEELF_VERSION_BUILD = 106; CEF_CHROMEELF_VERSION_BUILD = 81;
LIBCEF_DLL = 'libcef.dll'; LIBCEF_DLL = 'libcef.dll';
CHROMEELF_DLL = 'chrome_elf.dll'; CHROMEELF_DLL = 'chrome_elf.dll';