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

Update to CEF 3.3202.1674.g2a991c4

This commit is contained in:
Salvador Díaz Fau
2017-10-26 13:23:13 +02:00
parent 87d11774bd
commit 26f286cae7
11 changed files with 393 additions and 172 deletions

View File

@ -54,8 +54,9 @@ type
TCefRequestContextHandlerRef = class(TCefBaseRefCountedRef, ICefRequestContextHandler)
protected
function GetCookieManager: ICefCookieManager;
function OnBeforePluginLoad(const mimeType, pluginUrl: ustring; isMainFrame : boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; pluginPolicy: PCefPluginPolicy): Boolean;
procedure OnRequestContextInitialized(const request_context: ICefRequestContext);
function GetCookieManager: ICefCookieManager;
function OnBeforePluginLoad(const mimeType, pluginUrl: ustring; isMainFrame : boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; pluginPolicy: PCefPluginPolicy): Boolean;
public
class function UnWrap(data: Pointer): ICefRequestContextHandler;
@ -63,8 +64,9 @@ type
TCefRequestContextHandlerOwn = class(TCefBaseRefCountedOwn, ICefRequestContextHandler)
protected
function GetCookieManager: ICefCookieManager; virtual;
function OnBeforePluginLoad(const mimeType, pluginUrl: ustring; isMainFrame : boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; pluginPolicy: PCefPluginPolicy): Boolean; virtual;
procedure OnRequestContextInitialized(const request_context: ICefRequestContext);
function GetCookieManager: ICefCookieManager; virtual;
function OnBeforePluginLoad(const mimeType, pluginUrl: ustring; isMainFrame : boolean; const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo; pluginPolicy: PCefPluginPolicy): Boolean; virtual;
public
constructor Create; virtual;
@ -83,12 +85,18 @@ type
implementation
uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager, uCEFWebPluginInfo;
uCEFMiscFunctions, uCEFLibFunctions, uCEFCookieManager, uCEFWebPluginInfo, uCEFRequestContext;
// TCefRequestContextHandlerOwn
procedure cef_request_context_handler_on_request_context_initialized(self: PCefRequestContextHandler; request_context: PCefRequestContext); stdcall;
begin
TCefRequestContextHandlerOwn(CefGetObject(self)).OnRequestContextInitialized(TCefRequestContextRef.UnWrap(request_context));
end;
function cef_request_context_handler_get_cookie_manager(self: PCefRequestContextHandler): PCefCookieManager; stdcall;
begin
with TCefRequestContextHandlerOwn(CefGetObject(self)) do
Result := CefGetData(GetCookieManager());
Result := CefGetData(TCefRequestContextHandlerOwn(CefGetObject(self)).GetCookieManager());
end;
function cef_request_context_handler_on_before_plugin_load(self: PCefRequestContextHandler;
@ -107,6 +115,44 @@ begin
plugin_policy));
end;
constructor TCefRequestContextHandlerOwn.Create;
begin
CreateData(SizeOf(TCefRequestContextHandler), False);
with PCefRequestContextHandler(FData)^ do
begin
on_request_context_initialized := cef_request_context_handler_on_request_context_initialized;
get_cookie_manager := cef_request_context_handler_get_cookie_manager;
on_before_plugin_load := cef_request_context_handler_on_before_plugin_load;
end;
end;
procedure TCefRequestContextHandlerOwn.OnRequestContextInitialized(const request_context: ICefRequestContext);
begin
end;
function TCefRequestContextHandlerOwn.GetCookieManager: ICefCookieManager;
begin
Result:= nil;
end;
function TCefRequestContextHandlerOwn.OnBeforePluginLoad(const mimeType, pluginUrl : ustring;
isMainFrame : boolean;
const topOriginUrl: ustring;
const pluginInfo: ICefWebPluginInfo;
pluginPolicy: PCefPluginPolicy): Boolean;
begin
Result := False;
end;
// TCefRequestContextHandlerRef
procedure TCefRequestContextHandlerRef.OnRequestContextInitialized(const request_context: ICefRequestContext);
begin
PCefRequestContextHandler(FData).on_request_context_initialized(FData, CefGetData(request_context));
end;
function TCefRequestContextHandlerRef.GetCookieManager: ICefCookieManager;
begin
@ -135,33 +181,6 @@ begin
else
Result := nil;
end;
// TCefRequestContextHandlerOwn
constructor TCefRequestContextHandlerOwn.Create;
begin
CreateData(SizeOf(TCefRequestContextHandler), False);
with PCefRequestContextHandler(FData)^ do
begin
get_cookie_manager := cef_request_context_handler_get_cookie_manager;
on_before_plugin_load := cef_request_context_handler_on_before_plugin_load;
end;
end;
function TCefRequestContextHandlerOwn.GetCookieManager: ICefCookieManager;
begin
Result:= nil;
end;
function TCefRequestContextHandlerOwn.OnBeforePluginLoad(const mimeType, pluginUrl : ustring;
isMainFrame : boolean;
const topOriginUrl: ustring;
const pluginInfo: ICefWebPluginInfo;
pluginPolicy: PCefPluginPolicy): Boolean;
begin
Result := False;
end;
// TCefFastRequestContextHandler