Fix building on Linux
This commit is contained in:
parent
9e12036823
commit
6d62b0960e
2 changed files with 5 additions and 3 deletions
|
@ -52,13 +52,15 @@ NotificationPresenterLinux::~NotificationPresenterLinux() {
|
||||||
|
|
||||||
void NotificationPresenterLinux::ShowNotification(
|
void NotificationPresenterLinux::ShowNotification(
|
||||||
const content::ShowDesktopNotificationHostMsgParams& params,
|
const content::ShowDesktopNotificationHostMsgParams& params,
|
||||||
content::DesktopNotificationDelegate* delegate,
|
scoped_ptr<content::DesktopNotificationDelegate> delegate_ptr,
|
||||||
base::Closure* cancel_callback) {
|
base::Closure* cancel_callback) {
|
||||||
std::string title = base::UTF16ToUTF8(params.title);
|
std::string title = base::UTF16ToUTF8(params.title);
|
||||||
std::string body = base::UTF16ToUTF8(params.body);
|
std::string body = base::UTF16ToUTF8(params.body);
|
||||||
NotifyNotification* notification = notify_notification_new(title.c_str(), body.c_str(), nullptr);
|
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);
|
g_signal_connect(notification, "closed", G_CALLBACK(OnNotificationClosedThunk), this);
|
||||||
notify_notification_add_action(notification, "default", "View", OnNotificationViewThunk, this,
|
notify_notification_add_action(notification, "default", "View", OnNotificationViewThunk, this,
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
|
@ -27,7 +27,7 @@ class NotificationPresenterLinux : public NotificationPresenter {
|
||||||
// NotificationPresenter:
|
// NotificationPresenter:
|
||||||
virtual void ShowNotification(
|
virtual void ShowNotification(
|
||||||
const content::ShowDesktopNotificationHostMsgParams&,
|
const content::ShowDesktopNotificationHostMsgParams&,
|
||||||
content::DesktopNotificationDelegate* delegate,
|
scoped_ptr<content::DesktopNotificationDelegate> delegate,
|
||||||
base::Closure* cancel_callback) OVERRIDE;
|
base::Closure* cancel_callback) OVERRIDE;
|
||||||
|
|
||||||
void CancelNotification(NotifyNotification* notification);
|
void CancelNotification(NotifyNotification* notification);
|
||||||
|
|
Loading…
Add table
Reference in a new issue