]> khamidou — GitHub mirrors - electron.git/commitdiff
Revert #898
authorCheng Zhao <zcbenz@gmail.com>
Mon, 29 Dec 2014 17:35:08 +0000 (09:35 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 29 Dec 2014 17:35:08 +0000 (09:35 -0800)
atom.gyp
atom/app/atom_main_delegate.h
atom/app/atom_main_delegate_mac.mm [new file with mode: 0644]

index 345474b5b6dea9879944113bdaf619b1953757fe..3a0f8cbb7331727178049c115cd0c4083b2edfee 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
@@ -60,6 +60,7 @@
       'atom/app/atom_content_client.h',
       'atom/app/atom_main_delegate.cc',
       'atom/app/atom_main_delegate.h',
+      'atom/app/atom_main_delegate_mac.mm',
       'atom/browser/api/atom_api_app.cc',
       'atom/browser/api/atom_api_app.h',
       'atom/browser/api/atom_api_auto_updater.cc',
index 9f74386304a14db8fd6012092ea91ccf69d0ebbb..8cd4a28ee1c076d0599cad56586472850193ce80 100644 (file)
@@ -26,6 +26,10 @@ class AtomMainDelegate : public brightray::MainDelegate {
   scoped_ptr<brightray::ContentClient> CreateContentClient() override;
   void AddDataPackFromPath(
       ui::ResourceBundle* bundle, const base::FilePath& pak_dir) override;
+#if defined(OS_MACOSX)
+  void OverrideChildProcessPath() override;
+  void OverrideFrameworkBundlePath() override;
+#endif
 
  private:
   brightray::ContentClient content_client_;
diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm
new file mode 100644 (file)
index 0000000..37fdf06
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright (c) 2014 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#include "atom/app/atom_main_delegate.h"
+
+#include "base/mac/bundle_locations.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "brightray/common/mac/main_application_bundle.h"
+#include "content/public/common/content_paths.h"
+
+namespace atom {
+
+namespace {
+
+base::FilePath GetFrameworksPath() {
+  return brightray::MainApplicationBundlePath().Append("Contents")
+                                               .Append("Frameworks");
+}
+
+}  // namespace
+
+void AtomMainDelegate::OverrideFrameworkBundlePath() {
+  base::mac::SetOverrideFrameworkBundlePath(
+      GetFrameworksPath().Append("Atom Framework.framework"));
+}
+
+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