From 9bd517e623c46a886b7daa2085ddc4dd7989424c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 29 Dec 2014 09:44:34 -0800 Subject: [PATCH] Use PRODUCT_NAME as application name --- atom/app/atom_main_delegate_mac.mm | 11 ++++++----- atom/browser/atom_browser_main_parts_mac.mm | 7 +------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm index 37fdf0664796..7232817c94ff 100644 --- a/atom/app/atom_main_delegate_mac.mm +++ b/atom/app/atom_main_delegate_mac.mm @@ -23,14 +23,15 @@ base::FilePath GetFrameworksPath() { void AtomMainDelegate::OverrideFrameworkBundlePath() { base::mac::SetOverrideFrameworkBundlePath( - GetFrameworksPath().Append("Atom Framework.framework")); + GetFrameworksPath().Append(PRODUCT_NAME " Framework.framework")); } void AtomMainDelegate::OverrideChildProcessPath() { - base::FilePath helper_path = GetFrameworksPath().Append("Atom Helper.app") - .Append("Contents") - .Append("MacOS") - .Append("Atom Helper"); + base::FilePath helper_path = + GetFrameworksPath().Append(PRODUCT_NAME " Helper.app") + .Append("Contents") + .Append("MacOS") + .Append(PRODUCT_NAME " Helper"); PathService::Override(content::CHILD_PROCESS_EXE, helper_path); } diff --git a/atom/browser/atom_browser_main_parts_mac.mm b/atom/browser/atom_browser_main_parts_mac.mm index c1a9eae3147f..3e80eac223a5 100644 --- a/atom/browser/atom_browser_main_parts_mac.mm +++ b/atom/browser/atom_browser_main_parts_mac.mm @@ -13,11 +13,6 @@ namespace atom { -std::string GetApplicationName() { - std::string name = brightray::MainApplicationBundlePath().BaseName().AsUTF8Unsafe(); - return name.substr(0, name.length() - 4/*.app*/); -} - void AtomBrowserMainParts::PreMainMessageLoopStart() { // Initialize locale setting. l10n_util::OverrideLocaleWithCocoaLocale(); @@ -31,7 +26,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() { base::FilePath frameworkPath = brightray::MainApplicationBundlePath() .Append("Contents") .Append("Frameworks") - .Append(GetApplicationName() + " Framework.framework"); + .Append(PRODUCT_NAME " Framework.framework"); NSBundle* frameworkBundle = [NSBundle bundleWithPath:base::mac::FilePathToNSString(frameworkPath)]; NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"