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))
|
||||
.SetMethod("setBadgeCount", base::Bind(&Browser::SetBadgeCount, 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)
|
||||
.SetMethod("hide", base::Bind(&Browser::Hide, browser))
|
||||
.SetMethod("show", base::Bind(&Browser::Show, browser))
|
||||
|
@ -566,10 +570,6 @@ void App::BuildPrototype(
|
|||
base::Bind(&Browser::SetUserActivity, browser))
|
||||
.SetMethod("getCurrentActivityType",
|
||||
base::Bind(&Browser::GetCurrentActivityType, browser))
|
||||
.SetMethod("getLoginItemSettings",
|
||||
base::Bind(&Browser::GetLoginItemSettings, browser))
|
||||
.SetMethod("setLoginItemSettings",
|
||||
base::Bind(&Browser::SetLoginItemSettings, browser))
|
||||
#endif
|
||||
#if defined(OS_WIN)
|
||||
.SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser))
|
||||
|
|
|
@ -88,7 +88,7 @@ class Browser : public WindowListObserver {
|
|||
bool SetBadgeCount(int count);
|
||||
int GetBadgeCount();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
// Set/Get the login item settings of the app
|
||||
struct LoginItemSettings {
|
||||
bool open_at_login = false;
|
||||
bool open_as_hidden = false;
|
||||
|
@ -96,7 +96,10 @@ class Browser : public WindowListObserver {
|
|||
bool opened_at_login = false;
|
||||
bool opened_as_hidden = false;
|
||||
};
|
||||
void SetLoginItemSettings(LoginItemSettings settings);
|
||||
LoginItemSettings GetLoginItemSettings();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
// Hide the application.
|
||||
void Hide();
|
||||
|
||||
|
@ -139,12 +142,6 @@ class Browser : public WindowListObserver {
|
|||
|
||||
// Set docks' icon.
|
||||
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)
|
||||
|
||||
#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 {
|
||||
return brightray::GetApplicationVersion();
|
||||
}
|
||||
|
|
|
@ -273,6 +273,14 @@ bool Browser::SetBadgeCount(int count) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
|
||||
}
|
||||
|
||||
LoginItemSettings Browser::GetLoginItemSettings() {
|
||||
return LoginItemSettings();
|
||||
}
|
||||
|
||||
|
||||
PCWSTR Browser::GetAppUserModelID() {
|
||||
if (app_user_model_id_.empty()) {
|
||||
SetAppUserModelID(base::ReplaceStringPlaceholders(
|
||||
|
|
Loading…
Reference in a new issue