atom_main_delegate.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <memory>
  7. #include <string>
  8. #include "content/public/app/content_main_delegate.h"
  9. #include "content/public/common/content_client.h"
  10. namespace atom {
  11. void LoadResourceBundle(const std::string& locale);
  12. class AtomMainDelegate : public content::ContentMainDelegate {
  13. public:
  14. AtomMainDelegate();
  15. ~AtomMainDelegate() override;
  16. protected:
  17. // content::ContentMainDelegate:
  18. bool BasicStartupComplete(int* exit_code) override;
  19. void PreSandboxStartup() override;
  20. void PreCreateMainMessageLoop() override;
  21. void PostEarlyInitialization(bool is_running_tests) override;
  22. content::ContentBrowserClient* CreateContentBrowserClient() override;
  23. content::ContentRendererClient* CreateContentRendererClient() override;
  24. content::ContentUtilityClient* CreateContentUtilityClient() override;
  25. int RunProcess(
  26. const std::string& process_type,
  27. const content::MainFunctionParams& main_function_params) override;
  28. #if defined(OS_MACOSX)
  29. bool ShouldSendMachPort(const std::string& process_type) override;
  30. bool DelaySandboxInitialization(const std::string& process_type) override;
  31. #endif
  32. bool ShouldLockSchemeRegistry() override;
  33. bool ShouldCreateFeatureList() override;
  34. private:
  35. #if defined(OS_MACOSX)
  36. void OverrideChildProcessPath();
  37. void OverrideFrameworkBundlePath();
  38. void SetUpBundleOverrides();
  39. #endif
  40. std::unique_ptr<content::ContentBrowserClient> browser_client_;
  41. std::unique_ptr<content::ContentClient> content_client_;
  42. std::unique_ptr<content::ContentRendererClient> renderer_client_;
  43. std::unique_ptr<content::ContentUtilityClient> utility_client_;
  44. DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
  45. };
  46. } // namespace atom
  47. #endif // ATOM_APP_ATOM_MAIN_DELEGATE_H_