2013-05-02 12:09:19 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2013-05-02 15:03:14 +00:00
|
|
|
#import "browser/atom_application_delegate_mac.h"
|
2013-05-02 12:09:19 +00:00
|
|
|
|
2013-05-02 15:03:14 +00:00
|
|
|
#import "browser/atom_application_mac.h"
|
2013-05-02 12:09:19 +00:00
|
|
|
|
|
|
|
@implementation AtomApplicationDelegate
|
|
|
|
|
|
|
|
- (void)applicationDidFinishLaunching:(NSNotification*)notify {
|
|
|
|
NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
|
|
|
|
[em setEventHandler:self
|
|
|
|
andSelector:@selector(handleQuitEvent:withReplyEvent:)
|
|
|
|
forEventClass:kCoreEventClass
|
|
|
|
andEventID:kAEQuitApplication];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)handleQuitEvent:(NSAppleEventDescriptor*)event
|
|
|
|
withReplyEvent:(NSAppleEventDescriptor*)replyEvent {
|
|
|
|
[[AtomApplication sharedApplication] closeAllWindows:self];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|