OLD | NEW |
| (Empty) |
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. | |
4 | |
5 // This file declares the Geoposition structure, used to represent a position | |
6 // fix. It was originally derived from: | |
7 // http://gears.googlecode.com/svn/trunk/gears/geolocation/geolocation.h | |
8 // TODO(blundell): Investigate killing content::Geoposition in favor of using | |
9 // this struct everywhere (and renaming it to Geoposition). | |
10 | |
11 module content.mojom; | |
12 | |
13 struct MojoGeoposition { | |
14 // These values follow the W3C geolocation specification and can be returned | |
15 // to JavaScript without the need for a conversion. | |
16 enum ErrorCode { | |
17 NONE = 0, // Chrome addition. | |
18 PERMISSION_DENIED = 1, | |
19 POSITION_UNAVAILABLE = 2, | |
20 TIMEOUT = 3, | |
21 LAST = TIMEOUT | |
22 }; | |
23 | |
24 // Whether this geoposition is valid. | |
25 bool valid; | |
26 | |
27 // These properties correspond to those of the JavaScript Position object | |
28 // although their types may differ. | |
29 // Latitude in decimal degrees north (WGS84 coordinate frame). | |
30 double latitude; | |
31 // Longitude in decimal degrees west (WGS84 coordinate frame). | |
32 double longitude; | |
33 // Altitude in meters (above WGS84 datum). | |
34 double altitude; | |
35 // Accuracy of horizontal position in meters. | |
36 double accuracy; | |
37 // Accuracy of altitude in meters. | |
38 double altitude_accuracy; | |
39 // Heading in decimal degrees clockwise from true north. | |
40 double heading; | |
41 // Horizontal component of device velocity in meters per second. | |
42 double speed; | |
43 // TODO(blundell): If I need to represent this differently to use this | |
44 // struct to replace content::Geolocation, I'll need to convert | |
45 // correctly into seconds-since-epoch when using this in | |
46 // GeolocationDispatcher::OnLocationUpdate(). | |
47 // Time of position measurement in seconds since Epoch in UTC time. This is | |
48 // taken from the host computer's system clock (i.e. from Time::Now(), not the | |
49 // source device's clock). | |
50 double timestamp; | |
51 | |
52 // Error code, see enum above. | |
53 ErrorCode error_code; | |
54 // Human-readable error message. | |
55 string error_message; | |
56 }; | |
OLD | NEW |