Fix building on Linux

This commit is contained in:
Cheng Zhao 2014-10-13 11:02:56 +08:00
parent 9e12036823
commit 6d62b0960e
2 changed files with 5 additions and 3 deletions

View file

@ -52,13 +52,15 @@ NotificationPresenterLinux::~NotificationPresenterLinux() {
void NotificationPresenterLinux::ShowNotification(
const content::ShowDesktopNotificationHostMsgParams& params,
content::DesktopNotificationDelegate* delegate,
scoped_ptr<content::DesktopNotificationDelegate> 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);

View file

@ -27,7 +27,7 @@ class NotificationPresenterLinux : public NotificationPresenter {
// NotificationPresenter:
virtual void ShowNotification(
const content::ShowDesktopNotificationHostMsgParams&,
content::DesktopNotificationDelegate* delegate,
scoped_ptr<content::DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) OVERRIDE;
void CancelNotification(NotifyNotification* notification);