2017-05-18 22:58:12 +00:00
|
|
|
#import "brightray/browser/browser_main_parts.h"
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2014-01-31 15:38:12 +00:00
|
|
|
#import "base/logging.h"
|
2013-03-13 19:12:05 +00:00
|
|
|
#import "base/mac/bundle_locations.h"
|
|
|
|
#import <AppKit/AppKit.h>
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
// Replicates NSApplicationMain, but doesn't start a run loop.
|
2014-07-03 08:12:12 +00:00
|
|
|
void BrowserMainParts::InitializeMainNib() {
|
2013-03-13 19:12:05 +00:00
|
|
|
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()];
|
2013-03-28 21:16:35 +00:00
|
|
|
[mainNib instantiateWithOwner:application topLevelObjects:nil];
|
2013-03-13 19:12:05 +00:00
|
|
|
[mainNib release];
|
|
|
|
}
|
|
|
|
|
2017-03-31 18:18:20 +00:00
|
|
|
} // namespace brightray
|