OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
7 | 7 |
8 #include <gio/gio.h> | 8 #include <gio/gio.h> |
9 | 9 |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // A std::set<std::unique_ptr<T>> doesn't work well because | 47 // A std::set<std::unique_ptr<T>> doesn't work well because |
48 // eg. std::set::erase(T) would require a std::unique_ptr<T> | 48 // eg. std::set::erase(T) would require a std::unique_ptr<T> |
49 // argument, so the data would get double-destructed. | 49 // argument, so the data would get double-destructed. |
50 template <typename T> | 50 template <typename T> |
51 using UnorderedUniqueSet = std::unordered_map<T*, std::unique_ptr<T>>; | 51 using UnorderedUniqueSet = std::unordered_map<T*, std::unique_ptr<T>>; |
52 | 52 |
53 UnorderedUniqueSet<NotificationData> notifications_; | 53 UnorderedUniqueSet<NotificationData> notifications_; |
54 | 54 |
55 // Makes the "Notify" call to D-Bus. | 55 // Makes the "Notify" call to D-Bus. |
56 void NotifyNow(uint32_t dbus_id, | 56 void NotifyNow(const Notification& notification, |
57 NotificationCommon::Type notification_type, | 57 NotificationData* data, |
58 const Notification& notification, | |
59 GCancellable* cancellable, | |
60 GAsyncReadyCallback callback, | 58 GAsyncReadyCallback callback, |
61 gpointer user_data); | 59 gpointer user_data); |
62 | 60 |
63 // Makes the "CloseNotification" call to D-Bus. | 61 // Makes the "CloseNotification" call to D-Bus. |
64 void CloseNow(uint32_t dbus_id); | 62 void CloseNow(uint32_t dbus_id); |
65 | 63 |
66 void ForwardNotificationOperation(uint32_t dbus_id, | 64 void ForwardNotificationOperation(uint32_t dbus_id, |
67 NotificationCommon::Operation operation, | 65 NotificationCommon::Operation operation, |
68 int action_index); | 66 int action_index); |
69 | 67 |
(...skipping 10 matching lines...) Expand all Loading... |
80 NotificationData* FindNotificationData(const std::string& notification_id, | 78 NotificationData* FindNotificationData(const std::string& notification_id, |
81 const std::string& profile_id, | 79 const std::string& profile_id, |
82 bool is_incognito); | 80 bool is_incognito); |
83 | 81 |
84 NotificationData* FindNotificationData(uint32_t dbus_id); | 82 NotificationData* FindNotificationData(uint32_t dbus_id); |
85 | 83 |
86 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux); | 84 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux); |
87 }; | 85 }; |
88 | 86 |
89 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ | 87 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_LINUX_H_ |
OLD | NEW |