From 949abdcd19827eb9a8ac5901293cef4ef2029c15 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Wed, 5 Sep 2012 10:55:28 -0700 Subject: [PATCH] Pass argc and argv to CefInitialize --- native/atom_application.h | 4 ++-- native/atom_application.mm | 5 +++-- native/main_mac.mm | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/native/atom_application.h b/native/atom_application.h index 1595ca3d8..6236de158 100644 --- a/native/atom_application.h +++ b/native/atom_application.h @@ -4,13 +4,13 @@ class AtomCefClient; @interface AtomApplication : NSApplication { -@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; diff --git a/native/atom_application.mm b/native/atom_application.mm index c0e31848f..7a7b3dd6f 100644 --- a/native/atom_application.mm +++ b/native/atom_application.mm @@ -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; } diff --git a/native/main_mac.mm b/native/main_mac.mm index b5da62358..bbed2bd8a 100644 --- a/native/main_mac.mm +++ b/native/main_mac.mm @@ -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]];