#include "StdAfx.h"
|
#include "Cef3RunEngine.h"
|
|
|
CCef3RunEngine::CCef3RunEngine(void):cef_ctx_(new browser::CCef3MainContextImpl(true))
|
{
|
::OleInitialize(NULL);
|
}
|
|
|
CCef3RunEngine::~CCef3RunEngine(void)
|
{
|
::OleUninitialize();
|
}
|
|
|
BOOL CCef3RunEngine::Initialize(SApplication *app,HINSTANCE hInstance)
|
{
|
InitializeCef(app,hInstance);
|
|
|
return TRUE;
|
}
|
|
void CCef3RunEngine::Release()
|
{
|
cef_ctx_->Shutdown();
|
cef_ctx_.reset();
|
}
|
|
|
void CCef3RunEngine::InitializeCef(SApplication *app,HINSTANCE hInstance)
|
{
|
/*IMsgLoopFactory *pMsgLoopFactory = new SMsgLoopFactory;
|
app->SetMsgLoopFactory(pMsgLoopFactory);
|
pMsgLoopFactory->Release();*/
|
|
CefMainArgs main_args(hInstance);
|
CefRefPtr<CefApp> cef = browser::CCef3MainContext::InitCef3(main_args, NULL);
|
assert(cef.get() != NULL);
|
|
cef_ctx_->Initialize(main_args, cef, NULL);
|
}
|