electron/atom/app/atom_library_main.mm

39 lines
1.3 KiB
Text
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:30:26 +00:00
#include "atom/app/atom_library_main.h"
2013-04-12 01:46:58 +00:00
2014-03-16 00:30:26 +00:00
#include "atom/app/atom_main_delegate.h"
#include "atom/app/node_main.h"
2015-06-19 15:11:53 +00:00
#include "atom/common/atom_command_line.h"
#include "base/at_exit.h"
2015-01-16 23:54:38 +00:00
#include "base/i18n/icu_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/scoped_nsautorelease_pool.h"
2015-01-16 23:54:38 +00:00
#include "brightray/common/mac/main_application_bundle.h"
2013-04-12 01:46:58 +00:00
#include "content/public/app/content_main.h"
2013-07-01 14:21:31 +00:00
#if defined(OS_MACOSX)
int AtomMain(int argc, char* argv[]) {
2013-04-12 01:46:58 +00:00
atom::AtomMainDelegate delegate;
2014-06-30 03:44:05 +00:00
content::ContentMainParams params(&delegate);
params.argc = argc;
params.argv = const_cast<const char**>(argv);
atom::AtomCommandLine::Init(argc, argv);
2014-06-30 03:44:05 +00:00
return content::ContentMain(params);
2013-04-12 01:46:58 +00:00
}
2015-01-16 23:54:38 +00:00
int AtomInitializeICUandStartNode(int argc, char *argv[]) {
base::AtExitManager atexit_manager;
base::mac::ScopedNSAutoreleasePool pool;
2015-01-16 23:54:38 +00:00
base::mac::SetOverrideFrameworkBundlePath(
brightray::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")
2015-04-14 06:13:03 +00:00
.Append(ATOM_PRODUCT_NAME " Framework.framework"));
2015-01-16 23:54:38 +00:00
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
2015-01-16 23:54:38 +00:00
}
2013-07-01 14:21:31 +00:00
#endif // OS_MACOSX