Chromium Code Reviews| Index: blimp/common/proto/geolocation.proto |
| diff --git a/blimp/common/proto/geolocation.proto b/blimp/common/proto/geolocation.proto |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..26158af4713b41d5196194b7a958a880e942b96c |
| --- /dev/null |
| +++ b/blimp/common/proto/geolocation.proto |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2016 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. |
| +// |
| +// Message definitions for geolocation messages. |
| + |
| +syntax = "proto2"; |
| + |
| +option optimize_for = LITE_RUNTIME; |
| + |
| +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.
|
| + |
| +package blimp; |
| + |
| +message ErrorMessage { |
| + // 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.
|
| + // to JavaScript without the need for a conversion. |
| + enum ErrorCode { |
| + option allow_alias = true; |
| + ERROR_CODE_NONE = 0; |
| + ERROR_CODE_PERMISSION_DENIED = 1; |
| + ERROR_CODE_POSITION_UNAVAILABLE = 2; |
| + ERROR_CODE_TIMEOUT = 3; |
| + ERROR_CODE_LAST = 3; |
| + } |
| + |
| + optional ErrorCode error_code = 1; |
| + optional string error_message = 2; |
| +} |
| + |
| +message LocationMessage { |
| + // 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.
|
| + // these fields and associated units. |
| + optional double latitude = 1; |
| + optional double longitude = 2; |
| + optional double altitude = 3; |
| + optional double accuracy = 4; |
| + optional double altitude_accuracy = 5; |
| + optional double heading = 6; |
| + optional double speed = 7; |
| + optional int64 timestamp_millis = 8; |
| +} |
| + |
| +message UpdateListenStateMessage { |
| + enum ListenState { |
| + ACCURACY_HIGH = 0; |
| + ACCURACY_LOW = 1; |
| + STOPPED = 2; |
| + } |
| + |
| + optional ListenState listen_state = 1; |
| +} |
| + |
| +message GeolocationMessage { |
| + oneof type { |
| + // Server => Client types. |
| + UpdateListenStateMessage update_listen_state = 1; |
| + EmptyMessage request_refresh = 2; |
| + |
| + // Client => Server types. |
| + LocationMessage location = 3; |
| + ErrorMessage error = 4; |
| + } |
| +} |