2014-10-31 18:17:05 +00:00
|
|
|
// 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.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_APP_ATOM_MAIN_DELEGATE_H_
|
|
|
|
#define SHELL_APP_ATOM_MAIN_DELEGATE_H_
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2018-09-13 00:25:56 +00:00
|
|
|
#include <memory>
|
2016-06-01 09:22:14 +00:00
|
|
|
#include <string>
|
|
|
|
|
2018-10-23 12:16:13 +00:00
|
|
|
#include "content/public/app/content_main_delegate.h"
|
2018-10-22 17:04:23 +00:00
|
|
|
#include "content/public/common/content_client.h"
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2019-11-22 02:05:41 +00:00
|
|
|
namespace tracing {
|
|
|
|
class TracingSamplerProfiler;
|
|
|
|
}
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2018-10-23 12:16:13 +00:00
|
|
|
void LoadResourceBundle(const std::string& locale);
|
|
|
|
|
|
|
|
class AtomMainDelegate : public content::ContentMainDelegate {
|
2013-04-12 15:16:16 +00:00
|
|
|
public:
|
2013-04-12 01:46:58 +00:00
|
|
|
AtomMainDelegate();
|
2018-04-17 23:03:51 +00:00
|
|
|
~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:
|
2014-11-21 08:40:47 +00:00
|
|
|
bool BasicStartupComplete(int* exit_code) override;
|
|
|
|
void PreSandboxStartup() override;
|
2018-10-25 06:02:58 +00:00
|
|
|
void PreCreateMainMessageLoop() override;
|
2019-01-10 16:19:25 +00:00
|
|
|
void PostEarlyInitialization(bool is_running_tests) override;
|
2014-11-21 08:40:47 +00:00
|
|
|
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
2019-04-30 16:45:48 +00:00
|
|
|
content::ContentGpuClient* CreateContentGpuClient() override;
|
2014-11-21 08:40:47 +00:00
|
|
|
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 DelaySandboxInitialization(const std::string& process_type) override;
|
2016-06-02 07:54:21 +00:00
|
|
|
#endif
|
2018-11-22 17:02:52 +00:00
|
|
|
bool ShouldLockSchemeRegistry() override;
|
2019-01-12 01:00:43 +00:00
|
|
|
bool ShouldCreateFeatureList() override;
|
2013-09-12 09:51:45 +00:00
|
|
|
|
2013-04-12 15:16:16 +00:00
|
|
|
private:
|
2016-05-18 07:42:26 +00:00
|
|
|
#if defined(OS_MACOSX)
|
2018-10-23 12:16:13 +00:00
|
|
|
void OverrideChildProcessPath();
|
|
|
|
void OverrideFrameworkBundlePath();
|
2016-05-18 07:42:26 +00:00
|
|
|
void SetUpBundleOverrides();
|
|
|
|
#endif
|
|
|
|
|
2016-05-23 01:59:39 +00:00
|
|
|
std::unique_ptr<content::ContentBrowserClient> browser_client_;
|
2018-10-22 17:04:23 +00:00
|
|
|
std::unique_ptr<content::ContentClient> content_client_;
|
2019-04-30 16:45:48 +00:00
|
|
|
std::unique_ptr<content::ContentGpuClient> gpu_client_;
|
2016-05-23 01:59:39 +00:00
|
|
|
std::unique_ptr<content::ContentRendererClient> renderer_client_;
|
|
|
|
std::unique_ptr<content::ContentUtilityClient> utility_client_;
|
2019-11-22 02:05:41 +00:00
|
|
|
std::unique_ptr<tracing::TracingSamplerProfiler> tracing_sampler_profiler_;
|
2013-04-12 01:46:58 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_APP_ATOM_MAIN_DELEGATE_H_
|