atom_main_delegate.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (c) 2013 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_APP_ATOM_MAIN_DELEGATE_H_
  5. #define ATOM_APP_ATOM_MAIN_DELEGATE_H_
  6. #include <string>
  7. #include "brightray/common/content_client.h"
  8. #include "brightray/common/main_delegate.h"
  9. namespace atom {
  10. class AtomMainDelegate : public brightray::MainDelegate {
  11. public:
  12. AtomMainDelegate();
  13. ~AtomMainDelegate() override;
  14. protected:
  15. // content::ContentMainDelegate:
  16. bool BasicStartupComplete(int* exit_code) override;
  17. void PreSandboxStartup() override;
  18. content::ContentBrowserClient* CreateContentBrowserClient() override;
  19. content::ContentRendererClient* CreateContentRendererClient() override;
  20. content::ContentUtilityClient* CreateContentUtilityClient() override;
  21. int RunProcess(
  22. const std::string& process_type,
  23. const content::MainFunctionParams& main_function_params) override;
  24. #if defined(OS_MACOSX)
  25. bool ShouldSendMachPort(const std::string& process_type) override;
  26. bool DelaySandboxInitialization(const std::string& process_type) override;
  27. #endif
  28. // brightray::MainDelegate:
  29. std::unique_ptr<brightray::ContentClient> CreateContentClient() override;
  30. #if defined(OS_MACOSX)
  31. void OverrideChildProcessPath() override;
  32. void OverrideFrameworkBundlePath() override;
  33. #endif
  34. private:
  35. #if defined(OS_MACOSX)
  36. void SetUpBundleOverrides();
  37. #endif
  38. std::unique_ptr<content::ContentBrowserClient> browser_client_;
  39. std::unique_ptr<content::ContentRendererClient> renderer_client_;
  40. std::unique_ptr<content::ContentUtilityClient> utility_client_;
  41. DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
  42. };
  43. } // namespace atom
  44. #endif // ATOM_APP_ATOM_MAIN_DELEGATE_H_