OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Messages for platform-native notifications using the Web Notification API. | 5 // Messages for platform-native notifications using the Web Notification API. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "content/public/common/common_param_traits_macros.h" | 13 #include "content/public/common/common_param_traits_macros.h" |
14 #include "content/public/common/notification_resources.h" | 14 #include "content/public/common/notification_resources.h" |
15 #include "content/public/common/platform_notification_data.h" | 15 #include "content/public/common/platform_notification_data.h" |
16 #include "ipc/ipc_message_macros.h" | 16 #include "ipc/ipc_message_macros.h" |
17 | 17 |
18 // Singly-included section for type definitions. | 18 // Singly-included section for type definitions. |
19 #ifndef CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ | 19 #ifndef CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ |
20 #define CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ | 20 #define CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ |
21 | 21 |
22 // Defines the pair of [persistent notification id] => [notification data] used | 22 // Defines the pair of [notification id] => [notification data] used when |
23 // when getting the notifications for a given Service Worker registration. | 23 // getting the notifications for a given Service Worker registration. |
24 using PersistentNotificationInfo = | 24 using PersistentNotificationInfo = |
25 std::pair<int64_t, content::PlatformNotificationData>; | 25 std::pair<std::string, content::PlatformNotificationData>; |
26 | 26 |
27 #endif // CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ | 27 #endif // CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ |
28 | 28 |
29 #define IPC_MESSAGE_START PlatformNotificationMsgStart | 29 #define IPC_MESSAGE_START PlatformNotificationMsgStart |
30 | 30 |
31 IPC_ENUM_TRAITS_MAX_VALUE( | 31 IPC_ENUM_TRAITS_MAX_VALUE( |
32 content::PlatformNotificationData::Direction, | 32 content::PlatformNotificationData::Direction, |
33 content::PlatformNotificationData::DIRECTION_LAST) | 33 content::PlatformNotificationData::DIRECTION_LAST) |
34 | 34 |
35 IPC_ENUM_TRAITS_MAX_VALUE(content::PlatformNotificationActionType, | 35 IPC_ENUM_TRAITS_MAX_VALUE(content::PlatformNotificationActionType, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // available notifications per the request's constraints. | 93 // available notifications per the request's constraints. |
94 IPC_MESSAGE_CONTROL2(PlatformNotificationMsg_DidGetNotifications, | 94 IPC_MESSAGE_CONTROL2(PlatformNotificationMsg_DidGetNotifications, |
95 int /* request_id */, | 95 int /* request_id */, |
96 std::vector<PersistentNotificationInfo> | 96 std::vector<PersistentNotificationInfo> |
97 /* notifications */) | 97 /* notifications */) |
98 | 98 |
99 // Messages sent from the renderer to the browser. | 99 // Messages sent from the renderer to the browser. |
100 | 100 |
101 IPC_MESSAGE_CONTROL4( | 101 IPC_MESSAGE_CONTROL4( |
102 PlatformNotificationHostMsg_Show, | 102 PlatformNotificationHostMsg_Show, |
103 int /* notification_id */, | 103 int /* non_persistent_notification_id */, |
104 GURL /* origin */, | 104 GURL /* origin */, |
105 content::PlatformNotificationData /* notification_data */, | 105 content::PlatformNotificationData /* notification_data */, |
106 content::NotificationResources /* notification_resources */) | 106 content::NotificationResources /* notification_resources */) |
107 | 107 |
108 IPC_MESSAGE_CONTROL5( | 108 IPC_MESSAGE_CONTROL5( |
109 PlatformNotificationHostMsg_ShowPersistent, | 109 PlatformNotificationHostMsg_ShowPersistent, |
110 int /* request_id */, | 110 int /* request_id */, |
111 int64_t /* service_worker_registration_id */, | 111 int64_t /* service_worker_registration_id */, |
112 GURL /* origin */, | 112 GURL /* origin */, |
113 content::PlatformNotificationData /* notification_data */, | 113 content::PlatformNotificationData /* notification_data */, |
114 content::NotificationResources /* notification_resources */) | 114 content::NotificationResources /* notification_resources */) |
115 | 115 |
116 IPC_MESSAGE_CONTROL4(PlatformNotificationHostMsg_GetNotifications, | 116 IPC_MESSAGE_CONTROL4(PlatformNotificationHostMsg_GetNotifications, |
117 int /* request_id */, | 117 int /* request_id */, |
118 int64_t /* service_worker_registration_id */, | 118 int64_t /* service_worker_registration_id */, |
119 GURL /* origin */, | 119 GURL /* origin */, |
120 std::string /* filter_tag */) | 120 std::string /* filter_tag */) |
121 | 121 |
122 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, | 122 IPC_MESSAGE_CONTROL3(PlatformNotificationHostMsg_Close, |
123 int /* notification_id */) | 123 GURL /* origin */, |
| 124 std::string /* tag */, |
| 125 int /* non_persistent_notification_id */) |
124 | 126 |
125 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_ClosePersistent, | 127 IPC_MESSAGE_CONTROL3(PlatformNotificationHostMsg_ClosePersistent, |
126 GURL /* origin */, | 128 GURL /* origin */, |
127 int64_t /* persistent_notification_id */) | 129 std::string /* tag */, |
| 130 std::string /* notification_id */) |
OLD | NEW |