2013-09-12 09:51:45 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:30:26 +00:00
|
|
|
#include "atom/app/atom_main_delegate.h"
|
2013-09-12 09:51:45 +00:00
|
|
|
|
|
|
|
#import "base/mac/bundle_locations.h"
|
|
|
|
#import "base/mac/foundation_util.h"
|
|
|
|
#import "base/mac/mac_util.h"
|
|
|
|
#include "base/command_line.h"
|
|
|
|
#include "base/path_service.h"
|
|
|
|
#include "base/strings/sys_string_conversions.h"
|
|
|
|
#include "content/public/common/content_paths.h"
|
|
|
|
#include "content/public/common/content_switches.h"
|
|
|
|
#include "vendor/brightray/common/application_info.h"
|
|
|
|
#include "vendor/brightray/common/mac/main_application_bundle.h"
|
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
base::FilePath GetFrameworksPath() {
|
|
|
|
return brightray::MainApplicationBundlePath().Append("Contents")
|
|
|
|
.Append("Frameworks");
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
base::FilePath AtomMainDelegate::GetResourcesPakFilePath() {
|
|
|
|
NSString* path = [base::mac::FrameworkBundle()
|
|
|
|
pathForResource:@"content_shell" ofType:@"pak"];
|
|
|
|
return base::mac::NSStringToFilePath(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AtomMainDelegate::OverrideFrameworkBundlePath() {
|
|
|
|
base::mac::SetOverrideFrameworkBundlePath(
|
2013-11-25 07:37:39 +00:00
|
|
|
GetFrameworksPath().Append("Atom Framework.framework"));
|
2013-09-12 09:51:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AtomMainDelegate::OverrideChildProcessPath() {
|
|
|
|
base::FilePath helper_path = GetFrameworksPath().Append("Atom Helper.app")
|
|
|
|
.Append("Contents")
|
|
|
|
.Append("MacOS")
|
|
|
|
.Append("Atom Helper");
|
|
|
|
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace atom
|