blob: 2a1510fc55fff1b18f267e324a625b6b269efc6c [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_APP_SHELL_MAIN_DELEGATE_H_
#define CONTENT_SHELL_APP_SHELL_MAIN_DELEGATE_H_
#include <memory>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "content/public/app/content_main_delegate.h"
namespace content {
class ContentClient;
class ShellContentBrowserClient;
class ShellContentGpuClient;
class ShellContentRendererClient;
class ShellContentUtilityClient;
class ShellMainDelegate : public ContentMainDelegate {
public:
explicit ShellMainDelegate(bool is_browsertest = false);
~ShellMainDelegate() override;
// ContentMainDelegate implementation:
bool BasicStartupComplete(int* exit_code) override;
void PreSandboxStartup() override;
int RunProcess(const std::string& process_type,
const MainFunctionParams& main_function_params) override;
#if defined(OS_LINUX)
void ZygoteForked() override;
#endif
void PreCreateMainMessageLoop() override;
ContentBrowserClient* CreateContentBrowserClient() override;
ContentGpuClient* CreateContentGpuClient() override;
ContentRendererClient* CreateContentRendererClient() override;
ContentUtilityClient* CreateContentUtilityClient() override;
static void InitializeResourceBundle();
private:
bool is_browsertest_;
std::unique_ptr<ShellContentBrowserClient> browser_client_;
std::unique_ptr<ShellContentGpuClient> gpu_client_;
std::unique_ptr<ShellContentRendererClient> renderer_client_;
std::unique_ptr<ShellContentUtilityClient> utility_client_;
std::unique_ptr<ContentClient> content_client_;
DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate);
};
} // namespace content
#endif // CONTENT_SHELL_APP_SHELL_MAIN_DELEGATE_H_