From 6d62b0960e5d0b07adadf4a3c2b70c86f54a2bd6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 13 Oct 2014 11:02:56 +0800 Subject: [PATCH] Fix building on Linux --- brightray/browser/linux/notification_presenter_linux.cc | 6 ++++-- brightray/browser/linux/notification_presenter_linux.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/brightray/browser/linux/notification_presenter_linux.cc b/brightray/browser/linux/notification_presenter_linux.cc index f73479980927..c31e3d01e9fc 100644 --- a/brightray/browser/linux/notification_presenter_linux.cc +++ b/brightray/browser/linux/notification_presenter_linux.cc @@ -52,13 +52,15 @@ NotificationPresenterLinux::~NotificationPresenterLinux() { void NotificationPresenterLinux::ShowNotification( const content::ShowDesktopNotificationHostMsgParams& params, - content::DesktopNotificationDelegate* delegate, + scoped_ptr delegate_ptr, base::Closure* cancel_callback) { std::string title = base::UTF16ToUTF8(params.title); std::string body = base::UTF16ToUTF8(params.body); NotifyNotification* notification = notify_notification_new(title.c_str(), body.c_str(), nullptr); - g_object_set_data(G_OBJECT(notification), "delegate", delegate); + content::DesktopNotificationDelegate* delegate = delegate_ptr.release(); + + g_object_set_data_full(G_OBJECT(notification), "delegate", delegate, operator delete); g_signal_connect(notification, "closed", G_CALLBACK(OnNotificationClosedThunk), this); notify_notification_add_action(notification, "default", "View", OnNotificationViewThunk, this, nullptr); diff --git a/brightray/browser/linux/notification_presenter_linux.h b/brightray/browser/linux/notification_presenter_linux.h index 07e628e29a47..b42e4eb3dbeb 100644 --- a/brightray/browser/linux/notification_presenter_linux.h +++ b/brightray/browser/linux/notification_presenter_linux.h @@ -27,7 +27,7 @@ class NotificationPresenterLinux : public NotificationPresenter { // NotificationPresenter: virtual void ShowNotification( const content::ShowDesktopNotificationHostMsgParams&, - content::DesktopNotificationDelegate* delegate, + scoped_ptr delegate, base::Closure* cancel_callback) OVERRIDE; void CancelNotification(NotifyNotification* notification);