You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "UnrealCEFSubProcess.h"
|
|
#include "UnrealCEFSubProcessApp.h"
|
|
|
|
#if WITH_CEF3
|
|
|
|
FUnrealCEFSubProcessApp::FUnrealCEFSubProcessApp()
|
|
{
|
|
}
|
|
|
|
void FUnrealCEFSubProcessApp::OnContextCreated( CefRefPtr<CefBrowser> Browser, CefRefPtr<CefFrame> Frame, CefRefPtr<CefV8Context> Context )
|
|
{
|
|
RemoteScripting.OnContextCreated(Browser, Frame, Context);
|
|
}
|
|
|
|
void FUnrealCEFSubProcessApp::OnContextReleased( CefRefPtr<CefBrowser> Browser, CefRefPtr<CefFrame> Frame, CefRefPtr<CefV8Context> Context )
|
|
{
|
|
RemoteScripting.OnContextReleased(Browser, Frame, Context);
|
|
}
|
|
|
|
bool FUnrealCEFSubProcessApp::OnProcessMessageReceived( CefRefPtr<CefBrowser> Browser, CefProcessId SourceProcess, CefRefPtr<CefProcessMessage> Message )
|
|
{
|
|
bool Result = false;
|
|
FString MessageName = Message->GetName().ToWString().c_str();
|
|
if (MessageName.StartsWith(TEXT("UE::")))
|
|
{
|
|
Result = RemoteScripting.OnProcessMessageReceived(Browser, SourceProcess, Message);
|
|
}
|
|
|
|
return Result;
|
|
}
|
|
|
|
void FUnrealCEFSubProcessApp::OnRenderThreadCreated( CefRefPtr<CefListValue> ExtraInfo )
|
|
{
|
|
for(size_t I=0; I<ExtraInfo->GetSize(); I++)
|
|
{
|
|
if (ExtraInfo->GetType(I) == VTYPE_DICTIONARY)
|
|
{
|
|
CefRefPtr<CefDictionaryValue> Info = ExtraInfo->GetDictionary(I);
|
|
if ( Info->GetType("browser") == VTYPE_INT)
|
|
{
|
|
int32 BrowserID = Info->GetInt("browser");
|
|
CefRefPtr<CefDictionaryValue> Bindings = Info->GetDictionary("bindings");
|
|
RemoteScripting.InitPermanentBindings(BrowserID, Bindings);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |