CEF4Delphi/source/uCEFJsDialogCallback.pas

48 lines
983 B
ObjectPascal
Raw Normal View History

2017-01-27 16:37:51 +01:00
unit uCEFJsDialogCallback;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
2017-02-05 20:56:46 +01:00
{$I cef.inc}
{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}
2017-01-27 16:37:51 +01:00
interface
uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
2017-01-27 16:37:51 +01:00
type
TCefJsDialogCallbackRef = class(TCefBaseRefCountedRef, ICefJsDialogCallback)
protected
procedure Cont(success: Boolean; const userInput: ustring);
public
class function UnWrap(data: Pointer): ICefJsDialogCallback;
2017-01-27 16:37:51 +01:00
end;
implementation
uses
uCEFMiscFunctions, uCEFLibFunctions;
procedure TCefJsDialogCallbackRef.Cont(success: Boolean; const userInput: ustring);
2017-01-27 16:37:51 +01:00
var
TempInput : TCefString;
2017-01-27 16:37:51 +01:00
begin
TempInput := CefString(userInput);
PCefJsDialogCallback(FData)^.cont(PCefJsDialogCallback(FData), Ord(success), @TempInput);
2017-01-27 16:37:51 +01:00
end;
class function TCefJsDialogCallbackRef.UnWrap(data: Pointer): ICefJsDialogCallback;
2017-01-27 16:37:51 +01:00
begin
if (data <> nil) then
Result := Create(data) as ICefJsDialogCallback
else
2017-01-27 16:37:51 +01:00
Result := nil;
end;
end.