Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: chrome/browser/notifications/dbus_notification_manager.h

Issue 2794103002: Add initial support for native Linux desktop notifications (Closed)
Patch Set: Refactor, move impl to chrome/browser/notifications Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/dbus_notification_manager.h
diff --git a/chrome/browser/notifications/dbus_notification_manager.h b/chrome/browser/notifications/dbus_notification_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fd2536adfcf2f73c3e3d3f46baac871eb4af847
--- /dev/null
+++ b/chrome/browser/notifications/dbus_notification_manager.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NOTIFICATIONS_DBUS_NOTIFICATION_MANAGER_H_
+#define CHROME_BROWSER_NOTIFICATIONS_DBUS_NOTIFICATION_MANAGER_H_
+
+#include <gio/gio.h>
+
+#include "base/macros.h"
+#include "ui/message_center/message_center.h"
+#include "ui/message_center/message_center_observer.h"
+
+class DbusNotificationManager : public message_center::MessageCenterObserver {
+ public:
+ // Returns a new DbusNotificationManager if system notifications are
+ // supported, otherwise returns nullptr.
+ static DbusNotificationManager* CreateDbusNotificationManager(
+ message_center::MessageCenter* message_center);
+
+ ~DbusNotificationManager() override;
+
+ // Overridden from message_center::MessageCenterObserver.
+ void OnNotificationAdded(const std::string& notification_id) override;
+ void OnNotificationRemoved(const std::string& notification_id,
+ bool by_user) override;
+ void OnNotificationUpdated(const std::string& notification_id) override;
+
+ private:
+ DbusNotificationManager(message_center::MessageCenter* message_center,
+ GDBusProxy* notification_proxy);
+
+ message_center::MessageCenter* message_center_;
+
+ GDBusProxy* notification_proxy_;
+
+ DISALLOW_COPY_AND_ASSIGN(DbusNotificationManager);
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_DBUS_NOTIFICATION_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698