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 // 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).
13 struct MojoGeoposition {
14 // These values follow the W3C geolocation specification and can be returned
15 // to JavaScript without the need for a conversion.
17 ERROR_CODE_NONE = 0, // Chrome addition.
18 ERROR_CODE_PERMISSION_DENIED = 1,
19 ERROR_CODE_POSITION_UNAVAILABLE = 2,
20 ERROR_CODE_TIMEOUT = 3,
21 ERROR_CODE_LAST = ERROR_CODE_TIMEOUT
24 // Whether this geoposition is valid.
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).
31 // Longitude in decimal degrees west (WGS84 coordinate frame).
33 // Altitude in meters (above WGS84 datum).
35 // Accuracy of horizontal position in meters.
37 // Accuracy of altitude in meters.
38 double altitude_accuracy;
39 // Heading in decimal degrees clockwise from true north.
41 // Horizontal component of device velocity in meters per second.
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).
52 // Error code, see enum above.
54 // Human-readable error message.