Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file declares the Geoposition structure, used to represent a position | 5 // This file declares the Geoposition structure, used to represent a position |
| 6 // fix. It was originally derived from: | 6 // fix. It was originally derived from: |
| 7 // http://gears.googlecode.com/svn/trunk/gears/geolocation/geolocation.h | 7 // http://gears.googlecode.com/svn/trunk/gears/geolocation/geolocation.h |
| 8 | 8 |
| 9 #ifndef CONTENT_PUBLIC_COMMON_GEOPOSITION_H_ | 9 #ifndef CONTENT_PUBLIC_COMMON_GEOPOSITION_H_ |
| 10 #define CONTENT_PUBLIC_COMMON_GEOPOSITION_H_ | 10 #define CONTENT_PUBLIC_COMMON_GEOPOSITION_H_ |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 ERROR_CODE_LAST = ERROR_CODE_TIMEOUT | 28 ERROR_CODE_LAST = ERROR_CODE_TIMEOUT |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // All fields are initialized to sentinel values marking them as invalid. The | 31 // All fields are initialized to sentinel values marking them as invalid. The |
| 32 // error code is set to ERROR_CODE_NONE. | 32 // error code is set to ERROR_CODE_NONE. |
| 33 Geoposition(); | 33 Geoposition(); |
| 34 | 34 |
| 35 // A valid fix has a valid latitude, longitude, accuracy and timestamp. | 35 // A valid fix has a valid latitude, longitude, accuracy and timestamp. |
| 36 bool Validate() const; | 36 bool Validate() const; |
| 37 | 37 |
| 38 // Creates a new geoposition according to the specified precision. | |
| 39 static Geoposition ApplyPrecision(const Geoposition& position, | |
| 40 const int precisions); | |
|
meacer
2014/08/15 23:34:46
precisions -> precision
| |
| 41 | |
| 38 // These properties correspond to those of the JavaScript Position object | 42 // These properties correspond to those of the JavaScript Position object |
| 39 // although their types may differ. | 43 // although their types may differ. |
| 40 // Latitude in decimal degrees north (WGS84 coordinate frame). | 44 // Latitude in decimal degrees north (WGS84 coordinate frame). |
| 41 double latitude; | 45 double latitude; |
| 42 // Longitude in decimal degrees west (WGS84 coordinate frame). | 46 // Longitude in decimal degrees west (WGS84 coordinate frame). |
| 43 double longitude; | 47 double longitude; |
| 44 // Altitude in meters (above WGS84 datum). | 48 // Altitude in meters (above WGS84 datum). |
| 45 double altitude; | 49 double altitude; |
| 46 // Accuracy of horizontal position in meters. | 50 // Accuracy of horizontal position in meters. |
| 47 double accuracy; | 51 double accuracy; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 58 | 62 |
| 59 // Error code, see enum above. | 63 // Error code, see enum above. |
| 60 ErrorCode error_code; | 64 ErrorCode error_code; |
| 61 // Human-readable error message. | 65 // Human-readable error message. |
| 62 std::string error_message; | 66 std::string error_message; |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 } // namespace content | 69 } // namespace content |
| 66 | 70 |
| 67 #endif // CONTENT_COMMON_GEOPOSITION_H_ | 71 #endif // CONTENT_COMMON_GEOPOSITION_H_ |
| OLD | NEW |