2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2011 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 CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "libcef/common/content_client.h"
|
|
|
|
#include "include/cef_app.h"
|
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "content/public/app/content_main_delegate.h"
|
|
|
|
|
2012-04-11 20:00:55 +02:00
|
|
|
namespace base {
|
2016-10-17 20:14:44 +02:00
|
|
|
class CommandLine;
|
2012-04-11 20:00:55 +02:00
|
|
|
class Thread;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
namespace content {
|
|
|
|
class BrowserMainRunner;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CefContentBrowserClient;
|
|
|
|
class CefContentRendererClient;
|
|
|
|
class CefContentUtilityClient;
|
|
|
|
|
|
|
|
class CefMainDelegate : public content::ContentMainDelegate {
|
|
|
|
public:
|
|
|
|
explicit CefMainDelegate(CefRefPtr<CefApp> application);
|
2014-11-12 20:25:15 +01:00
|
|
|
~CefMainDelegate() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-11-12 20:25:15 +01:00
|
|
|
bool BasicStartupComplete(int* exit_code) override;
|
|
|
|
void PreSandboxStartup() override;
|
2015-07-16 23:40:01 +02:00
|
|
|
void SandboxInitialized(const std::string& process_type) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
int RunProcess(
|
2012-04-03 03:34:16 +02:00
|
|
|
const std::string& process_type,
|
2014-11-12 20:25:15 +01:00
|
|
|
const content::MainFunctionParams& main_function_params) override;
|
|
|
|
void ProcessExiting(const std::string& process_type) override;
|
2013-11-21 23:43:36 +01:00
|
|
|
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
|
2014-11-12 20:25:15 +01:00
|
|
|
void ZygoteForked() override;
|
2013-11-21 23:43:36 +01:00
|
|
|
#endif
|
2014-11-12 20:25:15 +01:00
|
|
|
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
|
|
|
content::ContentRendererClient*
|
|
|
|
CreateContentRendererClient() override;
|
|
|
|
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Shut down the browser runner.
|
|
|
|
void ShutdownBrowser();
|
|
|
|
|
|
|
|
CefContentBrowserClient* browser_client() { return browser_client_.get(); }
|
|
|
|
CefContentClient* content_client() { return &content_client_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void InitializeResourceBundle();
|
|
|
|
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<content::BrowserMainRunner> browser_runner_;
|
|
|
|
std::unique_ptr<base::Thread> ui_thread_;
|
2012-04-11 20:00:55 +02:00
|
|
|
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefContentBrowserClient> browser_client_;
|
|
|
|
std::unique_ptr<CefContentRendererClient> renderer_client_;
|
|
|
|
std::unique_ptr<CefContentUtilityClient> utility_client_;
|
2012-04-03 03:34:16 +02:00
|
|
|
CefContentClient content_client_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefMainDelegate);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_
|