// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "UnrealCEFSubProcess.h" #include "UnrealCEFSubProcessApp.h" #if WITH_CEF3 FUnrealCEFSubProcessApp::FUnrealCEFSubProcessApp() { } void FUnrealCEFSubProcessApp::OnContextCreated( CefRefPtr Browser, CefRefPtr Frame, CefRefPtr Context ) { RemoteScripting.OnContextCreated(Browser, Frame, Context); } void FUnrealCEFSubProcessApp::OnContextReleased( CefRefPtr Browser, CefRefPtr Frame, CefRefPtr Context ) { RemoteScripting.OnContextReleased(Browser, Frame, Context); } bool FUnrealCEFSubProcessApp::OnProcessMessageReceived( CefRefPtr Browser, CefProcessId SourceProcess, CefRefPtr 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 ExtraInfo ) { for(size_t I=0; IGetSize(); I++) { if (ExtraInfo->GetType(I) == VTYPE_DICTIONARY) { CefRefPtr Info = ExtraInfo->GetDictionary(I); if ( Info->GetType("browser") == VTYPE_INT) { int32 BrowserID = Info->GetInt("browser"); CefRefPtr Bindings = Info->GetDictionary("bindings"); RemoteScripting.InitPermanentBindings(BrowserID, Bindings); } } } } #endif