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 // IPC messages for push messaging.
6 // Multiply-included message file, hence no include guard.
8 #include "content/public/common/push_messaging_status.h"
9 #include "ipc/ipc_message_macros.h"
10 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushError.h"
11 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermissionStatus.h"
14 #define IPC_MESSAGE_START PushMessagingMsgStart
16 IPC_ENUM_TRAITS_MAX_VALUE(content::PushRegistrationStatus
,
17 content::PUSH_REGISTRATION_STATUS_LAST
)
19 IPC_ENUM_TRAITS_MAX_VALUE(content::PushGetRegistrationStatus
,
20 content::PUSH_GETREGISTRATION_STATUS_LAST
)
22 IPC_ENUM_TRAITS_MAX_VALUE(
23 blink::WebPushPermissionStatus
,
24 blink::WebPushPermissionStatus::WebPushPermissionStatusLast
)
26 IPC_ENUM_TRAITS_MAX_VALUE(
27 blink::WebPushError::ErrorType
,
28 blink::WebPushError::ErrorType::ErrorTypeLast
)
30 // Messages sent from the browser to the child process.
32 IPC_MESSAGE_ROUTED3(PushMessagingMsg_RegisterFromDocumentSuccess
,
33 int32
/* request_id */,
34 GURL
/* push_endpoint */,
35 std::string
/* push_registration_id */)
37 IPC_MESSAGE_CONTROL3(PushMessagingMsg_RegisterFromWorkerSuccess
,
38 int32
/* request_id */,
39 GURL
/* push_endpoint */,
40 std::string
/* push_registration_id */)
42 IPC_MESSAGE_ROUTED2(PushMessagingMsg_RegisterFromDocumentError
,
43 int32
/* request_id */,
44 content::PushRegistrationStatus
/* status */)
46 IPC_MESSAGE_CONTROL2(PushMessagingMsg_RegisterFromWorkerError
,
47 int32
/* request_id */,
48 content::PushRegistrationStatus
/* status */)
50 IPC_MESSAGE_CONTROL2(PushMessagingMsg_UnregisterSuccess
,
51 int32
/* request_id */,
52 bool /* did_unregister */)
54 IPC_MESSAGE_CONTROL3(PushMessagingMsg_UnregisterError
,
55 int32
/* request_id */,
56 blink::WebPushError::ErrorType
/* error_type */,
57 std::string
/* error_message */)
59 IPC_MESSAGE_CONTROL3(PushMessagingMsg_GetRegistrationSuccess
,
60 int32
/* request_id */,
61 GURL
/* push_endpoint */,
62 std::string
/* push_registration_id */)
64 IPC_MESSAGE_CONTROL2(PushMessagingMsg_GetRegistrationError
,
65 int32
/* request_id */,
66 content::PushGetRegistrationStatus
/* status */)
68 IPC_MESSAGE_CONTROL2(PushMessagingMsg_GetPermissionStatusSuccess
,
69 int32
/* request_id */,
70 blink::WebPushPermissionStatus
/* status */)
72 IPC_MESSAGE_CONTROL1(PushMessagingMsg_GetPermissionStatusError
,
73 int32
/* request_id */)
75 // Messages sent from the child process to the browser.
77 IPC_MESSAGE_CONTROL5(PushMessagingHostMsg_RegisterFromDocument
,
78 int32
/* render_frame_id */,
79 int32
/* request_id */,
80 std::string
/* sender_id */,
81 bool /* user_visible_only */,
82 int64
/* service_worker_registration_id */)
84 IPC_MESSAGE_CONTROL2(PushMessagingHostMsg_RegisterFromWorker
,
85 int32
/* request_id */,
86 int64
/* service_worker_registration_id */)
88 IPC_MESSAGE_CONTROL2(PushMessagingHostMsg_Unregister
,
89 int32
/* request_id */,
90 int64
/* service_worker_registration_id */)
92 IPC_MESSAGE_CONTROL2(PushMessagingHostMsg_GetRegistration
,
93 int32
/* request_id */,
94 int64
/* service_worker_registration_id */)
96 IPC_MESSAGE_CONTROL2(PushMessagingHostMsg_GetPermissionStatus
,
97 int32
/* request_id */,
98 int64
/* service_worker_registration_id */)