1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

GlobalCEFApp initialization changes

Added a custom BrowserProcessHandler to GlobalCEFApp to know when the global context is initialized and it's allowed to set the custom cookies directory and to create browsers.
This commit is contained in:
Salvador Díaz Fau
2017-10-28 10:53:51 +02:00
parent ed8d551d85
commit bb83979092
4 changed files with 201 additions and 93 deletions

View File

@@ -51,13 +51,14 @@ uses
type
TCefBrowserProcessHandlerOwn = class(TCefBaseRefCountedOwn, ICefBrowserProcessHandler)
protected
procedure OnContextInitialized; virtual;
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); virtual;
procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); virtual;
procedure OnScheduleMessagePumpWork(delayMs: Int64); virtual;
public
constructor Create; virtual;
protected
procedure OnContextInitialized; virtual;
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); virtual;
procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); virtual;
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual;
public
constructor Create; virtual;
end;
implementation
@@ -96,11 +97,11 @@ begin
with PCefBrowserProcessHandler(FData)^ do
begin
on_context_initialized := cef_browser_process_handler_on_context_initialized;
on_before_child_process_launch := cef_browser_process_handler_on_before_child_process_launch;
on_context_initialized := cef_browser_process_handler_on_context_initialized;
on_before_child_process_launch := cef_browser_process_handler_on_before_child_process_launch;
on_render_process_thread_created := cef_browser_process_handler_on_render_process_thread_created;
get_print_handler := nil; // linux
on_schedule_message_pump_work := cef_browser_process_handler_on_schedule_message_pump_work;
get_print_handler := nil; // linux
on_schedule_message_pump_work := cef_browser_process_handler_on_schedule_message_pump_work;
end;
end;
@@ -119,7 +120,7 @@ begin
end;
procedure TCefBrowserProcessHandlerOwn.OnScheduleMessagePumpWork(delayMs: Int64);
procedure TCefBrowserProcessHandlerOwn.OnScheduleMessagePumpWork(const delayMs: Int64);
begin
end;