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
3 // found in the LICENSE file.
5 // Messages for platform-native notifications using the Web Notification API.
6 // Multiply-included message file, hence no include guard.
8 #include "content/public/common/show_desktop_notification_params.h"
9 #include "ipc/ipc_message_macros.h"
10 #include "third_party/WebKit/public/platform/WebNotificationPermission.h"
12 #define IPC_MESSAGE_START PlatformNotificationMsgStart
14 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission
,
15 blink::WebNotificationPermissionLast
)
17 IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams
)
18 IPC_STRUCT_TRAITS_MEMBER(origin
)
19 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()
26 // Messages sent from the browser to the renderer.
28 // Informs the renderer that the browser has displayed the persistent
30 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShowPersistent
,
33 // Informs the renderer that the browser has displayed the notification.
34 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow
,
35 int /* notification_id */)
37 // Informs the renderer that the notification has been closed.
38 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose
,
39 int /* notification_id */)
41 // Informs the renderer that the notification has been clicked on.
42 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick
,
43 int /* notification_id */)
45 // Messages sent from the renderer to the browser.
47 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_Show
,
48 int /* notification_id */,
49 content::ShowDesktopNotificationHostMsgParams
/* params */)
51 IPC_MESSAGE_CONTROL3(PlatformNotificationHostMsg_ShowPersistent
,
53 int64
/* service_worker_provider_id */,
54 content::ShowDesktopNotificationHostMsgParams
/* params */)
56 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close
,
57 int /* notification_id */)
59 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_ClosePersistent
,
60 std::string
/* persistent_notification_id */)
62 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission
,
64 blink::WebNotificationPermission
/* result */)