Use applicationShouldTerminate to control whether application should quit.

This commit is contained in:
Cheng Zhao 2013-06-26 17:22:24 +08:00
parent 6362e60a7b
commit adacc2bcf9
5 changed files with 33 additions and 19 deletions

View file

@ -11,11 +11,12 @@
namespace atom {
void Browser::Terminate() {
is_quiting_ = true;
[[AtomApplication sharedApplication] terminate:nil];
}
void Browser::Focus() {
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[[AtomApplication sharedApplication] activateIgnoringOtherApps:YES];
}
std::string Browser::GetVersion() {
@ -24,4 +25,8 @@ std::string Browser::GetVersion() {
return base::SysNSStringToUTF8(version);
}
void Browser::CancelQuit() {
[[AtomApplication sharedApplication] replyToApplicationShouldTerminate:NO];
}
} // namespace atom