Add systemPreferences.subscribeNotification

This commit is contained in:
Cheng Zhao 2016-04-25 14:25:14 +09:00
parent ddd8eae661
commit 9557226223
3 changed files with 50 additions and 2 deletions

View file

@ -4,6 +4,7 @@
#include "atom/browser/api/atom_api_system_preferences.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
@ -46,6 +47,11 @@ void SystemPreferences::BuildPrototype(
mate::ObjectTemplateBuilder(isolate, prototype)
#if defined(OS_WIN)
.SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled)
#elif defined(OS_MACOSX)
.SetMethod("subscribeNotification",
&SystemPreferences::SubscribeNotification)
.SetMethod("unsubscribeNotification",
&SystemPreferences::UnsubscribeNotification)
#endif
.SetMethod("isDarkMode", &SystemPreferences::IsDarkMode);
}