Emit 'open-file' event when OS X is trying to open file with the app.
This commit is contained in:
parent
01af2fd0c5
commit
7dd48e24d3
10 changed files with 49 additions and 3 deletions
|
@ -5,10 +5,15 @@
|
|||
#import "browser/atom_application_mac.h"
|
||||
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "browser/browser.h"
|
||||
|
||||
@implementation AtomApplication
|
||||
|
||||
+ (AtomApplication*)sharedApplication {
|
||||
return (AtomApplication*)[super sharedApplication];
|
||||
}
|
||||
|
||||
- (BOOL)isHandlingSendEvent {
|
||||
return handlingSendEvent_;
|
||||
}
|
||||
|
@ -22,8 +27,9 @@
|
|||
handlingSendEvent_ = handlingSendEvent;
|
||||
}
|
||||
|
||||
+ (AtomApplication*)sharedApplication {
|
||||
return (AtomApplication*)[super sharedApplication];
|
||||
- (BOOL)openFile:(NSString*)filename {
|
||||
std::string filename_str(base::SysNSStringToUTF8(filename));
|
||||
return atom::Browser::Get()->OpenFile(filename_str) ? YES : NO;
|
||||
}
|
||||
|
||||
- (IBAction)closeAllWindows:(id)sender {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue