CEF4Delphi/source/uCEFMediaAccessCallback.pas

51 lines
1.1 KiB
ObjectPascal
Raw Normal View History

unit uCEFMediaAccessCallback;
2022-08-06 12:00:28 +02:00
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
{$I cef.inc}
{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}
interface
uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type
TCefMediaAccessCallbackRef = class(TCefBaseRefCountedRef, ICefMediaAccessCallback)
protected
procedure cont(allowed_permissions: TCefMediaAccessPermissionTypes);
procedure cancel;
public
class function UnWrap(data: Pointer): ICefMediaAccessCallback;
end;
implementation
uses
uCEFMiscFunctions, uCEFLibFunctions;
procedure TCefMediaAccessCallbackRef.cont(allowed_permissions: TCefMediaAccessPermissionTypes);
begin
PCefMediaAccessCallback(FData)^.cont(PCefMediaAccessCallback(FData), allowed_permissions);
end;
procedure TCefMediaAccessCallbackRef.cancel;
begin
PCefMediaAccessCallback(FData)^.cancel(PCefMediaAccessCallback(FData));
end;
class function TCefMediaAccessCallbackRef.UnWrap(data: Pointer): ICefMediaAccessCallback;
begin
if (data <> nil) then
Result := Create(data) as ICefMediaAccessCallback
else
Result := nil;
end;
end.