summaryrefslogtreecommitdiffstats
path: root/content/common/geofencing_messages.h
blob: 87853bd13873f73b0188b408952b73b7ef43518f (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2014 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 message for geofencing

#include <stdint.h>

#include "content/common/geofencing_types.h"
#include "ipc/ipc_message_macros.h"
#include "third_party/WebKit/public/platform/WebCircularGeofencingRegion.h"

// Singly-included section for typedefs.
#ifndef CONTENT_COMMON_GEOFENCING_MESSAGES_H_
#define CONTENT_COMMON_GEOFENCING_MESSAGES_H_

typedef std::map<std::string, blink::WebCircularGeofencingRegion>
    GeofencingRegistrations;

#endif  // CONTENT_COMMON_GEOFENCING_MESSAGES_H_

// Multiply-included message file, hence no include guard.
#define IPC_MESSAGE_START GeofencingMsgStart

IPC_ENUM_TRAITS_MAX_VALUE(content::GeofencingStatus,
                          content::GEOFENCING_STATUS_LAST)

IPC_ENUM_TRAITS_MAX_VALUE(content::GeofencingMockState,
                          content::GeofencingMockState::LAST)

IPC_STRUCT_TRAITS_BEGIN(blink::WebCircularGeofencingRegion)
  IPC_STRUCT_TRAITS_MEMBER(latitude)
  IPC_STRUCT_TRAITS_MEMBER(longitude)
  IPC_STRUCT_TRAITS_MEMBER(radius)
IPC_STRUCT_TRAITS_END()

// Messages sent from the child process to the browser.
IPC_MESSAGE_CONTROL5(GeofencingHostMsg_RegisterRegion,
                     int /* thread_id */,
                     int /* request_id */,
                     std::string /* region_id */,
                     blink::WebCircularGeofencingRegion /* region */,
                     int64_t /* serviceworker_registration_id */)

IPC_MESSAGE_CONTROL4(GeofencingHostMsg_UnregisterRegion,
                     int /* thread_id */,
                     int /* request_id */,
                     std::string /* region_id */,
                     int64_t /* serviceworker_registration_id */)

IPC_MESSAGE_CONTROL3(GeofencingHostMsg_GetRegisteredRegions,
                     int /* thread_id */,
                     int /* request_id */,
                     int64_t /* serviceworker_registration_id */)

IPC_MESSAGE_CONTROL1(GeofencingHostMsg_SetMockProvider,
                     content::GeofencingMockState /* mock_state */)

IPC_MESSAGE_CONTROL2(GeofencingHostMsg_SetMockPosition,
                     double /* latitude */,
                     double /* longitude */)

// Messages sent from the browser to the child process.

// Reply in response to GeofencingHostMsg_RegisterRegion
IPC_MESSAGE_CONTROL3(GeofencingMsg_RegisterRegionComplete,
                     int /* thread_id */,
                     int /* request_id */,
                     content::GeofencingStatus /* status */)

// Reply in response to GeofencingHostMsg_UnregisterRegion
IPC_MESSAGE_CONTROL3(GeofencingMsg_UnregisterRegionComplete,
                     int /* thread_id */,
                     int /* request_id */,
                     content::GeofencingStatus /* status */)

// Reply in response to GeofencingHostMsg_GetRegisteredRegions
IPC_MESSAGE_CONTROL4(GeofencingMsg_GetRegisteredRegionsComplete,
                     int /* thread_id */,
                     int /* request_id */,
                     content::GeofencingStatus /* status */,
                     GeofencingRegistrations /* regions */)