You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-09-30 21:28:55 +02:00
Update to CEF 80.1.2
- Added TCEFMediaObserverComponent - Removed TBufferPanel.OnWrongSize - Removed TFMXBufferPanel.OnWrongSize
This commit is contained in:
@@ -103,7 +103,6 @@ object FMXExternalPumpBrowserFrm: TFMXExternalPumpBrowserFrm
|
||||
OnMouseWheel = Panel1MouseWheel
|
||||
OnKeyUp = Panel1KeyUp
|
||||
OnKeyDown = Panel1KeyDown
|
||||
OnWrongSize = Panel1WrongSize
|
||||
end
|
||||
object chrmosr: TFMXChromium
|
||||
OnTooltip = chrmosrTooltip
|
||||
|
@@ -80,7 +80,6 @@ type
|
||||
procedure Panel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
||||
procedure Panel1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
||||
procedure Panel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
||||
procedure Panel1WrongSize(Sender: TObject);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
@@ -130,7 +129,7 @@ type
|
||||
function GetMousePosition(var aPoint : TPointF) : boolean;
|
||||
procedure InitializeLastClick;
|
||||
function CancelPreviousClick(const x, y : single; var aCurrentTime : integer) : boolean;
|
||||
function SendCompMessage(aMsg : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function SendCompMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
function ArePointerEventsSupported : boolean;
|
||||
function HandlePenEvent(const aID : uint32; aMsg : cardinal) : boolean;
|
||||
function HandleTouchEvent(const aID : uint32; aMsg : cardinal) : boolean; overload;
|
||||
@@ -527,11 +526,6 @@ begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TFMXExternalPumpBrowserFrm.Panel1WrongSize(Sender: TObject);
|
||||
begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TFMXExternalPumpBrowserFrm.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
Timer1.Enabled := False;
|
||||
@@ -1148,7 +1142,7 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TFMXExternalPumpBrowserFrm.SendCompMessage(aMsg, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TFMXExternalPumpBrowserFrm.SendCompMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
{$IFDEF MSWINDOWS}
|
||||
var
|
||||
TempHandle : TWinWindowHandle;
|
||||
@@ -1156,7 +1150,7 @@ var
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
TempHandle := WindowHandleToPlatform(Handle);
|
||||
Result := WinApi.Windows.PostMessage(TempHandle.Wnd, aMsg, wParam, lParam);
|
||||
Result := WinApi.Windows.PostMessage(TempHandle.Wnd, aMsg, aWParam, aLParam);
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
|
@@ -109,7 +109,7 @@ type
|
||||
|
||||
property NextTabID : cardinal read GetNextTabID;
|
||||
public
|
||||
function PostCustomMessage(aMessage : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
procedure NotifyMoveOrResizeStarted;
|
||||
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
|
||||
end;
|
||||
@@ -452,7 +452,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMainForm.PostCustomMessage(aMessage, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TMainForm.PostCustomMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
{$IFDEF MSWINDOWS}
|
||||
var
|
||||
TempHWND : HWND;
|
||||
@@ -460,7 +460,7 @@ var
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
TempHWND := FmxHandleToHWND(Handle);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMessage, wParam, lParam);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMsg, aWParam, aLParam);
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
|
@@ -127,7 +127,6 @@ object BrowserFrame: TBrowserFrame
|
||||
OnMouseWheel = FMXBufferPanel1MouseWheel
|
||||
OnKeyUp = FMXBufferPanel1KeyUp
|
||||
OnKeyDown = FMXBufferPanel1KeyDown
|
||||
OnWrongSize = FMXBufferPanel1WrongSize
|
||||
end
|
||||
object FMXChromium1: TFMXChromium
|
||||
OnLoadError = FMXChromium1LoadError
|
||||
|
@@ -75,7 +75,6 @@ type
|
||||
procedure FMXBufferPanel1Enter(Sender: TObject);
|
||||
procedure FMXBufferPanel1Exit(Sender: TObject);
|
||||
procedure FMXBufferPanel1Resize(Sender: TObject);
|
||||
procedure FMXBufferPanel1WrongSize(Sender: TObject);
|
||||
procedure FMXBufferPanel1Click(Sender: TObject);
|
||||
procedure FMXBufferPanel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
|
||||
procedure FMXBufferPanel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
|
||||
@@ -518,11 +517,6 @@ begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.FMXBufferPanel1WrongSize(Sender: TObject);
|
||||
begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.FMXChromium1AddressChange(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
|
||||
begin
|
||||
|
@@ -101,7 +101,7 @@ type
|
||||
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
||||
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
||||
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||
function PostCustomMessage(aMessage : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
procedure NotifyMoveOrResizeStarted;
|
||||
function GetMousePosition(var aPoint : TPointF) : boolean;
|
||||
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
|
||||
@@ -346,12 +346,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMainForm.PostCustomMessage(aMessage, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TMainForm.PostCustomMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
var
|
||||
TempHWND : HWND;
|
||||
begin
|
||||
TempHWND := FmxHandleToHWND(Handle);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMessage, wParam, lParam);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMsg, aWParam, aLParam);
|
||||
end;
|
||||
|
||||
procedure TMainForm.BrowserTabCtrlChange(Sender: TObject);
|
||||
|
@@ -83,7 +83,7 @@ type
|
||||
procedure ResizeChild;
|
||||
procedure CreateFMXWindowParent;
|
||||
function GetFMXWindowParentRect : System.Types.TRect;
|
||||
function PostCustomMessage(aMessage : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
procedure NotifyMoveOrResizeStarted;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
@@ -119,7 +119,7 @@ uses
|
||||
// 3. TFMXChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||
|
||||
|
||||
function TChildForm.PostCustomMessage(aMessage, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TChildForm.PostCustomMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
{$IFDEF MSWINDOWS}
|
||||
var
|
||||
TempHWND : HWND;
|
||||
@@ -131,7 +131,7 @@ begin
|
||||
if (Handle <> nil) then
|
||||
begin
|
||||
TempHWND := FmxHandleToHWND(Handle);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMessage, wParam, lParam);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMsg, aWParam, aLParam);
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
@@ -74,7 +74,7 @@ type
|
||||
|
||||
procedure CreateToolboxChild(const ChildCaption, URL: string);
|
||||
procedure CloseAllChildForms;
|
||||
function PostCustomMessage(aMessage : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
|
||||
protected
|
||||
{$IFDEF MSWINDOWS}
|
||||
@@ -148,7 +148,7 @@ begin
|
||||
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
|
||||
end;
|
||||
|
||||
function TMainForm.PostCustomMessage(aMessage, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TMainForm.PostCustomMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
{$IFDEF MSWINDOWS}
|
||||
var
|
||||
TempHWND : HWND;
|
||||
@@ -160,7 +160,7 @@ begin
|
||||
if (Handle <> nil) then
|
||||
begin
|
||||
TempHWND := FmxHandleToHWND(Handle);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMessage, wParam, lParam);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMsg, aWParam, aLParam);
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
@@ -102,7 +102,7 @@ type
|
||||
procedure ResizeChild;
|
||||
procedure CreateFMXWindowParent;
|
||||
function GetFMXWindowParentRect : System.Types.TRect;
|
||||
function PostCustomMessage(aMessage : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
function GetCurrentWindowState : TWindowState;
|
||||
@@ -235,7 +235,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSimpleFMXBrowserFrm.PostCustomMessage(aMessage, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TSimpleFMXBrowserFrm.PostCustomMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
{$IFDEF MSWINDOWS}
|
||||
var
|
||||
TempHWND : HWND;
|
||||
@@ -243,7 +243,7 @@ var
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
TempHWND := FmxHandleToHWND(Handle);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMessage, wParam, lParam);
|
||||
Result := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMsg, aWParam, aLParam);
|
||||
{$ELSE}
|
||||
Result := False;
|
||||
{$ENDIF}
|
||||
|
@@ -335,7 +335,7 @@ end;
|
||||
procedure TCookieVisitorFrm.Chromium1CookieSet(Sender: TObject;
|
||||
aSuccess: Boolean; aID: Integer);
|
||||
begin
|
||||
PostMessage(Handle, MINIBROWSER_COOKIESET, ord(aSuccess), aID);
|
||||
PostMessage(Handle, MINIBROWSER_COOKIESET, WPARAM(aSuccess), aID);
|
||||
end;
|
||||
|
||||
procedure TCookieVisitorFrm.Chromium1CookiesVisited(Sender: TObject;
|
||||
|
@@ -31,7 +31,6 @@ object Form1: TForm1
|
||||
OnPointerDown = Panel1PointerDown
|
||||
OnPointerUp = Panel1PointerUp
|
||||
OnPointerUpdate = Panel1PointerUpdate
|
||||
OnWrongSize = Panel1WrongSize
|
||||
Align = alClient
|
||||
Caption = 'Panel1'
|
||||
TabOrder = 0
|
||||
|
@@ -89,7 +89,6 @@ type
|
||||
procedure Panel1PointerDown(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean);
|
||||
procedure Panel1PointerUp(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean);
|
||||
procedure Panel1PointerUpdate(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean);
|
||||
procedure Panel1WrongSize(Sender: TObject);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
@@ -939,11 +938,6 @@ begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TForm1.Panel1WrongSize(Sender: TObject);
|
||||
begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TForm1.PendingResizeMsg(var aMessage : TMessage);
|
||||
begin
|
||||
DoResize;
|
||||
|
@@ -824,12 +824,12 @@ end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1PdfPrintFinished(Sender: TObject; aResultOK: Boolean);
|
||||
begin
|
||||
PostMessage(Handle, MINIBROWSER_PDFPRINT_END, 0, ord(aResultOK));
|
||||
PostMessage(Handle, MINIBROWSER_PDFPRINT_END, 0, LPARAM(aResultOK));
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1PrefsAvailable(Sender: TObject; aResultOK: Boolean);
|
||||
begin
|
||||
PostMessage(Handle, MINIBROWSER_PREFS_AVLBL, 0, ord(aResultOK));
|
||||
PostMessage(Handle, MINIBROWSER_PREFS_AVLBL, 0, LPARAM(aResultOK));
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1PreKeyEvent(Sender: TObject;
|
||||
|
@@ -114,7 +114,6 @@ object Form1: TForm1
|
||||
OnPointerUp = Panel1PointerUp
|
||||
OnPointerUpdate = Panel1PointerUpdate
|
||||
OnPaintParentBkg = Panel1PaintParentBkg
|
||||
OnWrongSize = Panel1WrongSize
|
||||
Align = alClient
|
||||
Ctl3D = False
|
||||
ParentCtl3D = False
|
||||
|
@@ -92,7 +92,6 @@ type
|
||||
procedure Panel1PointerDown(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean);
|
||||
procedure Panel1PointerUp(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean);
|
||||
procedure Panel1PointerUpdate(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean);
|
||||
procedure Panel1WrongSize(Sender: TObject);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
@@ -182,8 +181,45 @@ uses
|
||||
{$ENDIF}
|
||||
uCEFMiscFunctions, uCEFApplication;
|
||||
|
||||
// Chromium renders the web contents asynchronously. It uses multiple processes
|
||||
// and threads which makes it complicated to keep the correct browser size.
|
||||
|
||||
// In one hand you have the main application thread where the form is resized by
|
||||
// the user. On the other hand, Chromium renders the contents asynchronously
|
||||
// with the last browser size available, which may have changed by the time
|
||||
// Chromium renders the page.
|
||||
|
||||
// For this reason we need to keep checking the real size and call
|
||||
// TChromium.WasResized when we detect that Chromium has an incorrect size.
|
||||
|
||||
// TChromium.WasResized triggers the TChromium.OnGetViewRect event to let CEF
|
||||
// read the current browser size and then it triggers TChromium.OnPaint when the
|
||||
// contents are finally rendered.
|
||||
|
||||
// TChromium.WasResized --> (time passes) --> TChromium.OnGetViewRect --> (time passes) --> TChromium.OnPaint
|
||||
|
||||
// You have to assume that the real browser size can change between those calls
|
||||
// and events.
|
||||
|
||||
// This demo uses a couple of fields called "FResizing" and "FPendingResize" to
|
||||
// reduce the number of TChromium.WasResized calls.
|
||||
|
||||
// FResizing is set to True before the TChromium.WasResized call and it's set to
|
||||
// False at the end of the TChromium.OnPaint event.
|
||||
|
||||
// FPendingResize is set to True when the browser changed its size while
|
||||
// FResizing was True. The FPendingResize value is checked at the end of
|
||||
// TChromium.OnPaint to check the browser size again because it changed while
|
||||
// Chromium was rendering the page.
|
||||
|
||||
// The TChromium.OnPaint event in the demo also calls
|
||||
// TBufferPanel.UpdateBufferDimensions and TBufferPanel.BufferIsResized to check
|
||||
// the width and height of the buffer parameter, and the internal buffer size in
|
||||
// the TBufferPanel component.
|
||||
|
||||
// This is the destruction sequence in OSR mode :
|
||||
// 1- FormCloseQuery sets CanClose to the initial FCanClose value (False) and calls chrmosr.CloseBrowser(True).
|
||||
// 1- FormCloseQuery sets CanClose to the initial FCanClose value (False) and
|
||||
// calls chrmosr.CloseBrowser(True).
|
||||
// 2- chrmosr.CloseBrowser(True) will trigger chrmosr.OnClose and we have to
|
||||
// set "Result" to false and CEF will destroy the internal browser immediately.
|
||||
// 3- chrmosr.OnBeforeClose is triggered because the internal browser was destroyed.
|
||||
@@ -1114,11 +1150,6 @@ begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TForm1.Panel1WrongSize(Sender: TObject);
|
||||
begin
|
||||
DoResize;
|
||||
end;
|
||||
|
||||
procedure TForm1.PendingResizeMsg(var aMessage : TMessage);
|
||||
begin
|
||||
DoResize;
|
||||
|
@@ -103,6 +103,8 @@ type
|
||||
procedure NotifyMoveOrResizeStarted;
|
||||
procedure CreateBrowser;
|
||||
procedure CloseBrowser;
|
||||
procedure ShowBrowser;
|
||||
procedure HideBrowser;
|
||||
|
||||
property Closing : boolean read FClosing;
|
||||
property Homepage : string read FHomepage write FHomepage;
|
||||
@@ -155,6 +157,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.ShowBrowser;
|
||||
begin
|
||||
Chromium1.WasHidden(False);
|
||||
Chromium1.SendFocusEvent(True);
|
||||
Chromium1.AudioMuted := False;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.HideBrowser;
|
||||
begin
|
||||
Chromium1.SendFocusEvent(False);
|
||||
Chromium1.WasHidden(True);
|
||||
Chromium1.AudioMuted := True;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.ForwardBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.GoForward;
|
||||
|
@@ -59,7 +59,7 @@ type
|
||||
|
||||
function GetParentForm : TCustomForm;
|
||||
|
||||
function PostFormMessage(aMsg : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostFormMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
|
||||
procedure BrowserFrame_OnBrowserDestroyed(Sender: TObject);
|
||||
procedure BrowserFrame_OnBrowserTitleChange(Sender: TObject; const aTitle : string);
|
||||
@@ -71,6 +71,8 @@ type
|
||||
procedure NotifyMoveOrResizeStarted;
|
||||
procedure CreateBrowser(const aHomepage : string);
|
||||
procedure CloseBrowser;
|
||||
procedure ShowBrowser;
|
||||
procedure HideBrowser;
|
||||
|
||||
property TabID : cardinal read FTabID;
|
||||
end;
|
||||
@@ -104,14 +106,14 @@ begin
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TBrowserTab.PostFormMessage(aMsg, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TBrowserTab.PostFormMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
var
|
||||
TempForm : TCustomForm;
|
||||
begin
|
||||
TempForm := ParentForm;
|
||||
Result := (TempForm <> nil) and
|
||||
TempForm.HandleAllocated and
|
||||
PostMessage(TempForm.Handle, aMsg, wParam, lParam);
|
||||
PostMessage(TempForm.Handle, aMsg, aWParam, aLParam);
|
||||
end;
|
||||
|
||||
procedure TBrowserTab.NotifyMoveOrResizeStarted;
|
||||
@@ -137,6 +139,16 @@ begin
|
||||
if (FBrowserFrame <> nil) then FBrowserFrame.CloseBrowser;
|
||||
end;
|
||||
|
||||
procedure TBrowserTab.ShowBrowser;
|
||||
begin
|
||||
if (FBrowserFrame <> nil) then FBrowserFrame.ShowBrowser;
|
||||
end;
|
||||
|
||||
procedure TBrowserTab.HideBrowser;
|
||||
begin
|
||||
if (FBrowserFrame <> nil) then FBrowserFrame.HideBrowser;
|
||||
end;
|
||||
|
||||
procedure TBrowserTab.BrowserFrame_OnBrowserDestroyed(Sender: TObject);
|
||||
begin
|
||||
// This event is executed in a CEF thread so we have to send a message to
|
||||
|
@@ -253,7 +253,7 @@ end;
|
||||
procedure TCookieVisitorFrm.Chromium1CookieSet(Sender: TObject;
|
||||
aSuccess: boolean; aID: integer);
|
||||
begin
|
||||
PostMessage(Handle, MINIBROWSER_COOKIESET, ord(aSuccess), aID);
|
||||
PostMessage(Handle, MINIBROWSER_COOKIESET, WPARAM(aSuccess), aID);
|
||||
end;
|
||||
|
||||
procedure TCookieVisitorFrm.Chromium1CookiesVisited(Sender: TObject;
|
||||
|
@@ -836,12 +836,12 @@ end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1PdfPrintFinished(Sender: TObject; aResultOK: Boolean);
|
||||
begin
|
||||
PostMessage(Handle, MINIBROWSER_PDFPRINT_END, 0, ord(aResultOK));
|
||||
PostMessage(Handle, MINIBROWSER_PDFPRINT_END, 0, LPARAM(aResultOK));
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1PrefsAvailable(Sender: TObject; aResultOK: Boolean);
|
||||
begin
|
||||
PostMessage(Handle, MINIBROWSER_PREFS_AVLBL, 0, ord(aResultOK));
|
||||
PostMessage(Handle, MINIBROWSER_PREFS_AVLBL, 0, LPARAM(aResultOK));
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1PreKeyEvent(Sender: TObject;
|
||||
|
@@ -4,13 +4,13 @@
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="6">
|
||||
<Units Count="10">
|
||||
<Unit0>
|
||||
<Filename Value="OSRExternalPumpBrowser.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<TopLine Value="41"/>
|
||||
<CursorPos X="63" Y="61"/>
|
||||
<UsageCount Value="26"/>
|
||||
<UsageCount Value="27"/>
|
||||
<Loaded Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit0>
|
||||
@@ -22,9 +22,9 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="456"/>
|
||||
<CursorPos X="19" Y="488"/>
|
||||
<UsageCount Value="26"/>
|
||||
<TopLine Value="31"/>
|
||||
<CursorPos X="117" Y="38"/>
|
||||
<UsageCount Value="27"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
@@ -58,127 +58,153 @@
|
||||
<CursorPos Y="5683"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="..\..\..\source\uCEFMediaObserver.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="266"/>
|
||||
<CursorPos X="13" Y="86"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="..\..\..\source\uCEFLinkedWindowParent.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="61"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="..\..\..\source\uCEFChromiumCore.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="904"/>
|
||||
<CursorPos Y="925"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="..\..\..\source\uCEFMediaObserverComponent.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="115"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit9>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="271" TopLine="270"/>
|
||||
<Caret Line="286" Column="70" TopLine="270"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="286" Column="70" TopLine="270"/>
|
||||
<Caret Line="307" Column="11" TopLine="295"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="307" Column="11" TopLine="295"/>
|
||||
<Caret Line="322" TopLine="313"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="322" TopLine="313"/>
|
||||
<Caret Line="503" Column="53" TopLine="488"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="503" Column="53" TopLine="488"/>
|
||||
<Caret Line="92" Column="27" TopLine="92"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="92" Column="27" TopLine="92"/>
|
||||
<Caret Line="503" Column="11" TopLine="499"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="503" Column="11" TopLine="499"/>
|
||||
<Caret Line="201" Column="11" TopLine="166"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="201" Column="11" TopLine="166"/>
|
||||
<Caret Line="982" Column="68" TopLine="963"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="982" Column="68" TopLine="963"/>
|
||||
<Caret Line="307" Column="39" TopLine="301"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="307" Column="39" TopLine="301"/>
|
||||
<Caret Line="82" Column="44" TopLine="77"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="82" Column="44" TopLine="77"/>
|
||||
<Caret Line="957" TopLine="939"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="957" TopLine="939"/>
|
||||
<Caret Line="958" TopLine="939"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="958" TopLine="939"/>
|
||||
<Caret Line="957" TopLine="939"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="957" TopLine="939"/>
|
||||
<Caret Line="958" TopLine="939"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="958" TopLine="939"/>
|
||||
<Caret Line="960" TopLine="939"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="960" TopLine="939"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="OSRExternalPumpBrowser.lpr"/>
|
||||
<Caret Line="61" Column="63" TopLine="41"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="169" Column="11" TopLine="153"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="169" Column="11" TopLine="153"/>
|
||||
<Caret Line="198" TopLine="176"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="198" TopLine="176"/>
|
||||
<Caret Line="170" Column="82" TopLine="148"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="170" Column="82" TopLine="148"/>
|
||||
<Caret Line="217" Column="51" TopLine="196"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="217" Column="51" TopLine="196"/>
|
||||
<Caret Line="105" Column="30" TopLine="71"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="105" Column="30" TopLine="71"/>
|
||||
<Caret Line="282" TopLine="278"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="282" TopLine="278"/>
|
||||
<Caret Line="945" Column="91" TopLine="926"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="945" Column="91" TopLine="926"/>
|
||||
<Caret Line="944" Column="91" TopLine="925"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="944" Column="91" TopLine="925"/>
|
||||
<Caret Line="943" Column="110" TopLine="925"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="943" Column="110" TopLine="925"/>
|
||||
<Caret Line="7" Column="109"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="7" Column="109"/>
|
||||
<Caret Line="168" Column="26" TopLine="145"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="168" Column="26" TopLine="145"/>
|
||||
<Caret Line="337" Column="52" TopLine="312"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="337" Column="52" TopLine="312"/>
|
||||
<Caret Line="94" Column="15" TopLine="81"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="uOSRExternalPumpBrowser.pas"/>
|
||||
<Caret Line="94" Column="15" TopLine="81"/>
|
||||
<Caret Line="488" Column="19" TopLine="456"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
|
@@ -1,98 +0,0 @@
|
||||
object SimpleExternalPumpBrowserFrm: TSimpleExternalPumpBrowserFrm
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'Initializing browser. Please wait...'
|
||||
ClientHeight = 624
|
||||
ClientWidth = 1038
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object AddressPnl: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1038
|
||||
Height = 30
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
Enabled = False
|
||||
Padding.Left = 5
|
||||
Padding.Top = 5
|
||||
Padding.Right = 5
|
||||
Padding.Bottom = 5
|
||||
ShowCaption = False
|
||||
TabOrder = 0
|
||||
object GoBtn: TButton
|
||||
Left = 1002
|
||||
Top = 5
|
||||
Width = 31
|
||||
Height = 20
|
||||
Margins.Left = 5
|
||||
Align = alRight
|
||||
Caption = 'Go'
|
||||
TabOrder = 0
|
||||
OnClick = GoBtnClick
|
||||
end
|
||||
object URLCbx: TComboBox
|
||||
Left = 5
|
||||
Top = 5
|
||||
Width = 997
|
||||
Height = 21
|
||||
Align = alClient
|
||||
ItemIndex = 0
|
||||
TabOrder = 1
|
||||
Text = 'https://www.google.com'
|
||||
Items.Strings = (
|
||||
'https://www.google.com'
|
||||
|
||||
'https://www.whatismybrowser.com/detect/what-http-headers-is-my-b' +
|
||||
'rowser-sending'
|
||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close'
|
||||
'https://www.w3schools.com/html/html5_video.asp'
|
||||
'http://www.adobe.com/software/flash/about/'
|
||||
'http://isflashinstalled.com/'
|
||||
'chrome://version/'
|
||||
'http://html5test.com/'
|
||||
'https://www.w3schools.com/'
|
||||
'http://webglsamples.org/'
|
||||
'https://get.webgl.org/'
|
||||
'https://www.youtube.com'
|
||||
'https://html5demos.com/drag/'
|
||||
|
||||
'https://developers.google.com/maps/documentation/javascript/exam' +
|
||||
'ples/streetview-embed?hl=fr'
|
||||
|
||||
'https://www.w3schools.com/Tags/tryit.asp?filename=tryhtml_iframe' +
|
||||
'_name'
|
||||
'https://www.browserleaks.com/webrtc'
|
||||
'https://frames-per-second.appspot.com/')
|
||||
end
|
||||
end
|
||||
object ChromiumWindow1: TChromiumWindow
|
||||
Left = 0
|
||||
Top = 30
|
||||
Width = 1038
|
||||
Height = 594
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
OnClose = ChromiumWindow1Close
|
||||
OnBeforeClose = ChromiumWindow1BeforeClose
|
||||
OnAfterCreated = ChromiumWindow1AfterCreated
|
||||
end
|
||||
object Timer1: TTimer
|
||||
Enabled = False
|
||||
Interval = 300
|
||||
OnTimer = Timer1Timer
|
||||
Left = 56
|
||||
Top = 88
|
||||
end
|
||||
end
|
@@ -4,12 +4,13 @@
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="27">
|
||||
<Units Count="28">
|
||||
<Unit0>
|
||||
<Filename Value="SimpleOSRBrowser.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="34"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<TopLine Value="30"/>
|
||||
<CursorPos X="77" Y="11"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
@@ -37,9 +38,8 @@
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="359"/>
|
||||
<CursorPos X="23" Y="375"/>
|
||||
<TopLine Value="43"/>
|
||||
<CursorPos X="93" Y="376"/>
|
||||
<UsageCount Value="42"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="40" Y="262" ID="4"/>
|
||||
@@ -228,8 +228,16 @@
|
||||
<CursorPos X="67" Y="17"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit26>
|
||||
<Unit27>
|
||||
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="417"/>
|
||||
<CursorPos X="10" Y="400"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit27>
|
||||
</Units>
|
||||
<JumpHistory Count="17" HistoryIndex="16">
|
||||
<JumpHistory Count="20" HistoryIndex="19">
|
||||
<Position1>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="204" Column="63" TopLine="19"/>
|
||||
@@ -298,6 +306,18 @@
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="91" Column="15" TopLine="85"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="usimplelazosrbrowser.pas"/>
|
||||
<Caret Line="376" Column="93" TopLine="43"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||
<Caret Line="154" Column="57" TopLine="135"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="..\..\..\source\uCEFBufferPanel.pas"/>
|
||||
<Caret Line="263" TopLine="269"/>
|
||||
</Position20>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// ************************************************************************
|
||||
// ************************************************************************
|
||||
// ***************************** CEF4Delphi *******************************
|
||||
// ************************************************************************
|
||||
//
|
||||
@@ -56,7 +56,7 @@ type
|
||||
|
||||
function GetParentForm : TCustomForm;
|
||||
|
||||
function PostFormMessage(aMsg : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean;
|
||||
function PostFormMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||
|
||||
procedure BrowserFrame_OnBrowserDestroyed(Sender: TObject);
|
||||
procedure BrowserFrame_OnBrowserTitleChange(Sender: TObject; const aTitle : string);
|
||||
@@ -101,14 +101,14 @@ begin
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TBrowserTab.PostFormMessage(aMsg, wParam : cardinal; lParam : integer) : boolean;
|
||||
function TBrowserTab.PostFormMessage(aMsg : cardinal; aWParam : WPARAM; aLParam : LPARAM) : boolean;
|
||||
var
|
||||
TempForm : TCustomForm;
|
||||
begin
|
||||
TempForm := ParentForm;
|
||||
Result := (TempForm <> nil) and
|
||||
TempForm.HandleAllocated and
|
||||
PostMessage(TempForm.Handle, aMsg, wParam, lParam);
|
||||
PostMessage(TempForm.Handle, aMsg, aWParam, aLParam);
|
||||
end;
|
||||
|
||||
procedure TBrowserTab.NotifyMoveOrResizeStarted;
|
||||
|
Reference in New Issue
Block a user