OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // IPC messages for desktop notification. | 5 // IPC messages for desktop notification. |
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 "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
9 #include "googleurl/src/gurl.h" | |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | |
11 | 10 |
12 #define IPC_MESSAGE_START DesktopNotificationMsgStart | 11 #define IPC_MESSAGE_START DesktopNotificationMsgStart |
13 | 12 |
14 IPC_STRUCT_BEGIN(DesktopNotificationHostMsg_Show_Params) | 13 IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams) |
15 // URL which is the origin that created this notification. | 14 IPC_STRUCT_TRAITS_MEMBER(origin) |
16 IPC_STRUCT_MEMBER(GURL, origin) | 15 IPC_STRUCT_TRAITS_MEMBER(is_html) |
17 | 16 IPC_STRUCT_TRAITS_MEMBER(contents_url) |
18 // True if this is HTML | 17 IPC_STRUCT_TRAITS_MEMBER(icon_url) |
19 IPC_STRUCT_MEMBER(bool, is_html) | 18 IPC_STRUCT_TRAITS_MEMBER(title) |
20 | 19 IPC_STRUCT_TRAITS_MEMBER(body) |
21 // URL which contains the HTML contents (if is_html is true), otherwise empty. | 20 IPC_STRUCT_TRAITS_MEMBER(direction) |
22 IPC_STRUCT_MEMBER(GURL, contents_url) | 21 IPC_STRUCT_TRAITS_MEMBER(replace_id) |
23 | 22 IPC_STRUCT_TRAITS_MEMBER(notification_id) |
24 // Contents of the notification if is_html is false. | 23 IPC_STRUCT_TRAITS_END() |
25 IPC_STRUCT_MEMBER(GURL, icon_url) | |
26 IPC_STRUCT_MEMBER(string16, title) | |
27 IPC_STRUCT_MEMBER(string16, body) | |
28 | |
29 // Directionality of the notification. | |
30 IPC_STRUCT_MEMBER(WebKit::WebTextDirection, direction) | |
31 | |
32 // ReplaceID if this notification should replace an existing one) may be | |
33 // empty if no replacement is called for. | |
34 IPC_STRUCT_MEMBER(string16, replace_id) | |
35 | |
36 // Notification ID for sending events back for this notification. | |
37 IPC_STRUCT_MEMBER(int, notification_id) | |
38 IPC_STRUCT_END() | |
39 | 24 |
40 // Messages sent from the browser to the renderer. | 25 // Messages sent from the browser to the renderer. |
41 | 26 |
42 // Used to inform the renderer that the browser has displayed its | 27 // Used to inform the renderer that the browser has displayed its |
43 // requested notification. | 28 // requested notification. |
44 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostDisplay, | 29 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostDisplay, |
45 int /* notification_id */) | 30 int /* notification_id */) |
46 | 31 |
47 // Used to inform the renderer that the browser has encountered an error | 32 // Used to inform the renderer that the browser has encountered an error |
48 // trying to display a notification. | 33 // trying to display a notification. |
(...skipping 10 matching lines...) Expand all Loading... |
59 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostClick, | 44 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostClick, |
60 int /* notification_id */) | 45 int /* notification_id */) |
61 | 46 |
62 // Informs the renderer that the one if its notifications has closed. | 47 // Informs the renderer that the one if its notifications has closed. |
63 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PermissionRequestDone, | 48 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PermissionRequestDone, |
64 int /* request_id */) | 49 int /* request_id */) |
65 | 50 |
66 // Messages sent from the renderer to the browser. | 51 // Messages sent from the renderer to the browser. |
67 | 52 |
68 IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Show, | 53 IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Show, |
69 DesktopNotificationHostMsg_Show_Params) | 54 content::ShowDesktopNotificationHostMsgParams) |
70 | 55 |
71 IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Cancel, | 56 IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Cancel, |
72 int /* notification_id */) | 57 int /* notification_id */) |
73 | 58 |
74 IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_RequestPermission, | 59 IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_RequestPermission, |
75 GURL /* origin */, | 60 GURL /* origin */, |
76 int /* callback_context */) | 61 int /* callback_context */) |
77 | 62 |
78 IPC_SYNC_MESSAGE_ROUTED1_1(DesktopNotificationHostMsg_CheckPermission, | 63 IPC_SYNC_MESSAGE_ROUTED1_1(DesktopNotificationHostMsg_CheckPermission, |
79 GURL /* origin */, | 64 GURL /* origin */, |
80 int /* permission_result */) | 65 int /* permission_result */) |
OLD | NEW |