2015-04-02 09:42:37 -04:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#if WITH_CEF3
|
|
|
|
|
#if PLATFORM_WINDOWS
|
|
|
|
|
#include "AllowWindowsPlatformTypes.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-06-09 16:41:53 -04:00
|
|
|
#pragma push_macro("OVERRIDE")
|
|
|
|
|
#undef OVERRIDE // cef headers provide their own OVERRIDE macro
|
2015-04-02 09:42:37 -04:00
|
|
|
#include "include/cef_app.h"
|
2015-06-09 16:41:53 -04:00
|
|
|
#pragma pop_macro("OVERRIDE")
|
2015-04-02 09:42:37 -04:00
|
|
|
|
|
|
|
|
#if PLATFORM_WINDOWS
|
|
|
|
|
#include "HideWindowsPlatformTypes.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-06-25 16:56:38 -04:00
|
|
|
#include "UnrealCEFSubProcessRemoteScripting.h"
|
|
|
|
|
|
2015-04-02 09:42:37 -04:00
|
|
|
/**
|
|
|
|
|
* Implements CEF App and other Process level interfaces
|
|
|
|
|
*/
|
|
|
|
|
class FUnrealCEFSubProcessApp
|
2015-06-30 13:19:56 -04:00
|
|
|
: public CefApp
|
|
|
|
|
, public CefRenderProcessHandler
|
2015-04-02 09:42:37 -04:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2015-06-30 13:19:56 -04:00
|
|
|
/**
|
|
|
|
|
* Default Constructor
|
|
|
|
|
*/
|
|
|
|
|
FUnrealCEFSubProcessApp();
|
|
|
|
|
|
2015-04-02 09:42:37 -04:00
|
|
|
private:
|
2015-06-30 13:19:56 -04:00
|
|
|
// CefApp methods:
|
|
|
|
|
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override { return this; }
|
2015-04-02 09:42:37 -04:00
|
|
|
|
2015-06-30 13:19:56 -04:00
|
|
|
// CefRenderProcessHandler methods:
|
|
|
|
|
virtual void OnContextCreated( CefRefPtr<CefBrowser> Browser, CefRefPtr<CefFrame> Frame, CefRefPtr<CefV8Context> Context ) override;
|
2015-04-02 09:42:37 -04:00
|
|
|
|
2015-06-30 13:19:56 -04:00
|
|
|
virtual void OnContextReleased( CefRefPtr<CefBrowser> Browser, CefRefPtr<CefFrame> Frame, CefRefPtr<CefV8Context> Context ) override;
|
2015-04-02 09:42:37 -04:00
|
|
|
|
2015-06-30 13:19:56 -04:00
|
|
|
virtual bool OnProcessMessageReceived( CefRefPtr<CefBrowser> Browser, CefProcessId SourceProcess, CefRefPtr<CefProcessMessage> Message ) override;
|
2015-04-02 09:42:37 -04:00
|
|
|
|
2015-06-30 13:19:56 -04:00
|
|
|
virtual void OnRenderThreadCreated( CefRefPtr<CefListValue> ExtraInfo ) override;
|
2015-06-25 16:56:38 -04:00
|
|
|
|
|
|
|
|
// Handles remote scripting messages from the frontend process
|
|
|
|
|
FUnrealCEFSubProcessRemoteScripting RemoteScripting;
|
|
|
|
|
|
2015-06-30 13:19:56 -04:00
|
|
|
// Include the default reference counting implementation.
|
|
|
|
|
IMPLEMENT_REFCOUNTING(FUnrealCEFSubProcessApp);
|
2015-04-02 09:42:37 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // WITH_CEF3
|