electron/atom/app/atom_main_delegate.h

59 lines
1.8 KiB
C
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 09:49:37 +00:00
// Use of this source code is governed by the MIT license that can be
2013-04-12 01:46:58 +00:00
// found in the LICENSE file.
2014-03-16 00:58:59 +00:00
#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_H_
#define ATOM_APP_ATOM_MAIN_DELEGATE_H_
2013-04-12 01:46:58 +00:00
#include <memory>
2016-06-01 09:22:14 +00:00
#include <string>
#include "brightray/common/content_client.h"
2016-08-26 22:30:02 +00:00
#include "brightray/common/main_delegate.h"
2013-04-12 01:46:58 +00:00
namespace atom {
class AtomMainDelegate : public brightray::MainDelegate {
2013-04-12 15:16:16 +00:00
public:
2013-04-12 01:46:58 +00:00
AtomMainDelegate();
~AtomMainDelegate() override;
2013-04-12 01:46:58 +00:00
2013-04-20 06:03:55 +00:00
protected:
2014-07-16 07:05:02 +00:00
// content::ContentMainDelegate:
bool BasicStartupComplete(int* exit_code) override;
void PreSandboxStartup() override;
void PreContentInitialization() override;
content::ContentBrowserClient* CreateContentBrowserClient() override;
content::ContentRendererClient* CreateContentRendererClient() override;
2015-04-30 03:31:17 +00:00
content::ContentUtilityClient* CreateContentUtilityClient() override;
2016-06-01 09:22:14 +00:00
int RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) override;
2016-06-02 07:54:21 +00:00
#if defined(OS_MACOSX)
2016-06-01 09:22:14 +00:00
bool ShouldSendMachPort(const std::string& process_type) override;
bool DelaySandboxInitialization(const std::string& process_type) override;
2016-06-02 07:54:21 +00:00
#endif
// brightray::MainDelegate:
2016-05-23 01:59:39 +00:00
std::unique_ptr<brightray::ContentClient> CreateContentClient() override;
2014-12-29 17:35:08 +00:00
#if defined(OS_MACOSX)
void OverrideChildProcessPath() override;
void OverrideFrameworkBundlePath() override;
#endif
2013-04-20 03:19:25 +00:00
2013-04-12 15:16:16 +00:00
private:
2016-05-18 07:42:26 +00:00
#if defined(OS_MACOSX)
void SetUpBundleOverrides();
#endif
2016-05-23 01:59:39 +00:00
std::unique_ptr<content::ContentBrowserClient> browser_client_;
std::unique_ptr<content::ContentRendererClient> renderer_client_;
std::unique_ptr<content::ContentUtilityClient> utility_client_;
2013-04-12 01:46:58 +00:00
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
};
} // namespace atom
2014-03-16 00:58:59 +00:00
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_H_