]> khamidou — GitHub mirrors - electron.git/commitdiff
mac: Avoid making frameworks_path for twice
authorCheng Zhao <zcbenz@gmail.com>
Tue, 14 Apr 2015 06:15:53 +0000 (14:15 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 14 Apr 2015 06:15:53 +0000 (14:15 +0800)
atom/browser/atom_browser_main_parts_mac.mm

index fe72beb5b9d75a8c7396cdbb3fcd3fda89703766..1de07dfc0e4409902e792b486afbca9a00c85e10 100644 (file)
@@ -4,12 +4,11 @@
 
 #include "atom/browser/atom_browser_main_parts.h"
 
-#import "atom/browser/mac/atom_application.h"
-#import "atom/browser/mac/atom_application_delegate.h"
-#include "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
+#include "atom/browser/mac/atom_application.h"
+#include "atom/browser/mac/atom_application_delegate.h"
+#include "base/mac/bundle_locations.h"
+#include "base/mac/foundation_util.h"
 #include "ui/base/l10n/l10n_util_mac.h"
-#import "vendor/brightray/common/mac/main_application_bundle.h"
 
 namespace atom {
 
@@ -23,12 +22,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
   AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
   [NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
 
-  base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
-      .Append("Contents")
-      .Append("Frameworks")
-      .Append(ATOM_PRODUCT_NAME " Framework.framework");
-  NSBundle* frameworkBundle = [NSBundle
-       bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
+  NSBundle* frameworkBundle = base::mac::FrameworkBundle();
   NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
                                             bundle:frameworkBundle];
   [mainNib instantiateWithOwner:application topLevelObjects:nil];