| 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/notification_resources.h" |
| 13 #include "content/public/common/platform_notification_data.h" | 14 #include "content/public/common/platform_notification_data.h" |
| 14 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 15 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onPermission.h" | 16 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati
onPermission.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 | 18 |
| 18 // Singly-included section for type definitions. | 19 // Singly-included section for type definitions. |
| 19 #ifndef CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ | 20 #ifndef CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ |
| 20 #define CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ | 21 #define CONTENT_COMMON_PLATFORM_NOTIFICATION_MESSAGES_H_ |
| 21 | 22 |
| 22 // Defines the pair of [persistent notification id] => [notification data] used | 23 // Defines the pair of [persistent notification id] => [notification data] used |
| (...skipping 24 matching lines...) Expand all Loading... |
| 47 IPC_STRUCT_TRAITS_MEMBER(body) | 48 IPC_STRUCT_TRAITS_MEMBER(body) |
| 48 IPC_STRUCT_TRAITS_MEMBER(tag) | 49 IPC_STRUCT_TRAITS_MEMBER(tag) |
| 49 IPC_STRUCT_TRAITS_MEMBER(icon) | 50 IPC_STRUCT_TRAITS_MEMBER(icon) |
| 50 IPC_STRUCT_TRAITS_MEMBER(vibration_pattern) | 51 IPC_STRUCT_TRAITS_MEMBER(vibration_pattern) |
| 51 IPC_STRUCT_TRAITS_MEMBER(silent) | 52 IPC_STRUCT_TRAITS_MEMBER(silent) |
| 52 IPC_STRUCT_TRAITS_MEMBER(require_interaction) | 53 IPC_STRUCT_TRAITS_MEMBER(require_interaction) |
| 53 IPC_STRUCT_TRAITS_MEMBER(data) | 54 IPC_STRUCT_TRAITS_MEMBER(data) |
| 54 IPC_STRUCT_TRAITS_MEMBER(actions) | 55 IPC_STRUCT_TRAITS_MEMBER(actions) |
| 55 IPC_STRUCT_TRAITS_END() | 56 IPC_STRUCT_TRAITS_END() |
| 56 | 57 |
| 58 IPC_STRUCT_TRAITS_BEGIN(content::NotificationResources) |
| 59 IPC_STRUCT_TRAITS_MEMBER(notification_icon) |
| 60 IPC_STRUCT_TRAITS_END() |
| 61 |
| 57 // Messages sent from the browser to the renderer. | 62 // Messages sent from the browser to the renderer. |
| 58 | 63 |
| 59 // Informs the renderer that the browser has displayed the notification. | 64 // Informs the renderer that the browser has displayed the notification. |
| 60 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow, | 65 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow, |
| 61 int /* notification_id */) | 66 int /* notification_id */) |
| 62 | 67 |
| 63 // Informs the renderer that the notification has been closed. | 68 // Informs the renderer that the notification has been closed. |
| 64 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose, | 69 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose, |
| 65 int /* notification_id */) | 70 int /* notification_id */) |
| 66 | 71 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 77 | 82 |
| 78 // Reply to PlatformNotificationHostMsg_GetNotifications sharing a vector of | 83 // Reply to PlatformNotificationHostMsg_GetNotifications sharing a vector of |
| 79 // available notifications per the request's constraints. | 84 // available notifications per the request's constraints. |
| 80 IPC_MESSAGE_CONTROL2(PlatformNotificationMsg_DidGetNotifications, | 85 IPC_MESSAGE_CONTROL2(PlatformNotificationMsg_DidGetNotifications, |
| 81 int /* request_id */, | 86 int /* request_id */, |
| 82 std::vector<PersistentNotificationInfo> | 87 std::vector<PersistentNotificationInfo> |
| 83 /* notifications */) | 88 /* notifications */) |
| 84 | 89 |
| 85 // Messages sent from the renderer to the browser. | 90 // Messages sent from the renderer to the browser. |
| 86 | 91 |
| 87 IPC_MESSAGE_CONTROL4(PlatformNotificationHostMsg_Show, | 92 IPC_MESSAGE_CONTROL4( |
| 88 int /* notification_id */, | 93 PlatformNotificationHostMsg_Show, |
| 89 GURL /* origin */, | 94 int /* notification_id */, |
| 90 SkBitmap /* icon */, | 95 GURL /* origin */, |
| 91 content::PlatformNotificationData /* notification_data */) | 96 content::PlatformNotificationData /* notification_data */, |
| 97 content::NotificationResources /* notification_resources */) |
| 92 | 98 |
| 93 IPC_MESSAGE_CONTROL5(PlatformNotificationHostMsg_ShowPersistent, | 99 IPC_MESSAGE_CONTROL5( |
| 94 int /* request_id */, | 100 PlatformNotificationHostMsg_ShowPersistent, |
| 95 int64_t /* service_worker_registration_id */, | 101 int /* request_id */, |
| 96 GURL /* origin */, | 102 int64_t /* service_worker_registration_id */, |
| 97 SkBitmap /* icon */, | 103 GURL /* origin */, |
| 98 content::PlatformNotificationData /* notification_data */) | 104 content::PlatformNotificationData /* notification_data */, |
| 105 content::NotificationResources /* notification_resources */) |
| 99 | 106 |
| 100 IPC_MESSAGE_CONTROL4(PlatformNotificationHostMsg_GetNotifications, | 107 IPC_MESSAGE_CONTROL4(PlatformNotificationHostMsg_GetNotifications, |
| 101 int /* request_id */, | 108 int /* request_id */, |
| 102 int64_t /* service_worker_registration_id */, | 109 int64_t /* service_worker_registration_id */, |
| 103 GURL /* origin */, | 110 GURL /* origin */, |
| 104 std::string /* filter_tag */) | 111 std::string /* filter_tag */) |
| 105 | 112 |
| 106 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, | 113 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, |
| 107 int /* notification_id */) | 114 int /* notification_id */) |
| 108 | 115 |
| 109 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_ClosePersistent, | 116 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_ClosePersistent, |
| 110 GURL /* origin */, | 117 GURL /* origin */, |
| 111 int64_t /* persistent_notification_id */) | 118 int64_t /* persistent_notification_id */) |
| 112 | 119 |
| 113 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, | 120 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, |
| 114 GURL /* origin */, | 121 GURL /* origin */, |
| 115 blink::WebNotificationPermission /* result */) | 122 blink::WebNotificationPermission /* result */) |
| OLD | NEW |