Add app.getLoginItemStatus API
This commit is contained in:
parent
98a97a52ea
commit
b55f55cfc4
3 changed files with 14 additions and 0 deletions
|
@ -529,6 +529,8 @@ void App::BuildPrototype(
|
||||||
base::Bind(&Browser::SetUserActivity, browser))
|
base::Bind(&Browser::SetUserActivity, browser))
|
||||||
.SetMethod("getLoginItemLaunchStatus",
|
.SetMethod("getLoginItemLaunchStatus",
|
||||||
base::Bind(&Browser::GetLoginItemLaunchStatus, browser))
|
base::Bind(&Browser::GetLoginItemLaunchStatus, browser))
|
||||||
|
.SetMethod("getLoginItemStatus",
|
||||||
|
base::Bind(&Browser::GetLoginItemStatus, browser))
|
||||||
#endif
|
#endif
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
.SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser))
|
.SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser))
|
||||||
|
|
|
@ -135,7 +135,11 @@ class Browser : public WindowListObserver {
|
||||||
// Set docks' icon.
|
// Set docks' icon.
|
||||||
void DockSetIcon(const gfx::Image& image);
|
void DockSetIcon(const gfx::Image& image);
|
||||||
|
|
||||||
|
// Get login item status of current app launch
|
||||||
v8::Local<v8::Value> GetLoginItemLaunchStatus(mate::Arguments* args);
|
v8::Local<v8::Value> GetLoginItemLaunchStatus(mate::Arguments* args);
|
||||||
|
|
||||||
|
// Get login item status of app
|
||||||
|
v8::Local<v8::Value> GetLoginItemStatus(mate::Arguments* args);
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MACOSX)
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
|
|
@ -158,6 +158,14 @@ v8::Local<v8::Value> Browser::GetLoginItemLaunchStatus(mate::Arguments* args) {
|
||||||
return dict.GetHandle();
|
return dict.GetHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v8::Local<v8::Value> Browser::GetLoginItemStatus(mate::Arguments* args) {
|
||||||
|
bool hidden = false;
|
||||||
|
mate::Dictionary dict = mate::Dictionary::CreateEmpty(args->isolate());
|
||||||
|
dict.Set("loginItem", base::mac::CheckLoginItemStatus(&hidden));
|
||||||
|
dict.Set("hidden", hidden);
|
||||||
|
return dict.GetHandle();
|
||||||
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileVersion() const {
|
std::string Browser::GetExecutableFileVersion() const {
|
||||||
return brightray::GetApplicationVersion();
|
return brightray::GetApplicationVersion();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue