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
3// found in the LICENSE file.
4
5// IPC messages for desktop notification.
6// Multiply-included message file, hence no include guard.
7
8#include "content/public/common/show_desktop_notification_params.h"
9#include "ipc/ipc_message_macros.h"
10
11#define IPC_MESSAGE_START DesktopNotificationMsgStart
12
13IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams)
14  IPC_STRUCT_TRAITS_MEMBER(origin)
15  IPC_STRUCT_TRAITS_MEMBER(icon_url)
16  IPC_STRUCT_TRAITS_MEMBER(title)
17  IPC_STRUCT_TRAITS_MEMBER(body)
18  IPC_STRUCT_TRAITS_MEMBER(direction)
19  IPC_STRUCT_TRAITS_MEMBER(replace_id)
20IPC_STRUCT_TRAITS_END()
21
22// Messages sent from the browser to the renderer.
23
24// Used to inform the renderer that the browser has displayed its
25// requested notification.
26IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostDisplay,
27                    int /* notification_id */)
28
29// Used to inform the renderer that the browser has encountered an error
30// trying to display a notification.
31IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostError,
32                    int /* notification_id */)
33
34// Informs the renderer that the one if its notifications has closed.
35IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostClose,
36                    int /* notification_id */,
37                    bool /* by_user */)
38
39// Informs the renderer that one of its notifications was clicked on.
40IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostClick,
41                    int /* notification_id */)
42
43// Informs the renderer that the one if its notifications has closed.
44IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PermissionRequestDone,
45                    int /* request_id */)
46
47// Messages sent from the renderer to the browser.
48
49IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_Show,
50                    int /* notification_id */,
51                    content::ShowDesktopNotificationHostMsgParams /* params */)
52
53IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Cancel,
54                    int /* notification_id */)
55
56IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_RequestPermission,
57                    GURL /* origin */,
58                    int /* callback_context */)
59
60IPC_SYNC_MESSAGE_ROUTED1_1(DesktopNotificationHostMsg_CheckPermission,
61                           GURL /* origin */,
62                           int /* permission_result */)
63