mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-28 16:26:10 +03:00
61 lines
2.3 KiB
Plaintext
61 lines
2.3 KiB
Plaintext
// Copyright 2017 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
module device.mojom;
|
|
|
|
import "mojo/public/mojom/base/time.mojom";
|
|
|
|
// Sentinel values to mark invalid data. (WebKit carries companion is_valid
|
|
// bools for this purpose; we may eventually follow that approach, but
|
|
// sentinels worked OK in the Gears code this is based on.)
|
|
const double kBadLatitudeLongitude = 200;
|
|
// Lowest point on land is at approximately -400 meters.
|
|
const double kBadAltitude = -10000;
|
|
const double kBadAccuracy = -1; // Accuracy must be non-negative.
|
|
const double kBadHeading = -1; // Heading must be non-negative.
|
|
const double kBadSpeed = -1;
|
|
|
|
// A Geoposition represents a position fix. It was originally derived from:
|
|
// http://gears.googlecode.com/svn/trunk/gears/geolocation/geolocation.h
|
|
struct Geoposition {
|
|
// These values follow the W3C geolocation specification and can be returned
|
|
// to JavaScript without the need for a conversion.
|
|
enum ErrorCode {
|
|
NONE = 0, // Chrome addition.
|
|
PERMISSION_DENIED = 1,
|
|
POSITION_UNAVAILABLE = 2,
|
|
TIMEOUT = 3,
|
|
LAST = TIMEOUT
|
|
};
|
|
|
|
// Whether this geoposition is valid.
|
|
bool valid;
|
|
|
|
// These properties correspond to those of the JavaScript Position object
|
|
// although their types may differ.
|
|
// Latitude in decimal degrees north (WGS84 coordinate frame).
|
|
double latitude = kBadLatitudeLongitude;
|
|
// Longitude in decimal degrees west (WGS84 coordinate frame).
|
|
double longitude = kBadLatitudeLongitude;
|
|
// Altitude in meters (above WGS84 datum).
|
|
double altitude = kBadAltitude;
|
|
// Accuracy of horizontal position in meters.
|
|
double accuracy = kBadAccuracy;
|
|
// Accuracy of altitude in meters.
|
|
double altitude_accuracy = kBadAccuracy;
|
|
// Heading in decimal degrees clockwise from true north.
|
|
double heading = kBadHeading;
|
|
// Horizontal component of device velocity in meters per second.
|
|
double speed = kBadSpeed;
|
|
// Time of position measurement in seconds since the Windows FILETIME epoch
|
|
// (1601-01-01 00:00:00 UTC). This is taken from the host computer's system
|
|
// clock (i.e. from Time::Now(), not the source device's clock).
|
|
mojo_base.mojom.Time timestamp;
|
|
|
|
// Error code, see enum above.
|
|
ErrorCode error_code = NONE;
|
|
// Human-readable error message.
|
|
string error_message;
|
|
};
|