Add get/setLoginItemSettings on all platforms
This commit is contained in:
parent
230b4ac241
commit
64f9c6a1d7
4 changed files with 23 additions and 11 deletions
|
@ -559,6 +559,10 @@ void App::BuildPrototype(
|
||||||
base::Bind(&Browser::RemoveAsDefaultProtocolClient, browser))
|
base::Bind(&Browser::RemoveAsDefaultProtocolClient, browser))
|
||||||
.SetMethod("setBadgeCount", base::Bind(&Browser::SetBadgeCount, browser))
|
.SetMethod("setBadgeCount", base::Bind(&Browser::SetBadgeCount, browser))
|
||||||
.SetMethod("getBadgeCount", base::Bind(&Browser::GetBadgeCount, browser))
|
.SetMethod("getBadgeCount", base::Bind(&Browser::GetBadgeCount, browser))
|
||||||
|
.SetMethod("getLoginItemSettings",
|
||||||
|
base::Bind(&Browser::GetLoginItemSettings, browser))
|
||||||
|
.SetMethod("setLoginItemSettings",
|
||||||
|
base::Bind(&Browser::SetLoginItemSettings, browser))
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
.SetMethod("hide", base::Bind(&Browser::Hide, browser))
|
.SetMethod("hide", base::Bind(&Browser::Hide, browser))
|
||||||
.SetMethod("show", base::Bind(&Browser::Show, browser))
|
.SetMethod("show", base::Bind(&Browser::Show, browser))
|
||||||
|
@ -566,10 +570,6 @@ void App::BuildPrototype(
|
||||||
base::Bind(&Browser::SetUserActivity, browser))
|
base::Bind(&Browser::SetUserActivity, browser))
|
||||||
.SetMethod("getCurrentActivityType",
|
.SetMethod("getCurrentActivityType",
|
||||||
base::Bind(&Browser::GetCurrentActivityType, browser))
|
base::Bind(&Browser::GetCurrentActivityType, browser))
|
||||||
.SetMethod("getLoginItemSettings",
|
|
||||||
base::Bind(&Browser::GetLoginItemSettings, browser))
|
|
||||||
.SetMethod("setLoginItemSettings",
|
|
||||||
base::Bind(&Browser::SetLoginItemSettings, 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))
|
||||||
|
|
|
@ -88,7 +88,7 @@ class Browser : public WindowListObserver {
|
||||||
bool SetBadgeCount(int count);
|
bool SetBadgeCount(int count);
|
||||||
int GetBadgeCount();
|
int GetBadgeCount();
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
// Set/Get the login item settings of the app
|
||||||
struct LoginItemSettings {
|
struct LoginItemSettings {
|
||||||
bool open_at_login = false;
|
bool open_at_login = false;
|
||||||
bool open_as_hidden = false;
|
bool open_as_hidden = false;
|
||||||
|
@ -96,7 +96,10 @@ class Browser : public WindowListObserver {
|
||||||
bool opened_at_login = false;
|
bool opened_at_login = false;
|
||||||
bool opened_as_hidden = false;
|
bool opened_as_hidden = false;
|
||||||
};
|
};
|
||||||
|
void SetLoginItemSettings(LoginItemSettings settings);
|
||||||
|
LoginItemSettings GetLoginItemSettings();
|
||||||
|
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
// Hide the application.
|
// Hide the application.
|
||||||
void Hide();
|
void Hide();
|
||||||
|
|
||||||
|
@ -139,12 +142,6 @@ 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 settings of app
|
|
||||||
LoginItemSettings GetLoginItemSettings();
|
|
||||||
|
|
||||||
// Set login item settings of app
|
|
||||||
void SetLoginItemSettings(LoginItemSettings settings);
|
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_MACOSX)
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
|
|
@ -57,6 +57,13 @@ bool Browser::SetBadgeCount(int count) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginItemSettings Browser::GetLoginItemSettings() {
|
||||||
|
return LoginItemSettings();
|
||||||
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileVersion() const {
|
std::string Browser::GetExecutableFileVersion() const {
|
||||||
return brightray::GetApplicationVersion();
|
return brightray::GetApplicationVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,6 +273,14 @@ bool Browser::SetBadgeCount(int count) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginItemSettings Browser::GetLoginItemSettings() {
|
||||||
|
return LoginItemSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PCWSTR Browser::GetAppUserModelID() {
|
PCWSTR Browser::GetAppUserModelID() {
|
||||||
if (app_user_model_id_.empty()) {
|
if (app_user_model_id_.empty()) {
|
||||||
SetAppUserModelID(base::ReplaceStringPlaceholders(
|
SetAppUserModelID(base::ReplaceStringPlaceholders(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue