diff --git a/atom/atom_application.h b/atom/atom_application.h index 82908842c..49e1226d2 100644 --- a/atom/atom_application.h +++ b/atom/atom_application.h @@ -11,7 +11,7 @@ class AtomCefClient; BOOL handlingSendEvent_; } -+ (void)populateAppSettings:(CefSettings &)settings; ++ (CefSettings)createCefSettings; - (void)open:(NSString *)path; - (IBAction)runSpecs:(id)sender; - (IBAction)runBenchmarks:(id)sender; diff --git a/atom/atom_application.mm b/atom/atom_application.mm index db6890325..cab29a59a 100644 --- a/atom/atom_application.mm +++ b/atom/atom_application.mm @@ -7,29 +7,23 @@ @implementation AtomApplication + (id)sharedApplication { - id atomApp = [super sharedApplication]; - - CefSettings settings; - [self populateAppSettings:settings]; - - CefMainArgs mainArgs(0, NULL); - CefRefPtr app(new AtomCefApp); - - CefInitialize(mainArgs, settings, app.get()); - - return atomApp; + NSApplication *application = [super sharedApplication]; + CefInitialize(CefMainArgs(0, NULL), [self createCefSettings], new AtomCefApp); + return application; } - -+ (void)populateAppSettings:(CefSettings &)settings { + ++ (CefSettings)createCefSettings { + CefSettings settings; CefString(&settings.cache_path) = ""; CefString(&settings.user_agent) = ""; CefString(&settings.log_file) = ""; - CefString(&settings.javascript_flags) = ""; - + CefString(&settings.javascript_flags) = ""; settings.remote_debugging_port = 9090; settings.log_severity = LOGSEVERITY_ERROR; + return settings; } + - (void)dealloc { [_backgroundWindow release]; [super dealloc];