• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
13 IPC_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)
20   IPC_STRUCT_TRAITS_MEMBER(notification_id)
21 IPC_STRUCT_TRAITS_END()
22 
23 // Messages sent from the browser to the renderer.
24 
25 // Used to inform the renderer that the browser has displayed its
26 // requested notification.
27 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostDisplay,
28                     int /* notification_id */)
29 
30 // Used to inform the renderer that the browser has encountered an error
31 // trying to display a notification.
32 IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostError,
33                     int /* notification_id */,
34                     base::string16 /* message */)
35 
36 // Informs the renderer that the one if its notifications has closed.
37 IPC_MESSAGE_ROUTED2(DesktopNotificationMsg_PostClose,
38                     int /* notification_id */,
39                     bool /* by_user */)
40 
41 // Informs the renderer that one of its notifications was clicked on.
42 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PostClick,
43                     int /* notification_id */)
44 
45 // Informs the renderer that the one if its notifications has closed.
46 IPC_MESSAGE_ROUTED1(DesktopNotificationMsg_PermissionRequestDone,
47                     int /* request_id */)
48 
49 // Messages sent from the renderer to the browser.
50 
51 IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Show,
52                     content::ShowDesktopNotificationHostMsgParams)
53 
54 IPC_MESSAGE_ROUTED1(DesktopNotificationHostMsg_Cancel,
55                     int /* notification_id */)
56 
57 IPC_MESSAGE_ROUTED2(DesktopNotificationHostMsg_RequestPermission,
58                     GURL /* origin */,
59                     int /* callback_context */)
60 
61 IPC_SYNC_MESSAGE_ROUTED1_1(DesktopNotificationHostMsg_CheckPermission,
62                            GURL /* origin */,
63                            int /* permission_result */)
64