Use PRODUCT_NAME as application name

This commit is contained in:
Cheng Zhao 2014-12-29 09:44:34 -08:00
parent 22d5d40a66
commit 9bd517e623
2 changed files with 7 additions and 11 deletions

View file

@ -23,14 +23,15 @@ base::FilePath GetFrameworksPath() {
void AtomMainDelegate::OverrideFrameworkBundlePath() { void AtomMainDelegate::OverrideFrameworkBundlePath() {
base::mac::SetOverrideFrameworkBundlePath( base::mac::SetOverrideFrameworkBundlePath(
GetFrameworksPath().Append("Atom Framework.framework")); GetFrameworksPath().Append(PRODUCT_NAME " Framework.framework"));
} }
void AtomMainDelegate::OverrideChildProcessPath() { void AtomMainDelegate::OverrideChildProcessPath() {
base::FilePath helper_path = GetFrameworksPath().Append("Atom Helper.app") base::FilePath helper_path =
GetFrameworksPath().Append(PRODUCT_NAME " Helper.app")
.Append("Contents") .Append("Contents")
.Append("MacOS") .Append("MacOS")
.Append("Atom Helper"); .Append(PRODUCT_NAME " Helper");
PathService::Override(content::CHILD_PROCESS_EXE, helper_path); PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
} }

View file

@ -13,11 +13,6 @@
namespace atom { namespace atom {
std::string GetApplicationName() {
std::string name = brightray::MainApplicationBundlePath().BaseName().AsUTF8Unsafe();
return name.substr(0, name.length() - 4/*.app*/);
}
void AtomBrowserMainParts::PreMainMessageLoopStart() { void AtomBrowserMainParts::PreMainMessageLoopStart() {
// Initialize locale setting. // Initialize locale setting.
l10n_util::OverrideLocaleWithCocoaLocale(); l10n_util::OverrideLocaleWithCocoaLocale();
@ -31,7 +26,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
base::FilePath frameworkPath = brightray::MainApplicationBundlePath() base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
.Append("Contents") .Append("Contents")
.Append("Frameworks") .Append("Frameworks")
.Append(GetApplicationName() + " Framework.framework"); .Append(PRODUCT_NAME " Framework.framework");
NSBundle* frameworkBundle = [NSBundle NSBundle* frameworkBundle = [NSBundle
bundleWithPath:base::mac::FilePathToNSString(frameworkPath)]; bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu" NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"