Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / content / public / common / geoposition.h
blob1ea89f9a7e6cd036b877fe6c26fbe4c94be79883
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
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
9 #ifndef CONTENT_PUBLIC_COMMON_GEOPOSITION_H_
10 #define CONTENT_PUBLIC_COMMON_GEOPOSITION_H_
12 #include <string>
14 #include "base/time.h"
15 #include "content/common/content_export.h"
17 namespace content {
19 struct CONTENT_EXPORT Geoposition {
20 public:
21 // These values follow the W3C geolocation specification and can be returned
22 // to JavaScript without the need for a conversion.
23 enum ErrorCode {
24 ERROR_CODE_NONE = 0, // Chrome addition.
25 ERROR_CODE_PERMISSION_DENIED = 1,
26 ERROR_CODE_POSITION_UNAVAILABLE = 2,
27 ERROR_CODE_TIMEOUT = 3,
30 // All fields are initialized to sentinel values marking them as invalid. The
31 // error code is set to ERROR_CODE_NONE.
32 Geoposition();
34 // A valid fix has a valid latitude, longitude, accuracy and timestamp.
35 bool Validate() const;
37 // These properties correspond to those of the JavaScript Position object
38 // although their types may differ.
39 // Latitude in decimal degrees north (WGS84 coordinate frame).
40 double latitude;
41 // Longitude in decimal degrees west (WGS84 coordinate frame).
42 double longitude;
43 // Altitude in meters (above WGS84 datum).
44 double altitude;
45 // Accuracy of horizontal position in meters.
46 double accuracy;
47 // Accuracy of altitude in meters.
48 double altitude_accuracy;
49 // Heading in decimal degrees clockwise from true north.
50 double heading;
51 // Horizontal component of device velocity in meters per second.
52 double speed;
53 // Time of position measurement in milisecons since Epoch in UTC time. This is
54 // taken from the host computer's system clock (i.e. from Time::Now(), not the
55 // source device's clock).
56 base::Time timestamp;
58 // Error code, see enum above.
59 ErrorCode error_code;
60 // Human-readable error message.
61 std::string error_message;
64 } // namespace content
66 #endif // CONTENT_COMMON_GEOPOSITION_H_