#pragma once #include #include "CEF/HumanApp.h" // Implement application-level callbacks for the browser process. class HumanAppBrowser : public HumanApp, public CefBrowserProcessHandler { public: class Delegate : public virtual CefBaseRefCounted { public: virtual void OnBeforeCommandLineProcessing( CefRefPtr app, CefRefPtr command_line) {} virtual void OnContextInitialized(CefRefPtr app) {} virtual void OnBeforeChildProcessLaunch( CefRefPtr app, CefRefPtr command_line) {} }; using DelegateSet = std::set>; HumanAppBrowser(); static void PopulateSettings(CefRefPtr command_line, CefSettings& settings); private: void OnBeforeCommandLineProcessing( const CefString& process_type, CefRefPtr command_line) override; CefRefPtr GetBrowserProcessHandler() override { return this; } // CefBrowserProcessHandler methods. void OnContextInitialized() override; void OnBeforeChildProcessLaunch( CefRefPtr command_line) override; void OnScheduleMessagePumpWork(int64 delay) override; DelegateSet delegates_; IMPLEMENT_REFCOUNTING(HumanAppBrowser); DISALLOW_COPY_AND_ASSIGN(HumanAppBrowser); };