use libnotify to pop up notifications on Linux
This commit is contained in:
parent
8aba54e71a
commit
a82e9f30ed
4 changed files with 165 additions and 2 deletions
36
brightray/browser/linux/notification_presenter_linux.h
Normal file
36
brightray/browser/linux/notification_presenter_linux.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2013 Patrick Reynolds <piki@github.com>. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE-CHROMIUM file.
|
||||
|
||||
#ifndef BRIGHTRAY_BROWSER_NOTIFICATION_PRESENTER_LINUX_H_
|
||||
#define BRIGHTRAY_BROWSER_NOTIFICATION_PRESENTER_LINUX_H_
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "browser/notification_presenter.h"
|
||||
|
||||
#include <libnotify/notify.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace brightray {
|
||||
|
||||
class NotificationPresenterLinux : public NotificationPresenter {
|
||||
public:
|
||||
virtual void ShowNotification(
|
||||
const content::ShowDesktopNotificationHostMsgParams&,
|
||||
int render_process_id,
|
||||
int render_view_id) OVERRIDE;
|
||||
virtual void CancelNotification(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int notification_id) OVERRIDE;
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, NotifyNotification*> NotificationMap;
|
||||
NotificationMap notification_map_;
|
||||
};
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue