electron/brightray/browser/browser_main_parts_mac.mm
Adam Roben 1a1fecf423 Bump the base SDK and deployment target to 10.8
This required working around an incompatibility in base/mac/foundation_util.h.
2013-03-28 17:50:07 -04:00

21 lines
717 B
Text

#import "browser_main_parts.h"
#import "base/mac/bundle_locations.h"
#import <AppKit/AppKit.h>
namespace brightray {
// Replicates NSApplicationMain, but doesn't start a run loop.
void BrowserMainParts::PreMainMessageLoopStart() {
auto infoDictionary = base::mac::OuterBundle().infoDictionary;
auto principalClass = NSClassFromString([infoDictionary objectForKey:@"NSPrincipalClass"]);
auto application = [principalClass sharedApplication];
NSString *mainNibName = [infoDictionary objectForKey:@"NSMainNibFile"];
auto mainNib = [[NSNib alloc] initWithNibNamed:mainNibName bundle:base::mac::FrameworkBundle()];
[mainNib instantiateWithOwner:application topLevelObjects:nil];
[mainNib release];
}
}