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

Moved all JSON functions to the TCEFJson class

- Added TCEFJson.SaveToFile and TCEFJson.LoadFromFile functions
- Added more code comments to DOMVisitor
- Replaced all the code to save the browser preferences in TChromiumCore with the new TCEFJson functions
This commit is contained in:
Salvador Díaz Fau
2020-07-17 12:56:43 +02:00
parent 2b963f06ba
commit dceb2299e3
7 changed files with 231 additions and 339 deletions

View File

@ -87,7 +87,7 @@ uses
{$ELSE}
SysUtils,
{$ENDIF}
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFJson;
// ************************************************************
@ -108,7 +108,7 @@ begin
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
try
TempValue := CefParseJson(message_, message_size);
TempValue := TCEFJson.Parse(message_, message_size);
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsMessage(TCefBrowserRef.UnWrap(browser),
TempValue,
TempHandled);
@ -133,7 +133,7 @@ begin
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
try
TempValue := CefParseJson(result, result_size);
TempValue := TCEFJson.Parse(result, result_size);
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsMethodResult(TCefBrowserRef.UnWrap(browser),
message_id,
success <> 0,
@ -156,7 +156,7 @@ begin
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
try
TempValue := CefParseJson(params, params_size);
TempValue := TCEFJson.Parse(params, params_size);
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsEvent(TCefBrowserRef.UnWrap(browser),
CefString(method),
TempValue);