mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
This avoids retina resolution issues and ink framework errors that occur when opening dialogs from the chromium renderer process.
19 lines
632 B
Plaintext
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]);
|
|
}
|
|
} |