mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
// Copyright © 2010-2014 The CefSharp Project. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
#pragma once
|
|
|
|
#include "Stdafx.h"
|
|
|
|
#include "CefAppWrapper.h"
|
|
#include "CefSubprocessWrapper.h"
|
|
|
|
using namespace System;
|
|
using namespace System::Diagnostics;
|
|
using namespace System::Collections::Generic;
|
|
|
|
namespace CefSharp
|
|
{
|
|
CefAppWrapper::CefAppWrapper()
|
|
{
|
|
Action<CefBrowserBase^>^ onBrowserCreated = gcnew Action<CefBrowserBase^>(this, &CefAppWrapper::OnBrowserCreated);
|
|
cefApp = new CefAppUnmanagedWrapper(onBrowserCreated);
|
|
browserWrappers = gcnew List<CefBrowserWrapper^>();
|
|
}
|
|
|
|
int CefAppWrapper::Run()
|
|
{
|
|
auto hInstance = Process::GetCurrentProcess()->Handle;
|
|
|
|
CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer());
|
|
Instance = this;
|
|
|
|
return CefExecuteProcess(cefMainArgs, (CefApp*)cefApp.get());
|
|
}
|
|
|
|
void CefAppWrapper::Bind(JavascriptRootObject^ rootObject)
|
|
{
|
|
auto app = cefApp.get();
|
|
|
|
app->Bind(rootObject);
|
|
}
|
|
} |