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"
13 #define IPC_MESSAGE_START PlatformNotificationMsgStart
15 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebNotificationPermission,
16 blink::WebNotificationPermissionLast)
18 // Messages sent from the browser to the renderer.
20 // Informs the renderer that the permission request for |request_id| is done,
21 // and has been settled with |result|.
22 IPC_MESSAGE_ROUTED2(PlatformNotificationMsg_PermissionRequestComplete,
24 blink::WebNotificationPermission /* result */)
26 // Informs the renderer that the browser has displayed the notification.
27 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidShow,
28 int /* notification_id */)
30 // Informs the renderer that the notification has been closed.
31 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClose,
32 int /* notification_id */)
34 // Informs the renderer that the notification has been clicked on.
35 IPC_MESSAGE_CONTROL1(PlatformNotificationMsg_DidClick,
36 int /* notification_id */)
38 // Messages sent from the renderer to the browser.
40 // Requests permission to display platform notifications for |origin|.
41 IPC_MESSAGE_ROUTED2(PlatformNotificationHostMsg_RequestPermission,
45 IPC_MESSAGE_CONTROL2(PlatformNotificationHostMsg_Show,
46 int /* notification_id */,
47 content::ShowDesktopNotificationHostMsgParams /* params */)
49 IPC_MESSAGE_CONTROL1(PlatformNotificationHostMsg_Close,
50 int /* notification_id */)
52 IPC_SYNC_MESSAGE_CONTROL1_1(PlatformNotificationHostMsg_CheckPermission,
54 blink::WebNotificationPermission /* result */)