mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
// Copyright © 2010-2013 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 "BrowserSettings.h"
|
|
#include "IRenderWebBrowser.h"
|
|
#include "Internals/RenderClientAdapterInternal.h"
|
|
|
|
using namespace CefSharp::Internals;
|
|
|
|
namespace CefSharp
|
|
{
|
|
public ref class RenderClientAdapter
|
|
{
|
|
private:
|
|
RenderClientAdapterInternal* _renderClientAdapterInternal;
|
|
|
|
public:
|
|
RenderClientAdapter(IRenderWebBrowser^ offscreenBrowserControl)
|
|
{
|
|
_renderClientAdapterInternal = new RenderClientAdapterInternal(offscreenBrowserControl);
|
|
}
|
|
|
|
~RenderClientAdapter()
|
|
{
|
|
delete _renderClientAdapterInternal;
|
|
}
|
|
|
|
void CreateOffscreenBrowser(BrowserSettings^ browserSettings, IntPtr^ sourceHandle, Uri^ uri)
|
|
{
|
|
HWND hwnd = static_cast<HWND>(sourceHandle->ToPointer());
|
|
CefWindowInfo window;
|
|
window.SetAsOffScreen(hwnd);
|
|
CefString url = StringUtils::ToNative(uri->ToString());
|
|
|
|
CefBrowserHost::CreateBrowser(window, _renderClientAdapterInternal, url,
|
|
*(CefBrowserSettings*) browserSettings->_internalBrowserSettings);
|
|
}
|
|
|
|
void WasResized()
|
|
{
|
|
_renderClientAdapterInternal->WasResized();
|
|
}
|
|
};
|
|
}
|