Add support for notification actions on macOS

This commit is contained in:
Samuel Attard 2017-06-23 20:39:42 +10:00
parent 873a315538
commit 4f0d48f164
16 changed files with 136 additions and 13 deletions

View file

@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
#include <string>
#include <vector>
#include "base/mac/scoped_nsobject.h"
#include "brightray/browser/notification.h"
@ -28,16 +29,19 @@ class CocoaNotification : public Notification {
const SkBitmap& icon,
bool silent,
const bool has_reply,
const base::string16& reply_placeholder) override;
const base::string16& reply_placeholder,
const std::vector<NotificationAction> actions) override;
void Dismiss() override;
void NotificationDisplayed();
void NotificationReplied(const std::string& reply);
void NotificationButtonClicked();
NSUserNotification* notification() const { return notification_; }
private:
base::scoped_nsobject<NSUserNotification> notification_;
int actionIndex_;
DISALLOW_COPY_AND_ASSIGN(CocoaNotification);
};