atom_library_main.mm 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #include "atom/app/atom_library_main.h"
  5. #include "atom/app/atom_main_delegate.h"
  6. #include "atom/app/node_main.h"
  7. #include "atom/common/atom_command_line.h"
  8. #include "base/at_exit.h"
  9. #include "base/i18n/icu_util.h"
  10. #include "base/mac/bundle_locations.h"
  11. #include "base/mac/scoped_nsautorelease_pool.h"
  12. #include "brightray/common/mac/main_application_bundle.h"
  13. #include "content/public/app/content_main.h"
  14. int AtomMain(int argc, char* argv[]) {
  15. atom::AtomMainDelegate delegate;
  16. content::ContentMainParams params(&delegate);
  17. params.argc = argc;
  18. params.argv = const_cast<const char**>(argv);
  19. atom::AtomCommandLine::Init(argc, argv);
  20. return content::ContentMain(params);
  21. }
  22. #ifdef ENABLE_RUN_AS_NODE
  23. int AtomInitializeICUandStartNode(int argc, char* argv[]) {
  24. base::AtExitManager atexit_manager;
  25. base::mac::ScopedNSAutoreleasePool pool;
  26. base::mac::SetOverrideFrameworkBundlePath(
  27. brightray::MainApplicationBundlePath()
  28. .Append("Contents")
  29. .Append("Frameworks")
  30. .Append(ATOM_PRODUCT_NAME " Framework.framework"));
  31. base::i18n::InitializeICU();
  32. return atom::NodeMain(argc, argv);
  33. }
  34. #endif