1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-22 22:17:48 +02:00

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

View File

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