You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-11-23 21:34:53 +02:00
Added TCEFSentinel to more demos
- Check that all frames are valid before using them - Added an error page to MiniBrowser.
This commit is contained in:
@@ -241,7 +241,7 @@ type
|
||||
// ICefRequestContextHandler
|
||||
FOnRequestContextInitialized : TOnRequestContextInitialized;
|
||||
FOnBeforePluginLoad : TOnBeforePluginLoad;
|
||||
|
||||
|
||||
// Custom
|
||||
FOnTextResultAvailable : TOnTextResultAvailableEvent;
|
||||
FOnPdfPrintFinished : TOnPdfPrintFinishedEvent;
|
||||
@@ -445,17 +445,17 @@ type
|
||||
procedure doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); virtual;
|
||||
|
||||
// ICefResourceRequestHandler
|
||||
function doOnBeforeResourceLoad(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefRequestCallback): TCefReturnValue; virtual;
|
||||
procedure doOnGetResourceHandler(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var aResourceHandler : ICefResourceHandler); virtual;
|
||||
procedure doOnResourceRedirect(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var newUrl: ustring); virtual;
|
||||
function doOnResourceResponse(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse): Boolean; virtual;
|
||||
procedure doOnGetResourceResponseFilter(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var aResponseFilter: ICefResponseFilter); virtual;
|
||||
procedure doOnResourceLoadComplete(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; status: TCefUrlRequestStatus; receivedContentLength: Int64); virtual;
|
||||
procedure doOnProtocolExecution(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var allowOsExecution: Boolean); virtual;
|
||||
|
||||
// ICefCookieAccessFilter
|
||||
function doCanSendCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const cookie: PCefCookie): boolean; virtual;
|
||||
function doCanSaveCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie): boolean; virtual;
|
||||
function doOnBeforeResourceLoad(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefRequestCallback): TCefReturnValue; virtual;
|
||||
procedure doOnGetResourceHandler(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var aResourceHandler : ICefResourceHandler); virtual;
|
||||
procedure doOnResourceRedirect(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var newUrl: ustring); virtual;
|
||||
function doOnResourceResponse(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse): Boolean; virtual;
|
||||
procedure doOnGetResourceResponseFilter(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var aResponseFilter: ICefResponseFilter); virtual;
|
||||
procedure doOnResourceLoadComplete(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; status: TCefUrlRequestStatus; receivedContentLength: Int64); virtual;
|
||||
procedure doOnProtocolExecution(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var allowOsExecution: Boolean); virtual;
|
||||
|
||||
// ICefCookieAccessFilter
|
||||
function doCanSendCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const cookie: PCefCookie): boolean; virtual;
|
||||
function doCanSaveCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie): boolean; virtual;
|
||||
|
||||
// ICefDialogHandler
|
||||
function doOnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; virtual;
|
||||
@@ -486,11 +486,11 @@ type
|
||||
procedure doOnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean); virtual;
|
||||
|
||||
// ICefRequestContextHandler
|
||||
procedure doOnRequestContextInitialized(const request_context: ICefRequestContext); virtual;
|
||||
function doOnBeforePluginLoad(const mimeType, pluginUrl:ustring; isMainFrame : boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; var pluginPolicy: TCefPluginPolicy): Boolean; virtual;
|
||||
procedure doGetResourceRequestHandler(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean; const request_initiator: ustring; var disable_default_handling: boolean; var aResourceRequestHandler : ICefResourceRequestHandler); virtual;
|
||||
procedure doOnRequestContextInitialized(const request_context: ICefRequestContext); virtual;
|
||||
function doOnBeforePluginLoad(const mimeType, pluginUrl:ustring; isMainFrame : boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; var pluginPolicy: TCefPluginPolicy): Boolean; virtual;
|
||||
procedure doGetResourceRequestHandler(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean; const request_initiator: ustring; var disable_default_handling: boolean; var aResourceRequestHandler : ICefResourceRequestHandler); virtual;
|
||||
|
||||
// Custom
|
||||
// Custom
|
||||
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
||||
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
||||
procedure doTextResultAvailable(const aText : ustring); virtual;
|
||||
@@ -502,7 +502,7 @@ type
|
||||
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); virtual;
|
||||
procedure doOnCookiesStoreFlushed; virtual;
|
||||
procedure doCertificateExceptionsCleared; virtual;
|
||||
procedure doHttpAuthCredentialsCleared; virtual;
|
||||
procedure doHttpAuthCredentialsCleared; virtual;
|
||||
procedure doAllConnectionsClosed; virtual;
|
||||
function MustCreateLoadHandler : boolean; virtual;
|
||||
function MustCreateFocusHandler : boolean; virtual;
|
||||
@@ -554,7 +554,7 @@ type
|
||||
function DeleteCookies(const url : ustring = ''; const cookieName : ustring = '') : boolean;
|
||||
function FlushCookieStore(aFlushImmediately : boolean = True) : boolean;
|
||||
function ClearCertificateExceptions(aClearImmediately : boolean = True) : boolean;
|
||||
function ClearHttpAuthCredentials(aClearImmediately : boolean = True) : boolean;
|
||||
function ClearHttpAuthCredentials(aClearImmediately : boolean = True) : boolean;
|
||||
function CloseAllConnections(aCloseImmediately : boolean = True) : boolean;
|
||||
procedure RetrieveHTML(const aFrameName : ustring = ''); overload;
|
||||
procedure RetrieveHTML(const aFrame : ICefFrame); overload;
|
||||
@@ -636,8 +636,8 @@ type
|
||||
procedure DragSourceSystemDragEnded;
|
||||
|
||||
procedure IMESetComposition(const text: ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PCefRange);
|
||||
procedure IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer);
|
||||
procedure IMEFinishComposingText(keep_selection : boolean);
|
||||
procedure IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer);
|
||||
procedure IMEFinishComposingText(keep_selection : boolean);
|
||||
procedure IMECancelComposition;
|
||||
|
||||
|
||||
@@ -1553,7 +1553,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.Copy;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.Copy;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1566,7 +1566,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.Paste;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.Paste;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1579,7 +1579,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.Cut;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.Cut;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1592,7 +1592,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.Undo;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.Undo;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1605,7 +1605,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.Redo;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.Redo;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1618,7 +1618,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.Del;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.Del;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1631,7 +1631,7 @@ begin
|
||||
TempFrame := FBrowser.FocusedFrame;
|
||||
if (TempFrame = nil) then TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.SelectAll;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.SelectAll;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1743,13 +1743,13 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.LoadUrl(aURL);
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.LoadUrl(aURL);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChromium.LoadURL(const aURL : ustring; const aFrame : ICefFrame);
|
||||
begin
|
||||
if Initialized and (aFrame <> nil) then aFrame.LoadUrl(aURL);
|
||||
if Initialized and (aFrame <> nil) and aFrame.IsValid then aFrame.LoadUrl(aURL);
|
||||
end;
|
||||
|
||||
procedure TChromium.LoadURL(const aURL : ustring; const aFrameIdentifier : int64);
|
||||
@@ -1763,7 +1763,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then TempFrame.LoadUrl(aURL);
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.LoadUrl(aURL);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1774,7 +1774,7 @@ begin
|
||||
if Initialized then
|
||||
begin
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
if (TempFrame <> nil) then TempFrame.LoadString(aString, aURL);
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.LoadString(aString, aURL);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1785,7 +1785,7 @@ begin
|
||||
if Initialized then
|
||||
begin
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
if (TempFrame <> nil) then TempFrame.LoadRequest(aRequest);
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then TempFrame.LoadRequest(aRequest);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1975,7 +1975,7 @@ begin
|
||||
if Initialized then
|
||||
begin
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
if (TempFrame <> nil) then Result := TempFrame.URL;
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then Result := TempFrame.URL;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -2382,9 +2382,9 @@ begin
|
||||
end;
|
||||
|
||||
// If aClearImmediately is false then OnHttpAuthCredentialsCleared is triggered when the credeintials are cleared
|
||||
function TChromium.ClearHttpAuthCredentials(aClearImmediately : boolean) : boolean;
|
||||
var
|
||||
TempCallback : ICefCompletionCallback;
|
||||
function TChromium.ClearHttpAuthCredentials(aClearImmediately : boolean) : boolean;
|
||||
var
|
||||
TempCallback : ICefCompletionCallback;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
@@ -2400,9 +2400,9 @@ begin
|
||||
finally
|
||||
TempCallback := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
// If aCloseImmediately is false then OnAllConnectionsClosed is triggered when the connections are closed
|
||||
end;
|
||||
|
||||
// If aCloseImmediately is false then OnAllConnectionsClosed is triggered when the connections are closed
|
||||
function TChromium.CloseAllConnections(aCloseImmediately : boolean) : boolean;
|
||||
var
|
||||
TempCallback : ICefCompletionCallback;
|
||||
@@ -2436,7 +2436,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
try
|
||||
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||
TempFrame.GetSource(TempVisitor);
|
||||
@@ -2450,7 +2450,7 @@ procedure TChromium.RetrieveHTML(const aFrame : ICefFrame);
|
||||
var
|
||||
TempVisitor : ICefStringVisitor;
|
||||
begin
|
||||
if Initialized and (aFrame <> nil) then
|
||||
if Initialized and (aFrame <> nil) and aFrame.IsValid then
|
||||
try
|
||||
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||
aFrame.GetSource(TempVisitor);
|
||||
@@ -2471,7 +2471,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
try
|
||||
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||
TempFrame.GetSource(TempVisitor);
|
||||
@@ -2494,7 +2494,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
try
|
||||
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||
TempFrame.GetText(TempVisitor);
|
||||
@@ -2508,7 +2508,7 @@ procedure TChromium.RetrieveText(const aFrame : ICefFrame);
|
||||
var
|
||||
TempVisitor : ICefStringVisitor;
|
||||
begin
|
||||
if Initialized and (aFrame <> nil) then
|
||||
if Initialized and (aFrame <> nil) and aFrame.IsValid then
|
||||
try
|
||||
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||
aFrame.GetText(TempVisitor);
|
||||
@@ -2529,7 +2529,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
try
|
||||
TempVisitor := TCustomCefStringVisitor.Create(self);
|
||||
TempFrame.GetText(TempVisitor);
|
||||
@@ -3277,11 +3277,11 @@ begin
|
||||
if assigned(FOnCertificateExceptionsCleared) then FOnCertificateExceptionsCleared(self);
|
||||
end;
|
||||
|
||||
procedure TChromium.doHttpAuthCredentialsCleared;
|
||||
begin
|
||||
procedure TChromium.doHttpAuthCredentialsCleared;
|
||||
begin
|
||||
if assigned(FOnHttpAuthCredentialsCleared) then FOnHttpAuthCredentialsCleared(self);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TChromium.doAllConnectionsClosed;
|
||||
begin
|
||||
if assigned(FOnAllConnectionsClosed) then FOnAllConnectionsClosed(self);
|
||||
@@ -3375,7 +3375,7 @@ begin
|
||||
end;
|
||||
|
||||
function TChromium.MustCreateResourceRequestHandler : boolean;
|
||||
begin
|
||||
begin
|
||||
Result := assigned(FOnBeforeResourceLoad) or
|
||||
assigned(FOnGetResourceHandler) or
|
||||
assigned(FOnResourceRedirect) or
|
||||
@@ -3385,7 +3385,7 @@ begin
|
||||
assigned(FOnProtocolExecution) or
|
||||
MustCreateCookieAccessFilter;
|
||||
end;
|
||||
|
||||
|
||||
function TChromium.MustCreateCookieAccessFilter : boolean;
|
||||
begin
|
||||
Result := assigned(FOnCanSendCookie) or
|
||||
@@ -3427,7 +3427,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
TempFrame.ExecuteJavaScript(aCode, aScriptURL, aStartLine);
|
||||
end;
|
||||
except
|
||||
@@ -3439,7 +3439,7 @@ end;
|
||||
procedure TChromium.ExecuteJavaScript(const aCode, aScriptURL : ustring; const aFrame : ICefFrame; aStartLine : integer);
|
||||
begin
|
||||
try
|
||||
if Initialized and (aFrame <> nil) then
|
||||
if Initialized and (aFrame <> nil) and aFrame.IsValid then
|
||||
aFrame.ExecuteJavaScript(aCode, aScriptURL, aStartLine);
|
||||
except
|
||||
on e : exception do
|
||||
@@ -3459,7 +3459,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
TempFrame.ExecuteJavaScript(aCode, aScriptURL, aStartLine);
|
||||
end;
|
||||
except
|
||||
@@ -3628,11 +3628,11 @@ begin
|
||||
|
||||
// TempAction values
|
||||
// -----------------
|
||||
// cbaCancel : stop closing the browser
|
||||
// cbaClose : continue closing the browser
|
||||
// cbaDelay : stop closing the browser momentarily. Used when the application
|
||||
// needs to execute some custom processes before closing the
|
||||
// browser. This is usually needed to destroy a TCEFWindowParent
|
||||
// cbaCancel : stop closing the browser
|
||||
// cbaClose : continue closing the browser
|
||||
// cbaDelay : stop closing the browser momentarily. Used when the application
|
||||
// needs to execute some custom processes before closing the
|
||||
// browser. This is usually needed to destroy a TCEFWindowParent
|
||||
// in the main thread before closing the browser.
|
||||
if Assigned(FOnClose) then FOnClose(Self, browser, TempAction);
|
||||
|
||||
@@ -3902,31 +3902,31 @@ begin
|
||||
if assigned(FOnRequestContextInitialized) then FOnRequestContextInitialized(self, request_context);
|
||||
end;
|
||||
|
||||
function TChromium.doOnBeforePluginLoad(const mimeType : ustring;
|
||||
const pluginUrl : ustring;
|
||||
isMainFrame : boolean;
|
||||
const topOriginUrl : ustring;
|
||||
const pluginInfo : ICefWebPluginInfo;
|
||||
var pluginPolicy : TCefPluginPolicy): Boolean;
|
||||
begin
|
||||
function TChromium.doOnBeforePluginLoad(const mimeType : ustring;
|
||||
const pluginUrl : ustring;
|
||||
isMainFrame : boolean;
|
||||
const topOriginUrl : ustring;
|
||||
const pluginInfo : ICefWebPluginInfo;
|
||||
var pluginPolicy : TCefPluginPolicy): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
if assigned(FOnBeforePluginLoad) then
|
||||
FOnBeforePluginLoad(self, mimeType, pluginUrl, isMainFrame, topOriginUrl, pluginInfo, pluginPolicy, Result);
|
||||
end;
|
||||
|
||||
procedure TChromium.doGetResourceRequestHandler(const browser : ICefBrowser;
|
||||
const frame : ICefFrame;
|
||||
const request : ICefRequest;
|
||||
is_navigation : boolean;
|
||||
is_download : boolean;
|
||||
const request_initiator : ustring;
|
||||
var disable_default_handling : boolean;
|
||||
var aResourceRequestHandler : ICefResourceRequestHandler);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TChromium.doGetResourceRequestHandler(const browser : ICefBrowser;
|
||||
const frame : ICefFrame;
|
||||
const request : ICefRequest;
|
||||
is_navigation : boolean;
|
||||
is_download : boolean;
|
||||
const request_initiator : ustring;
|
||||
var disable_default_handling : boolean;
|
||||
var aResourceRequestHandler : ICefResourceRequestHandler);
|
||||
begin
|
||||
disable_default_handling := False;
|
||||
aResourceRequestHandler := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChromium.doOnFullScreenModeChange(const browser: ICefBrowser; fullscreen: Boolean);
|
||||
begin
|
||||
@@ -3967,11 +3967,11 @@ begin
|
||||
if assigned(FOnCanSendCookie) then FOnCanSendCookie(self, browser, frame, request, cookie, Result);
|
||||
end;
|
||||
|
||||
function TChromium.doCanSaveCookie(const browser : ICefBrowser;
|
||||
const frame : ICefFrame;
|
||||
const request : ICefRequest;
|
||||
const response : ICefResponse;
|
||||
const cookie : PCefCookie): boolean;
|
||||
function TChromium.doCanSaveCookie(const browser : ICefBrowser;
|
||||
const frame : ICefFrame;
|
||||
const request : ICefRequest;
|
||||
const response : ICefResponse;
|
||||
const cookie : PCefCookie): boolean;
|
||||
begin
|
||||
Result := True;
|
||||
|
||||
@@ -4095,10 +4095,10 @@ begin
|
||||
end;
|
||||
|
||||
procedure TChromium.doOnGetResourceRequestHandler(const browser : ICefBrowser;
|
||||
const frame : ICefFrame;
|
||||
const request : ICefRequest;
|
||||
is_navigation : boolean;
|
||||
is_download : boolean;
|
||||
const frame : ICefFrame;
|
||||
const request : ICefRequest;
|
||||
is_navigation : boolean;
|
||||
is_download : boolean;
|
||||
const request_initiator : ustring;
|
||||
var disable_default_handling : boolean;
|
||||
var aResourceRequestHandler : ICefResourceRequestHandler;
|
||||
@@ -4602,7 +4602,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
TempFrame.SendProcessMessage(targetProcess, ProcMessage);
|
||||
end;
|
||||
except
|
||||
@@ -4614,7 +4614,7 @@ end;
|
||||
procedure TChromium.SendProcessMessage(targetProcess: TCefProcessId; const ProcMessage: ICefProcessMessage; const aFrame : ICefFrame);
|
||||
begin
|
||||
try
|
||||
if Initialized and (aFrame <> nil) then
|
||||
if Initialized and (aFrame <> nil) and aFrame.IsValid then
|
||||
aFrame.SendProcessMessage(targetProcess, ProcMessage);
|
||||
except
|
||||
on e : exception do
|
||||
@@ -4634,7 +4634,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
TempFrame.SendProcessMessage(targetProcess, ProcMessage);
|
||||
end;
|
||||
except
|
||||
@@ -4657,7 +4657,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
Result := TempFrame.CreateUrlRequest(request, client);
|
||||
end;
|
||||
except
|
||||
@@ -4671,7 +4671,7 @@ begin
|
||||
Result := nil;
|
||||
|
||||
try
|
||||
if Initialized and (aFrame <> nil) then
|
||||
if Initialized and (aFrame <> nil) and aFrame.IsValid then
|
||||
Result := aFrame.CreateUrlRequest(request, client);
|
||||
except
|
||||
on e : exception do
|
||||
@@ -4693,7 +4693,7 @@ begin
|
||||
else
|
||||
TempFrame := FBrowser.MainFrame;
|
||||
|
||||
if (TempFrame <> nil) then
|
||||
if (TempFrame <> nil) and TempFrame.IsValid then
|
||||
Result := TempFrame.CreateUrlRequest(request, client);
|
||||
end;
|
||||
except
|
||||
@@ -4741,19 +4741,19 @@ begin
|
||||
FBrowser.Host.IMESetComposition(text, underlines, replacement_range, selection_range);
|
||||
end;
|
||||
|
||||
procedure TChromium.IMECommitText(const text : ustring;
|
||||
const replacement_range : PCefRange;
|
||||
relative_cursor_pos : integer);
|
||||
begin
|
||||
procedure TChromium.IMECommitText(const text : ustring;
|
||||
const replacement_range : PCefRange;
|
||||
relative_cursor_pos : integer);
|
||||
begin
|
||||
if Initialized then
|
||||
FBrowser.Host.IMECommitText(text, replacement_range, relative_cursor_pos);
|
||||
end;
|
||||
|
||||
procedure TChromium.IMEFinishComposingText(keep_selection : boolean);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TChromium.IMEFinishComposingText(keep_selection : boolean);
|
||||
begin
|
||||
if Initialized then FBrowser.Host.IMEFinishComposingText(keep_selection);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TChromium.IMECancelComposition;
|
||||
begin
|
||||
if Initialized then FBrowser.Host.IMECancelComposition;
|
||||
|
||||
Reference in New Issue
Block a user