Files
atom/native/atom_cef_client_mac.mm
Nathan Sobo 16c7c523cf Native open code now presents the open panel from the browser process
This avoids retina resolution issues and ink framework errors that occur when opening dialogs from the chromium renderer process.
2012-08-28 13:54:44 -05:00

19 lines
632 B
Plaintext

#import <AppKit/AppKit.h>
#import "include/cef_browser.h"
#import "include/cef_frame.h"
#import "native/atom_cef_client.h"
#import "atom_application.h"
void AtomCefClient::Open(std::string path) {
NSString *pathString = [NSString stringWithCString:path.c_str() encoding:NSUTF8StringEncoding];
[(AtomApplication *)[AtomApplication sharedApplication] open:pathString];
}
void AtomCefClient::Open() {
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseDirectories:YES];
if ([panel runModal] == NSFileHandlingPanelOKButton) {
NSURL *url = [[panel URLs] lastObject];
Open([[url path] UTF8String]);
}
}