I'm trying to do something similar, but i want to the callback function be on another class, is this possible ? Just like this code :
unit simple1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cefvcl, ceflib;
type
TForm1 = class(TForm)
Chromium1: TChromium;
procedure FormCreate(Sender: TObject);
procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
httpStatusCode: Integer);
public
mySource : string;
procedure StringVisitor(const str: ustring);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
httpStatusCode: Integer);
begin
Chromium1.Browser.MainFrame.GetSourceProc(StringVisitor); // error on this line
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
chromium1.load('http://www.google.com');
end;
procedure TForm1.StringVisitor(const str: ustring);
begin
mySource := str;
end;
end.