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

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

Issue 2803873003: Linux native notifications: Support closing and updating notifications (Closed)
Patch Set: glib_signals.h -> glib_signal.h to fix gn gen --check Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/notifications/notification_platform_bridge_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_platform_bridge_linux.h
diff --git a/chrome/browser/notifications/notification_platform_bridge_linux.h b/chrome/browser/notifications/notification_platform_bridge_linux.h
index 1b6380c769d270eabed7e47030326855b1a79d6f..18b42142940bb75e6703a68e117a0fdcf7e35307 100644
--- a/chrome/browser/notifications/notification_platform_bridge_linux.h
+++ b/chrome/browser/notifications/notification_platform_bridge_linux.h
@@ -7,8 +7,11 @@
#include <gio/gio.h>
+#include <unordered_map>
+
#include "base/macros.h"
#include "chrome/browser/notifications/notification_platform_bridge.h"
+#include "ui/base/glib/scoped_gobject.h"
class NotificationPlatformBridgeLinux : public NotificationPlatformBridge {
public:
@@ -29,8 +32,35 @@ class NotificationPlatformBridgeLinux : public NotificationPlatformBridge {
bool incognito,
const DisplayedNotificationsCallback& callback) const override;
+ // Called from NotifyCompleteReceiver().
+ void NotifyCompleteInternal(gpointer user_data, GVariant* value);
+
private:
- GDBusProxy* const notification_proxy_;
+ struct NotificationData;
+
+ ScopedGObject<GDBusProxy> notification_proxy_;
+
+ // A std::set<std::unique_ptr<T>> doesn't work well because
+ // eg. std::set::erase(T) would require a std::unique_ptr<T>
+ // argument, so the data would get double-destructed.
+ template <typename T>
+ using UnorderedUniqueSet = std::unordered_map<T*, std::unique_ptr<T>>;
+
+ UnorderedUniqueSet<NotificationData> notifications_;
+
+ // Makes the "Notify" call to D-Bus.
+ void NotifyNow(uint32_t dbus_id,
+ NotificationCommon::Type notification_type,
+ const Notification& notification,
+ GCancellable* cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ // Makes the "CloseNotification" call to D-Bus.
+ void CloseNow(uint32_t dbus_id);
+
+ NotificationData* FindNotificationData(const std::string& notification_id,
+ const std::string& profile_id);
DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux);
};
« no previous file with comments | « no previous file | chrome/browser/notifications/notification_platform_bridge_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698