summaryrefslogtreecommitdiffstats
path: root/content/common/desktop_notification_messages.h
blob: 562c22bc65c27d2b02f2fe1b2651428a3428437f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// IPC messages for desktop notification.
// Multiply-included message file, hence no include guard.

#include "content/public/common/show_desktop_notification_params.h"
#include "ipc/ipc_message_macros.h"

#define IPC_MESSAGE_START DesktopNotificationMsgStart

IPC_STRUCT_TRAITS_BEGIN(content::ShowDesktopNotificationHostMsgParams)
  IPC_STRUCT_TRAITS_MEMBER(origin)
  IPC_STRUCT_TRAITS_MEMBER(is_html)
  IPC_STRUCT_TRAITS_MEMBER(contents_url)
  IPC_STRUCT_TRAITS_MEMBER(icon_url)
  IPC_STRUCT_TRAITS_MEMBER(title)
  IPC_STRUCT_TRAITS_MEMBER(body)
  IPC_STRUCT_TRAITS_MEMBER(direction)
  IPC_STRUCT_TRAITS_MEMBER(replace_id)
  IPC_STRUCT_TRAITS_MEMBER(notification_id)
IPC_STRUCT_TRAITS_END()

// Messages sent from the browser to the renderer.

// Used to inform the renderer that the browser has displayed its
// requested notification.
IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostDisplay,
                    int /* notification_id */)

// Used to inform the renderer that the browser has encountered an error
// trying to display a notification.
IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostError,
                    int /* notification_id */,
                    string16 /* message */)

// Informs the renderer that the one if its notifications has closed.
IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostClose,
                    int /* notification_id */,
                    bool /* by_user */)

// Informs the renderer that one of its notifications was clicked on.
IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostClick,
                    int /* notification_id */)

// Informs the renderer that the one if its notifications has closed.
IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PermissionRequestDone,
                    int /* request_id */)

// Messages sent from the renderer to the browser.

IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Show,
                    content::ShowDesktopNotificationHostMsgParams)

IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Cancel,
                    int /* notification_id */)

IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_RequestPermission,
                    GURL /* origin */,
                    int /* callback_context */)

IPC_SYNC_MESSAGE_ROUTED1_1(DesktopNotificationHostMsg_CheckPermission,
                           GURL /* origin */,
                           int /* permission_result */)