Version: 3.3.0
wxDelegatingCefClient Class Reference

#include <wx/webview_chromium_impl.h>

+ Inheritance diagram for wxDelegatingCefClient:

Detailed Description

Helper class to simplify creating custom CefClient subclasses.

Please note that the application including this header must set up the compiler options to include the CEF directory as one of the include paths, as this header – unlike wx/webview_chromium.h – includes CEF headers.

Here is a simple example of using this class to customize processing the messages received from the other CEF processes:

struct CustomClient : wxDelegatingCefClient
{
using wxDelegatingCefClient::wxDelegatingCefClient;
static CefClient* Create(CefClient* client, void* WXUNUSED(data)
{
return new CustomClient(client);
}
bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message) override
{
// Handle the message here.
return true; // or false if not handled
}
};
void MyFunction()
{
wxWebViewConfiguration config = wxWebView::NewConfiguration(wxWebViewBackendChromium);
auto configChrome =
configChrome->m_clientCreate = &CustomClient::Create;
auto webview = new wxWebViewChromium(config);
if ( !webview->Create(this, wxID_ANY, url) )
{
// Handle error.
}
}
Helper class to simplify creating custom CefClient subclasses.
Definition: webview_chromium_impl.h:63
wxWebViewChromium is a Chromium-based backend for wxWebView using the Chromium Embedded Framework (CE...
Definition: webview_chromium.h:280
Chromium-specific configuration parameters.
Definition: webview_chromium.h:365
CefClient *(* m_clientCreate)(CefClient *client, void *data)
Function to create the custom CefClient to use if non-null.
Definition: webview_chromium.h:416
This class allows access to web view configuration options and settings, that have to be specified be...
Definition: webview.h:297
virtual void * GetNativeConfiguration() const
Returns the pointer to the native configuration used during creation of a wxWebView.
static wxWebViewConfiguration NewConfiguration(const wxString &backend=wxWebViewBackendDefault)
Create a new wxWebViewConfiguration object.
@ wxID_ANY
Any id: means that we don't care about the id, whether when installing an event handler or when creat...
Definition: defs.h:591
Since
3.3.0
Category:  WebView