Add team ID to base Bundle ID

This commit is contained in:
Cheng Zhao 2016-05-19 10:57:57 +09:00
parent 1032287511
commit a361d50b95

View file

@ -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