#ifndef _BROWSER_CLIENT_APP_BROWSER_H_
|
#define _BROWSER_CLIENT_APP_BROWSER_H_
|
#include <set>
|
#include "Cef3ClientApp.h"
|
|
|
namespace browser {
|
|
// Client app implementation for the browser process.
|
class CCef3ClientAppBrowser : public CCef3ClientApp,
|
public CefBrowserProcessHandler,CefRenderProcessHandler {
|
public:
|
// Interface for browser delegates. All Delegates must be returned via
|
// CreateDelegates. Do not perform work in the Delegate
|
// constructor. See CefBrowserProcessHandler for documentation.
|
class Delegate : public virtual CefBaseRefCounted {
|
public:
|
virtual void OnBeforeCommandLineProcessing(
|
CefRefPtr<CCef3ClientAppBrowser> app,
|
CefRefPtr<CefCommandLine> command_line) {}
|
|
virtual void OnContextInitialized(CefRefPtr<CCef3ClientAppBrowser> app) {}
|
|
virtual void OnBeforeChildProcessLaunch(
|
CefRefPtr<CCef3ClientAppBrowser> app,
|
CefRefPtr<CefCommandLine> command_line) {}
|
|
virtual void OnRenderProcessThreadCreated(
|
CefRefPtr<CCef3ClientAppBrowser> app,
|
CefRefPtr<CefListValue> extra_info) {}
|
};
|
|
typedef std::set<CefRefPtr<Delegate> > DelegateSet;
|
|
CCef3ClientAppBrowser();
|
|
private:
|
// Creates all of the Delegate objects. Implemented by cefclient in
|
// client_app_delegates_browser.cc
|
static void CreateDelegates(DelegateSet& delegates);
|
|
// Create the Linux print handler. Implemented by cefclient in
|
// client_app_delegates_browser.cc
|
static CefRefPtr<CefPrintHandler> CreatePrintHandler();
|
|
// CefApp methods.
|
void OnBeforeCommandLineProcessing(
|
const CefString& process_type,
|
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
|
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() OVERRIDE {
|
return this;
|
}
|
|
// CefBrowserProcessHandler methods.
|
void OnContextInitialized() OVERRIDE;
|
void OnBeforeChildProcessLaunch(
|
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
|
void OnRenderProcessThreadCreated(
|
CefRefPtr<CefListValue> extra_info) OVERRIDE;
|
CefRefPtr<CefPrintHandler> GetPrintHandler() OVERRIDE {
|
return print_handler_;
|
}
|
|
|
|
|
// Set of supported Delegates.
|
DelegateSet delegates_;
|
|
|
|
CefRefPtr<CefPrintHandler> print_handler_;
|
|
IMPLEMENT_REFCOUNTING(CCef3ClientAppBrowser);
|
DISALLOW_COPY_AND_ASSIGN(CCef3ClientAppBrowser);
|
};
|
|
} // namespace browser
|
|
#endif // _BROWSER_CLIENT_APP_BROWSER_H_
|