OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DBUS_NOTIFICATION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_DBUS_NOTIFICATION_MANAGER_H_ |
| 7 |
| 8 #include <gio/gio.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/message_center/message_center.h" |
| 12 #include "ui/message_center/message_center_observer.h" |
| 13 |
| 14 class DbusNotificationManager : public message_center::MessageCenterObserver { |
| 15 public: |
| 16 // Returns a new DbusNotificationManager if system notifications are |
| 17 // supported, otherwise returns nullptr. |
| 18 static DbusNotificationManager* CreateDbusNotificationManager( |
| 19 message_center::MessageCenter* message_center); |
| 20 |
| 21 ~DbusNotificationManager() override; |
| 22 |
| 23 // Overridden from message_center::MessageCenterObserver. |
| 24 void OnNotificationAdded(const std::string& notification_id) override; |
| 25 void OnNotificationRemoved(const std::string& notification_id, |
| 26 bool by_user) override; |
| 27 void OnNotificationUpdated(const std::string& notification_id) override; |
| 28 |
| 29 private: |
| 30 DbusNotificationManager(message_center::MessageCenter* message_center, |
| 31 GDBusProxy* notification_proxy); |
| 32 |
| 33 message_center::MessageCenter* message_center_; |
| 34 |
| 35 GDBusProxy* notification_proxy_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(DbusNotificationManager); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_NOTIFICATIONS_DBUS_NOTIFICATION_MANAGER_H_ |
OLD | NEW |