chore: change return type of platform_util::SetLoginItemEnabled (#15854)

This commit is contained in:
Shelley Vohr 2018-11-27 23:16:53 -05:00 committed by GitHub
parent 5f9c857eb0
commit 73fbb69c50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View file

@ -278,7 +278,9 @@ void RemoveFromLoginItems() {
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
#if defined(MAS_BUILD)
platform_util::SetLoginItemEnabled(settings.open_at_login);
if (!platform_util::SetLoginItemEnabled(settings.open_at_login)) {
LOG(ERROR) << "Unable to set login item enabled on sandboxed app.";
}
#else
if (settings.open_at_login)
base::mac::AddToLoginItems(settings.open_as_hidden);

View file

@ -61,7 +61,7 @@ void Beep();
#if defined(OS_MACOSX)
bool GetLoginItemEnabled();
void SetLoginItemEnabled(bool enabled);
bool SetLoginItemEnabled(bool enabled);
#endif
#if defined(OS_LINUX)

View file

@ -199,9 +199,9 @@ bool GetLoginItemEnabled() {
return enabled;
}
void SetLoginItemEnabled(bool enabled) {
bool SetLoginItemEnabled(bool enabled) {
NSString* identifier = GetLoginHelperBundleIdentifier();
SMLoginItemSetEnabled((__bridge CFStringRef)identifier, enabled);
return SMLoginItemSetEnabled((__bridge CFStringRef)identifier, enabled);
}
} // namespace platform_util