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 #ifndef CHROMEOS_GEOLOCATION_GEOPOSITION_H_
6 #define CHROMEOS_GEOLOCATION_GEOPOSITION_H_
10 #include "base/time/time.h"
11 #include "chromeos/chromeos_export.h"
15 // This structure represents Google Maps Geolocation response.
16 // Based on content/public/common/geoposition.h .
17 struct CHROMEOS_EXPORT Geoposition
{
18 // Geolocation API client status.
19 // (Server status is reported in "error_code" field.)
22 STATUS_OK
, // Response successful.
23 STATUS_SERVER_ERROR
, // Received error object.
24 STATUS_NETWORK_ERROR
, // Received bad or no response.
25 STATUS_TIMEOUT
, // Request stopped because of timeout.
26 STATUS_LAST
= STATUS_TIMEOUT
29 // All fields are initialized to sentinel values marking them as invalid. The
30 // status is set to STATUS_NONE.
33 // A valid fix has a valid latitude, longitude, accuracy and timestamp.
36 // Serialize to string.
37 std::string
ToString() const;
39 // Latitude in decimal degrees north.
42 // Longitude in decimal degrees west.
45 // Accuracy of horizontal position in meters.
49 // Value of "error.code".
52 // Human-readable error message.
53 std::string error_message
;
55 // Absolute time, when this position was acquired. This is
56 // taken from the host computer's system clock (i.e. from Time::Now(), not the
57 // source device's clock).
64 } // namespace chromeos
66 #endif // CHROMEOS_GEOLOCATION_GEOPOSITION_H_