Pass argc and argv to CefInitialize

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-09-05 10:55:28 -07:00
parent 31d56b31ea
commit 949abdcd19
3 changed files with 6 additions and 5 deletions

View File

@@ -4,13 +4,13 @@
class AtomCefClient;
@interface AtomApplication : NSApplication <CefAppProtocol, NSApplicationDelegate> {
@private
NSWindowController *_backgroundWindowController;
BOOL handlingSendEvent_;
}
+ (id)applicationWithArguments:(char **)argv count:(int)argc;
+ (CefSettings)createCefSettings;
- (const char *)resourcePath;
- (void)open:(NSString *)path;
- (IBAction)runSpecs:(id)sender;
- (IBAction)runBenchmarks:(id)sender;

View File

@@ -6,9 +6,10 @@
@implementation AtomApplication
+ (id)sharedApplication {
+ (id)applicationWithArguments:(char **)argv count:(int)argc {
NSApplication *application = [super sharedApplication];
CefInitialize(CefMainArgs(0, NULL), [self createCefSettings], new AtomCefApp);
CefInitialize(CefMainArgs(argc, argv), [self createCefSettings], new AtomCefApp);
return application;
}

View File

@@ -4,7 +4,7 @@
int main(int argc, char* argv[]) {
@autoreleasepool {
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
AtomApplication *application = (AtomApplication *)[AtomApplication sharedApplication];
AtomApplication *application = [AtomApplication applicationWithArguments:argv count:argc];
NSString *mainNibName = [infoDictionary objectForKey:@"NSMainNibFile"];
NSNib *mainNib = [[NSNib alloc] initWithNibNamed:mainNibName bundle:[NSBundle mainBundle]];