#include #include "WebBrowserHost.h" #include "WebClient.h" namespace Atomic { class WebClientPrivate : public CefClient { friend class WebClient; public: WebClientPrivate(WebClient* client) { webClient_ = client; webBrowserHost_ = webClient_->GetSubsystem(); } CefRefPtr GetRenderHandler() OVERRIDE { if (webClient_->renderHandler_.Null()) return nullptr; return webClient_->renderHandler_->GetCEFRenderHandler(); } virtual CefRefPtr GetLifeSpanHandler() OVERRIDE { return webBrowserHost_->GetCefLifeSpanHandler(); } bool OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) OVERRIDE { return false; } IMPLEMENT_REFCOUNTING(WebClientPrivate); private: WeakPtr webBrowserHost_; WeakPtr webClient_; }; WebClient::WebClient(Context* context) : Object(context) { d_ = new WebClientPrivate(this); } WebClient::~WebClient() { renderHandler_ = 0; //d_->Release(); } void WebClient::SetWebRenderHandler(WebRenderHandler* handler) { renderHandler_ = handler; } }