Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / common / platform_notification_messages.h
blob077e3148bb5190c3acb1dc2e8a983ce6769abd3e
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"
11 #include "url/gurl.h"
13 #define IPC_MESSAGE_START PlatformNotificationMsgStart
15 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission,
16 blink::WebNotificationPermissionLast)
18 IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams)
19 IPC_STRUCT_TRAITS_MEMBER(origin)
20 IPC_STRUCT_TRAITS_MEMBER(icon)
21 IPC_STRUCT_TRAITS_MEMBER(title)
22 IPC_STRUCT_TRAITS_MEMBER(body)
23 IPC_STRUCT_TRAITS_MEMBER(direction)
24 IPC_STRUCT_TRAITS_MEMBER(replace_id)
25 IPC_STRUCT_TRAITS_END()
27 // Messages sent from the browser to the renderer.
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 */)
35 // Informs the renderer that the browser has displayed the notification.
36 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow,
37 int /* notification_id */)
39 // Informs the renderer that the notification has been closed.
40 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose,
41 int /* notification_id */)
43 // Informs the renderer that the notification has been clicked on.
44 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick,
45 int /* notification_id */)
47 // Messages sent from the renderer to the browser.
49 // Requests permission to display platform notifications for |origin|.
50 IPC_MESSAGE_ROUTED2(PlatformNotificationHostMsg_RequestPermission,
51 GURL /* origin */,
52 int /* request_id */)
54 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_Show,
55 int /* notification_id */,
56 content::ShowDesktopNotificationHostMsgParams /* params */)
58 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close,
59 int /* notification_id */)
61 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission,
62 GURL /* origin */,
63 blink::WebNotificationPermission /* result */)