Browse Source

Add team ID to base Bundle ID

Cheng Zhao 9 years ago
parent
commit
a361d50b95
1 changed files with 8 additions and 2 deletions
  1. 8 2
      atom/app/atom_main_delegate_mac.mm

+ 8 - 2
atom/app/atom_main_delegate_mac.mm

@@ -10,6 +10,7 @@
 #include "base/mac/foundation_util.h"
 #include "base/mac/scoped_nsautorelease_pool.h"
 #include "base/path_service.h"
+#include "base/strings/sys_string_conversions.h"
 #include "brightray/common/application_info.h"
 #include "brightray/common/mac/main_application_bundle.h"
 #include "content/public/common/content_paths.h"
@@ -52,8 +53,13 @@ void AtomMainDelegate::OverrideChildProcessPath() {
 
 void AtomMainDelegate::SetUpBundleOverrides() {
   base::mac::ScopedNSAutoreleasePool pool;
-  NSBundle* base_bundle = brightray::MainApplicationBundle();
-  base::mac::SetBaseBundleID([[base_bundle bundleIdentifier] UTF8String]);
+  NSBundle* bundle = brightray::MainApplicationBundle();
+  std::string base_bundle_id =
+      base::SysNSStringToUTF8([bundle bundleIdentifier]);
+  NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
+  if (team_id)
+    base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
+  base::mac::SetBaseBundleID(base_bundle_id.c_str());
 }
 
 }  // namespace atom