OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 // Message definitions for geolocation messages. | |
6 | |
7 syntax = "proto2"; | |
8 | |
9 option optimize_for = LITE_RUNTIME; | |
10 | |
11 import "tab_control.proto"; | |
Kevin M
2016/06/27 16:57:41
Promote EmptyMessage to a "common.proto" file - th
CJ
2016/06/27 22:04:26
Good idea. Done.
| |
12 | |
13 package blimp; | |
14 | |
15 message ErrorMessage { | |
16 // These values follow the W3C geolocation specification and can be returned | |
Kevin M
2016/06/27 16:57:41
Add a link to the specification?
CJ
2016/06/27 22:04:26
Done.
| |
17 // to JavaScript without the need for a conversion. | |
18 enum ErrorCode { | |
19 option allow_alias = true; | |
20 ERROR_CODE_NONE = 0; | |
21 ERROR_CODE_PERMISSION_DENIED = 1; | |
22 ERROR_CODE_POSITION_UNAVAILABLE = 2; | |
23 ERROR_CODE_TIMEOUT = 3; | |
24 ERROR_CODE_LAST = 3; | |
25 } | |
26 | |
27 optional ErrorCode error_code = 1; | |
28 optional string error_message = 2; | |
29 } | |
30 | |
31 message LocationMessage { | |
32 // Please refer to content/public/common/geoposition.h for explanation of | |
Kevin M
2016/06/27 16:57:41
nit: "please" is optional - one-liner comments are
CJ
2016/06/27 22:04:26
Done.
| |
33 // these fields and associated units. | |
34 optional double latitude = 1; | |
35 optional double longitude = 2; | |
36 optional double altitude = 3; | |
37 optional double accuracy = 4; | |
38 optional double altitude_accuracy = 5; | |
39 optional double heading = 6; | |
40 optional double speed = 7; | |
41 optional int64 timestamp_millis = 8; | |
42 } | |
43 | |
44 message UpdateListenStateMessage { | |
45 enum ListenState { | |
46 ACCURACY_HIGH = 0; | |
47 ACCURACY_LOW = 1; | |
48 STOPPED = 2; | |
49 } | |
50 | |
51 optional ListenState listen_state = 1; | |
52 } | |
53 | |
54 message GeolocationMessage { | |
55 oneof type { | |
56 // Server => Client types. | |
57 UpdateListenStateMessage update_listen_state = 1; | |
58 EmptyMessage request_refresh = 2; | |
59 | |
60 // Client => Server types. | |
61 LocationMessage location = 3; | |
62 ErrorMessage error = 4; | |
63 } | |
64 } | |
OLD | NEW |