1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-02-02 10:25:26 +02:00

Update to CEF 81.3.5

- Added TChromium.IndexOfBrowserID
- Fixed TChromium.GetBrowserById
- Added "Find text..." menu option to the MiniBrowser demo
This commit is contained in:
Salvador Díaz Fau 2020-05-12 11:30:19 +02:00
parent 0befb93f1b
commit dbab922640
15 changed files with 180 additions and 53 deletions

View File

@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 81.3.2 which includes Chromium 81.0.4044.138.
CEF4Delphi uses CEF 81.3.5 which includes Chromium 81.0.4044.138.
The CEF binaries used by CEF4Delphi are available for download at spotify :
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_81.3.2%2Bgb9282cc%2Bchromium-81.0.4044.138_windows32.tar.bz2)
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_81.3.2%2Bgb9282cc%2Bchromium-81.0.4044.138_windows64.tar.bz2)
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_81.3.5%2Bgb547de9%2Bchromium-81.0.4044.138_windows32.tar.bz2)
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_81.3.5%2Bgb547de9%2Bchromium-81.0.4044.138_windows64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 10.3.3 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2 and Lazarus 2.0.8/FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

View File

@ -42,8 +42,8 @@ program MiniBrowser;
uses
{$IFDEF DELPHI16_UP}
Vcl.Forms,
WinApi.Windows,
Vcl.Forms,
{$ELSE}
Forms,
Windows,
@ -51,7 +51,8 @@ uses
uCEFApplication,
uMiniBrowser in 'uMiniBrowser.pas' {MiniBrowserFrm},
uPreferences in 'uPreferences.pas' {PreferencesFrm},
uSimpleTextViewer in 'uSimpleTextViewer.pas' {SimpleTextViewerFrm};
uSimpleTextViewer in 'uSimpleTextViewer.pas' {SimpleTextViewerFrm},
uFindFrm in 'uFindFrm.pas' {FindFrm};
{$R *.res}
@ -69,6 +70,7 @@ begin
Application.CreateForm(TMiniBrowserFrm, MiniBrowserFrm);
Application.CreateForm(TPreferencesFrm, PreferencesFrm);
Application.CreateForm(TSimpleTextViewerFrm, SimpleTextViewerFrm);
Application.CreateForm(TFindFrm, FindFrm);
Application.Run;
end;

View File

@ -146,6 +146,9 @@
<DCCReference Include="uSimpleTextViewer.pas">
<Form>SimpleTextViewerFrm</Form>
</DCCReference>
<DCCReference Include="uFindFrm.pas">
<Form>FindFrm</Form>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
@ -175,7 +178,7 @@
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="MiniBrowser.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="..\..\bin\MiniBrowser.exe" Configuration="Debug" Class="ProjectOutput">
<DeployFile LocalName="..\..\..\bin\MiniBrowser.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>MiniBrowser.exe</RemoteName>
<Overwrite>true</Overwrite>

View File

@ -0,0 +1,71 @@
object FindFrm: TFindFrm
Left = 0
Top = 0
BorderIcons = [biSystemMenu]
BorderStyle = bsToolWindow
Caption = 'Find Text'
ClientHeight = 33
ClientWidth = 554
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Padding.Left = 5
Padding.Top = 5
Padding.Right = 5
Padding.Bottom = 5
OldCreateOrder = False
Position = poScreenCenter
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object FindPrevBtn: TSpeedButton
Left = 503
Top = 5
Width = 23
Height = 23
Align = alRight
Caption = #231
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Wingdings'
Font.Style = []
ParentFont = False
OnClick = FindPrevBtnClick
ExplicitLeft = 536
ExplicitTop = 16
ExplicitHeight = 22
end
object FindNextBtn: TSpeedButton
Left = 526
Top = 5
Width = 23
Height = 23
Align = alRight
Caption = #232
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Wingdings'
Font.Style = []
ParentFont = False
OnClick = FindNextBtnClick
ExplicitLeft = 540
ExplicitTop = 18
ExplicitHeight = 22
end
object FindTextEdt: TEdit
Left = 5
Top = 5
Width = 492
Height = 23
Align = alLeft
TabOrder = 0
OnChange = FindTextEdtChange
ExplicitHeight = 20
end
end

View File

@ -0,0 +1,65 @@
unit uFindFrm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Buttons, Vcl.StdCtrls;
type
TFindFrm = class(TForm)
FindTextEdt: TEdit;
FindPrevBtn: TSpeedButton;
FindNextBtn: TSpeedButton;
procedure FindTextEdtChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FindPrevBtnClick(Sender: TObject);
procedure FindNextBtnClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
FSearchID : integer;
FFirstNext : boolean;
end;
var
FindFrm: TFindFrm;
implementation
{$R *.dfm}
uses
uMiniBrowser;
procedure TFindFrm.FindNextBtnClick(Sender: TObject);
begin
MiniBrowserFrm.Chromium1.Find(FSearchID, FindTextEdt.Text, True, False, FFirstNext);
FFirstNext := True;
end;
procedure TFindFrm.FindPrevBtnClick(Sender: TObject);
begin
MiniBrowserFrm.Chromium1.Find(FSearchID, FindTextEdt.Text, False, False, FFirstNext);
FFirstNext := True;
end;
procedure TFindFrm.FindTextEdtChange(Sender: TObject);
begin
FindPrevBtn.Enabled := (length(FindTextEdt.Text) > 0);
FindNextBtn.Enabled := FindPrevBtn.Enabled;
end;
procedure TFindFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
MiniBrowserFrm.Chromium1.StopFinding(True);
end;
procedure TFindFrm.FormShow(Sender: TObject);
begin
FindTextEdt.Text := '';
FFirstNext := False;
inc(FSearchID);
end;
end.

View File

@ -371,6 +371,10 @@ object MiniBrowserFrm: TMiniBrowserFrm
Caption = 'Flush cookies'
OnClick = Flushcookies1Click
end
object FindText1: TMenuItem
Caption = 'Find text...'
OnClick = FindText1Click
end
object N5: TMenuItem
Caption = '-'
end

View File

@ -129,6 +129,7 @@ type
Simulatekeyboardpresses1: TMenuItem;
Flushcookies1: TMenuItem;
Acceptlanguage1: TMenuItem;
FindText1: TMenuItem;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
@ -191,6 +192,7 @@ type
procedure Acceptlanguage1Click(Sender: TObject);
procedure PopupMenu1Popup(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FindText1Click(Sender: TObject);
protected
FResponse : TStringList;
@ -248,7 +250,7 @@ implementation
uses
uPreferences, uCefStringMultimap, uCEFMiscFunctions, uSimpleTextViewer,
uCEFClient;
uCEFClient, uFindFrm;
// Destruction steps
// =================
@ -966,6 +968,11 @@ begin
ShowStatusText('Zoom : ' + floattostr(aZoomPct) + '%');
end;
procedure TMiniBrowserFrm.FindText1Click(Sender: TObject);
begin
FindFrm.Show;
end;
procedure TMiniBrowserFrm.Flushcookies1Click(Sender: TObject);
begin
if not(Chromium1.FlushCookieStore(False)) then

View File

@ -1191,6 +1191,7 @@
<Platform value="Win32">True</Platform>
<Platform value="Win64">True</Platform>
</Platforms>
<ModelSupport>False</ModelSupport>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>

View File

@ -21,7 +21,7 @@
</CompilerOptions>
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
<License Value="MPL 1.1"/>
<Version Major="81" Minor="3" Release="2"/>
<Version Major="81" Minor="3" Release="5"/>
<Files Count="185">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

View File

@ -1,41 +0,0 @@
LazarusResources.Add('tcefmediaobservercomponent','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#3'NIDATx'#218#236#149
+';H'#155'Q'#20#199'O'#222#205#163'&1'#26'c(D'#173#17#137#165'>'#161'T'#176
+#226#11'\'#138' 8'#22#29#186'uq'#176'K'#199#14'.A'#7'7'#7'A('#182#179#184'd'
+#136'C'#16#130#214#7'!'#193#162#245#17#18'k'#242'Uc'#30#26#147'*1'#233#255'D'
+'#)H;'#20'7'#15#252#248#174#247#158#251'?'#247#156'{r'#21#229'r9'#186'O'#19
+#211'='#219'C'#128#127#154'H,'#190#142'Q'#184#236#162'K/'#1#173#160#19#212#0
+#19#208#222#172'%'#128#0#246#129#11#172#131#211#188#160'HD'#127'|'#239#8'P'
+#138#207#27#240#26#232','#22#139#162#186#186#250'Q:'#157#150#135#195'a)'#251
+'TVVf'#148'J'#229#165#223#239#255#21#8#4'.0'#21#7#11#224#19#132#163#127#11
+#208#14#222#235#245'z'#243#192#192'@E'#127#127#127#153#201'dR'#207#206#206
+#210#198#198#198#237'&'#246'mii'#161#145#145#17#18#4#225#220#225'pD'#230#231
+#231#127#198'b'#177#16#150#237#192']'#240#149#20#6#176'W`'#172#167#167#167'j'
+'rr'#178'app'#176#172#174#174'N'#238'Xt'#147'L]NJ'#149#138#162#17#129'$'#18#9
+'I'#165'R'#138'D"'#148'H$hxxX'#222#222#222#174#235#234#234'2 '#195#12#178'z'
+#6#157#16't'#3#249#0'7'#25'Tbb'#172#179#179#243#137#221'noill'#148#235't:r'
+#185'\'#228#255#17#163#143#31#222#145'g3@'#129#189'-'#4#144#146'X,'#197'WL'
+#161'P'#136#170#170#170#168#169#169#137#204'f'#179#20'Y'#149'mooG'#131#193
+#160#5#154'_'#161#153#228#0#229#248#227'-'#196'_'#142#142#142#214#183#181#181
+'i8h6'#155#165#233#233'i'#138''''#146#228#219#22'h'#127'g'#147#190#249'<'#148
+'L'#158#147'F'#163#165#146#18'='#182'e'#233#236#236#148#186#187#187#243#229
+'+--'#21'WTT'#168'Q6'#17#238'F'#131#185'-'#190'4;j'#174'@'#205#155'a2'#22'f'
+#216#14#14#14#232#234'JB'#201'X'#130#188#222'5'#156'\r'#221'B('#141#197'b'
+#133#184'$'#239#147#201'dn'#219#18#26':'#214#242'z'#189#129'x<n'#231#250#140
+'a'#176#182#176#176#176'|||'#156'`'#231#2'|*'#149'J'#141#147#153'H'#169'T'
+#147'B'#161#204#195'c'#158#227'5'#246')'#222#195#26#172#197#154#172#205#1'"'
+#220'^n'#183'{}ff'#198'S'#236#140#246'D'#6#151#164#213#150#227'd'#29#164#215
+#27#243#160#9#242's'#188#198'>'#197'{X'#131#181'X'#147#181#11#151'|'#142#178
+'D<'#30'O'#153#193'`'#144#217'l63ZQ'#164'B'#231#172#174#174#144'L&'#163#154
+#154#231'd'#179#181'R}}3'#5#131#17#180#231'w'#138#199#5#26#26#26'"'#163#209
+#136'`W'#185#185#185#185#181#137#137#137'e'#140#191'@s'#183#184#139'8'#213'0'
+'D'#15#23#23#23#165'h'#183'S'#180#168#193'j'#181#170#225'L>'#223':'#234'.'
+#208#197'E'#10#223'#'#212#221'G'#209#232'!'#245#245#245'QGG'#7#223#195#241
+#248#248#184'sjj'#202#5#141#207#144#243#222'>'#21#220#215#197#191'<'#216'c~'
+#30'p'#250#23#216'l'#237#237#237#181#226#16#166#221#221']'#237#201#201#137
+#146#29#144'e'#186#182#182'6'#129#172#5#167#211#185#179#180#180#180#147'J'
+#165'Vn'#158#141#179#226#151#225#174#0#5'c'#177#167#160#1#24#1#247#165#234'f'
+'-'#5'b'#224#8'l'#130'='#144'.'#222'|'#27#224#225'?'#218'C'#128#255#182#223#2
+#12#0'+'#130#148'=gv'#220#198#0#0#0#0'IEND'#174'B`'#130
]);

View File

@ -62,7 +62,7 @@ uses
const
CEF_SUPPORTED_VERSION_MAJOR = 81;
CEF_SUPPORTED_VERSION_MINOR = 3;
CEF_SUPPORTED_VERSION_RELEASE = 2;
CEF_SUPPORTED_VERSION_RELEASE = 5;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 81;

View File

@ -604,6 +604,7 @@ type
procedure CloseAllBrowsers;
function TryCloseBrowser : boolean;
function SelectBrowser(aID : integer) : boolean;
function IndexOfBrowserID(aID : integer) : integer;
function ShareRequestContext(var aContext : ICefRequestContext; const aHandler : ICefRequestContextHandler = nil) : boolean;
{$IFDEF MSWINDOWS}
procedure InitializeDragAndDrop(const aDropTargetWnd : HWND);
@ -2380,7 +2381,7 @@ begin
try
FBrowsersCS.Acquire;
if (FBrowsers <> nil) then
Result := FBrowsers.Browser[FBrowserId];
Result := FBrowsers.Browser[aID];
finally
FBrowsersCS.Release;
end;
@ -4772,6 +4773,20 @@ begin
end;
end;
function TChromiumCore.IndexOfBrowserID(aID : integer) : integer;
begin
Result := -1;
try
FBrowsersCS.Acquire;
if (FBrowsers <> nil) then
Result := FBrowsers.SearchBrowser(aID);
finally
FBrowsersCS.Release;
end;
end;
procedure TChromiumCore.SetBrowserIsClosing(aID : integer);
begin
try

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 135,
"InternalVersion" : 136,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "81.3.2.0"
"Version" : "81.3.5.0"
}
],
"UpdatePackageData" : {