| 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/show_desktop_notification_params.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 "url/gurl.h" | |
| 12 | 11 |
| 13 #define IPC_MESSAGE_START PlatformNotificationMsgStart | 12 #define IPC_MESSAGE_START PlatformNotificationMsgStart |
| 14 | 13 |
| 15 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission, | 14 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission, |
| 16 blink::WebNotificationPermissionLast) | 15 blink::WebNotificationPermissionLast) |
| 17 | 16 |
| 18 IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams) | 17 IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams) |
| 19 IPC_STRUCT_TRAITS_MEMBER(origin) | 18 IPC_STRUCT_TRAITS_MEMBER(origin) |
| 20 IPC_STRUCT_TRAITS_MEMBER(icon) | 19 IPC_STRUCT_TRAITS_MEMBER(icon) |
| 21 IPC_STRUCT_TRAITS_MEMBER(title) | 20 IPC_STRUCT_TRAITS_MEMBER(title) |
| 22 IPC_STRUCT_TRAITS_MEMBER(body) | 21 IPC_STRUCT_TRAITS_MEMBER(body) |
| 23 IPC_STRUCT_TRAITS_MEMBER(direction) | 22 IPC_STRUCT_TRAITS_MEMBER(direction) |
| 24 IPC_STRUCT_TRAITS_MEMBER(replace_id) | 23 IPC_STRUCT_TRAITS_MEMBER(replace_id) |
| 25 IPC_STRUCT_TRAITS_END() | 24 IPC_STRUCT_TRAITS_END() |
| 26 | 25 |
| 27 // Messages sent from the browser to the renderer. | 26 // Messages sent from the browser to the renderer. |
| 28 | 27 |
| 29 // Informs the renderer that the permission request for |request_id| is done, | |
| 30 // and has been settled with |result|. | |
| 31 IPC_MESSAGE_ROUTED2(PlatformNotificationMsg_PermissionRequestComplete, | |
| 32 int /* request_id */, | |
| 33 blink::WebNotificationPermission /* result */) | |
| 34 | |
| 35 // Informs the renderer that the browser has displayed the notification. | 28 // Informs the renderer that the browser has displayed the notification. |
| 36 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow, | 29 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow, |
| 37 int /* notification_id */) | 30 int /* notification_id */) |
| 38 | 31 |
| 39 // Informs the renderer that the notification has been closed. | 32 // Informs the renderer that the notification has been closed. |
| 40 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose, | 33 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose, |
| 41 int /* notification_id */) | 34 int /* notification_id */) |
| 42 | 35 |
| 43 // Informs the renderer that the notification has been clicked on. | 36 // Informs the renderer that the notification has been clicked on. |
| 44 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick, | 37 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick, |
| 45 int /* notification_id */) | 38 int /* notification_id */) |
| 46 | 39 |
| 47 // Messages sent from the renderer to the browser. | 40 // Messages sent from the renderer to the browser. |
| 48 | 41 |
| 49 // Requests permission to display platform notifications for |origin|. | |
| 50 IPC_MESSAGE_ROUTED2(PlatformNotificationHostMsg_RequestPermission, | |
| 51 GURL /* origin */, | |
| 52 int /* request_id */) | |
| 53 | |
| 54 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_Show, | 42 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_Show, |
| 55 int /* notification_id */, | 43 int /* notification_id */, |
| 56 content::ShowDesktopNotificationHostMsgParams /* params */) | 44 content::ShowDesktopNotificationHostMsgParams /* params */) |
| 57 | 45 |
| 58 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, | 46 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close, |
| 59 int /* notification_id */) | 47 int /* notification_id */) |
| 60 | 48 |
| 61 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, | 49 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission, |
| 62 GURL /* origin */, | 50 GURL /* origin */, |
| 63 blink::WebNotificationPermission /* result */) | 51 blink::WebNotificationPermission /* result */) |
| OLD | NEW |