🍎 Send events as native macOS notifications
This commit is contained in:
parent
5eeadb0ad4
commit
38cc56efee
4 changed files with 50 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "atom/browser/api/event_emitter.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/values.h"
|
||||
#include "native_mate/handle.h"
|
||||
|
||||
namespace base {
|
||||
|
@ -32,6 +33,10 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
|
|||
using NotificationCallback = base::Callback<
|
||||
void(const std::string&, const base::DictionaryValue&)>;
|
||||
|
||||
void PostNotification(const std::string& name,
|
||||
const base::DictionaryValue& user_info);
|
||||
void PostLocalNotification(const std::string& name,
|
||||
const base::DictionaryValue& user_info);
|
||||
int SubscribeNotification(const std::string& name,
|
||||
const NotificationCallback& callback);
|
||||
void UnsubscribeNotification(int id);
|
||||
|
@ -49,6 +54,9 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
|
|||
~SystemPreferences() override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void DoPostNotification(const std::string& name,
|
||||
const base::DictionaryValue& user_info,
|
||||
bool is_local);
|
||||
int DoSubscribeNotification(const std::string& name,
|
||||
const NotificationCallback& callback,
|
||||
bool is_local);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue