#ifndef CHROME_APP_CHROME_MAIN_DELEGATE_H_
#define CHROME_APP_CHROME_MAIN_DELEGATE_H_
#include "base/memory/scoped_ptr.h"
#include "base/metrics/stats_counters.h"
#include "chrome/common/chrome_content_client.h"
#include "content/public/app/content_main_delegate.h"
namespace base {
class CommandLine;
}
class ChromeMainDelegate : public content::ContentMainDelegate {
public:
ChromeMainDelegate();
virtual ~ChromeMainDelegate();
protected:
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
virtual void PreSandboxStartup() OVERRIDE;
virtual void SandboxInitialized(const std::string& process_type) OVERRIDE;
virtual int RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) OVERRIDE;
virtual void ProcessExiting(const std::string& process_type) OVERRIDE;
#if defined(OS_MACOSX)
virtual bool ProcessRegistersWithSystemProcess(
const std::string& process_type) OVERRIDE;
virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE;
virtual bool DelaySandboxInitialization(
const std::string& process_type) OVERRIDE;
#elif defined(OS_POSIX) && !defined(OS_ANDROID)
virtual content::ZygoteForkDelegate* ZygoteStarting() OVERRIDE;
virtual void ZygoteForked() OVERRIDE;
#endif
virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
virtual content::ContentPluginClient* CreateContentPluginClient() OVERRIDE;
virtual content::ContentRendererClient*
CreateContentRendererClient() OVERRIDE;
virtual content::ContentUtilityClient* CreateContentUtilityClient() OVERRIDE;
#if defined(OS_MACOSX)
void InitMacCrashReporter(const base::CommandLine& command_line,
const std::string& process_type);
#endif
ChromeContentClient chrome_content_client_;
scoped_ptr<base::StatsCounterTimer> stats_counter_timer_;
scoped_ptr<base::StatsScope<base::StatsCounterTimer> > startup_timer_;
DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate);
};
#endif