🍎 Add Show to API for OS X
This commit is contained in:
parent
6a643ec3c8
commit
f9efdc4435
4 changed files with 12 additions and 0 deletions
|
@ -369,6 +369,7 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
|||
base::Bind(&Browser::SetAppUserModelID, browser))
|
||||
#if defined(OS_MACOSX)
|
||||
.SetMethod("hide", base::Bind(&Browser::Hide, browser))
|
||||
.SetMethod("show", base::Bind(&Browser::Show, browser))
|
||||
#endif
|
||||
#if defined(OS_WIN)
|
||||
.SetMethod("setUserTasks",
|
||||
|
|
|
@ -80,6 +80,9 @@ class Browser : public WindowListObserver {
|
|||
// Hide the application.
|
||||
void Hide();
|
||||
|
||||
// Show the application.
|
||||
void Show();
|
||||
|
||||
// Bounce the dock icon.
|
||||
enum BounceType {
|
||||
BOUNCE_CRITICAL = 0,
|
||||
|
|
|
@ -22,6 +22,10 @@ void Browser::Hide() {
|
|||
[[AtomApplication sharedApplication] hide:nil];
|
||||
}
|
||||
|
||||
void Browser::Show() {
|
||||
[[AtomApplication sharedApplication] unhide:nil];
|
||||
}
|
||||
|
||||
void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||
NSString* path_string = base::mac::FilePathToNSString(path);
|
||||
if (!path_string)
|
||||
|
|
|
@ -248,6 +248,10 @@ returning `false` in the `beforeunload` event handler.
|
|||
|
||||
Hides all application windows without minimising them.
|
||||
|
||||
### `app.show()` _OS X_
|
||||
|
||||
Shows application windows after they were hidden. Does not automatically focus them.
|
||||
|
||||
### `app.exit(exitCode)`
|
||||
|
||||
* `exitCode` Integer
|
||||
|
|
Loading…
Add table
Reference in a new issue