Store weak ref to Notification in ToastEventHandler

This commit is contained in:
Cheng Zhao 2016-04-15 16:14:13 +09:00
parent ddee77fae4
commit f4c27c6d29
9 changed files with 32 additions and 47 deletions

View file

@ -136,19 +136,12 @@ void LibnotifyNotification::Dismiss() {
void LibnotifyNotification::OnNotificationClosed(
NotifyNotification* notification) {
delegate()->NotificationClosed();
Destroy();
NotificationDismissed();
}
void LibnotifyNotification::OnNotificationView(
NotifyNotification* notification, char* action) {
delegate()->NotificationClick();
Destroy();
}
void LibnotifyNotification::NotificationFailed() {
delegate()->NotificationFailed();
Destroy();
NotificationClicked();
}
} // namespace brightray

View file

@ -34,8 +34,6 @@ class LibnotifyNotification : public Notification {
CHROMEG_CALLBACK_1(LibnotifyNotification, void, OnNotificationView,
NotifyNotification*, char*);
void NotificationFailed();
NotifyNotification* notification_;
DISALLOW_COPY_AND_ASSIGN(LibnotifyNotification);