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 "content/public/common/show_desktop_notification_params.h" | 8 #include "content/public/common/platform_notification_data.h" |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
10 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" | 10 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" |
11 | 12 |
12 #define IPC_MESSAGE_START PlatformNotificationMsgStart | 13 #define IPC_MESSAGE_START PlatformNotificationMsgStart |
13 | 14 |
14 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission, | 15 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission, |
15 blink::WebNotificationPermissionLast) | 16 blink::WebNotificationPermissionLast) |
16 | 17 |
17 IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams) | 18 IPC_ENUM_TRAITS_MAX_VALUE( |
18 IPC_STRUCT_TRAITS_MEMBER(origin) | 19 content::PlatformNotificationData::NotificationDirection, |
| 20 content::PlatformNotificationData::NotificationDirectionLast) |
| 21 |
| 22 IPC_STRUCT_TRAITS_BEGIN(content::PlatformNotificationData) |
| 23 IPC_STRUCT_TRAITS_MEMBER(title) |
| 24 IPC_STRUCT_TRAITS_MEMBER(direction) |
| 25 IPC_STRUCT_TRAITS_MEMBER(lang) |
| 26 IPC_STRUCT_TRAITS_MEMBER(body) |
| 27 IPC_STRUCT_TRAITS_MEMBER(tag) |
19 IPC_STRUCT_TRAITS_MEMBER(icon) | 28 IPC_STRUCT_TRAITS_MEMBER(icon) |
20 IPC_STRUCT_TRAITS_MEMBER(title) | |
21 IPC_STRUCT_TRAITS_MEMBER(body) | |
22 IPC_STRUCT_TRAITS_MEMBER(direction) | |
23 IPC_STRUCT_TRAITS_MEMBER(replace_id) | |
24 IPC_STRUCT_TRAITS_END() | 29 IPC_STRUCT_TRAITS_END() |
25 | 30 |
26 // Messages sent from the browser to the renderer. | 31 // Messages sent from the browser to the renderer. |
27 | 32 |
28 // Informs the renderer that the browser has displayed the persistent | 33 // Informs the renderer that the browser has displayed the persistent |
29 // notification. | 34 // notification. |
30 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShowPersistent, | 35 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShowPersistent, |
31 int /* request_id */) | 36 int /* request_id */) |
32 | 37 |
33 // Informs the renderer that the browser has displayed the notification. | 38 // Informs the renderer that the browser has displayed the notification. |
34 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow, | 39 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow, |
35 int /* notification_id */) | 40 int /* notification_id */) |
36 | 41 |
37 // Informs the renderer that the notification has been closed. | 42 // Informs the renderer that the notification has been closed. |
38 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose, | 43 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose, |
39 int /* notification_id */) | 44 int /* notification_id */) |
40 | 45 |
41 // Informs the renderer that the notification has been clicked on. | 46 // Informs the renderer that the notification has been clicked on. |
42 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick, | 47 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick, |
43 int /* notification_id */) | 48 int /* notification_id */) |
44 | 49 |
45 // Messages sent from the renderer to the browser. | 50 // Messages sent from the renderer to the browser. |
46 | 51 |
47 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_Show, | 52 IPC_MESSAGE_CONTROL4(PlatformNotificationHostMsg_Show, |
48 int /* notification_id */, | 53 int /* notification_id */, |
49 content::ShowDesktopNotificationHostMsgParams /* params */) | 54 GURL /* origin */, |
| 55 SkBitmap /* icon */, |
| 56 content::PlatformNotificationData /* notification_data */) |
50 | 57 |
51 IPC_MESSAGE_CONTROL3(PlatformNotificationHostMsg_ShowPersistent, | 58 IPC_MESSAGE_CONTROL5(PlatformNotificationHostMsg_ShowPersistent, |
52 int /* request_id */, | 59 int /* request_id */, |
53 int64 /* service_worker_provider_id */, | 60 int64 /* service_worker_provider_id */, |
54 content::ShowDesktopNotificationHostMsgParams /* params */) | 61 GURL /* origin */, |
| 62 SkBitmap /* icon */, |
| 63 content::PlatformNotificationData /* notification_data */) |
55 | 64 |
56 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, | 65 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, |
57 int /* notification_id */) | 66 int /* notification_id */) |
58 | 67 |
59 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_ClosePersistent, | 68 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_ClosePersistent, |
60 std::string /* persistent_notification_id */) | 69 std::string /* persistent_notification_id */) |
61 | 70 |
62 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, | 71 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, |
63 GURL /* origin */, | 72 GURL /* origin */, |
64 blink::WebNotificationPermission /* result */) | 73 blink::WebNotificationPermission /* result */) |
OLD | NEW |