Files
UnrealEngineUWP/Engine/Source/Runtime/WebBrowser/Private/WebBrowserModule.cpp
Matthew Griffin 102bea4250 Moving WebBrowser and CEF3Utils to Runtime so that they can be used in games.
Also removed guards around browser code in SWebBrowser and made sure that path for sub process exe is correct if game exe is not in the same folder.

[CL 2389777 by Matthew Griffin in Main branch]
2014-12-16 06:41:01 -05:00

47 lines
960 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "WebBrowserPrivatePCH.h"
#include "WebBrowserSingleton.h"
#include "ModuleManager.h"
#include "CEF3Utils.h"
DEFINE_LOG_CATEGORY(LogWebBrowser);
static FWebBrowserSingleton* WebBrowserSingleton = nullptr;
class FWebBrowserModule : public IWebBrowserModule
{
private:
// IModuleInterface Interface
virtual void StartupModule() override;
virtual void ShutdownModule() override;
public:
virtual IWebBrowserSingleton* GetSingleton();
};
IMPLEMENT_MODULE( FWebBrowserModule, WebBrowser );
void FWebBrowserModule::StartupModule()
{
#if WITH_CEF3
CEF3Utils::LoadCEF3Modules();
#endif
WebBrowserSingleton = new FWebBrowserSingleton();
}
void FWebBrowserModule::ShutdownModule()
{
delete WebBrowserSingleton;
WebBrowserSingleton = NULL;
#if WITH_CEF3
CEF3Utils::UnloadCEF3Modules();
#endif
}
IWebBrowserSingleton* FWebBrowserModule::GetSingleton()
{
return WebBrowserSingleton;
}