| Index: content/public/common/mojo_geoposition.mojom
|
| diff --git a/content/public/common/geoposition.h b/content/public/common/mojo_geoposition.mojom
|
| similarity index 66%
|
| copy from content/public/common/geoposition.h
|
| copy to content/public/common/mojo_geoposition.mojom
|
| index 0494696397288a880716f4ab158a6c58c8144865..f9818b56eb5bc7be84fcdd3aa8fc757352dc8c6e 100644
|
| --- a/content/public/common/geoposition.h
|
| +++ b/content/public/common/mojo_geoposition.mojom
|
| @@ -1,23 +1,16 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright 2014 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.
|
|
|
| // This file declares the Geoposition structure, used to represent a position
|
| // fix. It was originally derived from:
|
| // http://gears.googlecode.com/svn/trunk/gears/geolocation/geolocation.h
|
| +// TODO(blundell): Investigate killing content::Geoposition in favor of using
|
| +// this struct everywhere (and renaming it to Geoposition).
|
|
|
| -#ifndef CONTENT_PUBLIC_COMMON_GEOPOSITION_H_
|
| -#define CONTENT_PUBLIC_COMMON_GEOPOSITION_H_
|
| +module content {
|
|
|
| -#include <string>
|
| -
|
| -#include "base/time/time.h"
|
| -#include "content/common/content_export.h"
|
| -
|
| -namespace content {
|
| -
|
| -struct CONTENT_EXPORT Geoposition {
|
| - public:
|
| +struct MojoGeoposition {
|
| // These values follow the W3C geolocation specification and can be returned
|
| // to JavaScript without the need for a conversion.
|
| enum ErrorCode {
|
| @@ -28,12 +21,8 @@ struct CONTENT_EXPORT Geoposition {
|
| ERROR_CODE_LAST = ERROR_CODE_TIMEOUT
|
| };
|
|
|
| - // All fields are initialized to sentinel values marking them as invalid. The
|
| - // error code is set to ERROR_CODE_NONE.
|
| - Geoposition();
|
| -
|
| - // A valid fix has a valid latitude, longitude, accuracy and timestamp.
|
| - bool Validate() const;
|
| + // Whether this geoposition is valid.
|
| + bool valid;
|
|
|
| // These properties correspond to those of the JavaScript Position object
|
| // although their types may differ.
|
| @@ -51,17 +40,19 @@ struct CONTENT_EXPORT Geoposition {
|
| double heading;
|
| // Horizontal component of device velocity in meters per second.
|
| double speed;
|
| - // Time of position measurement in milisecons since Epoch in UTC time. This is
|
| + // TODO(blundell): If I need to represent this differently to use this
|
| + // struct to replace content::Geolocation, I'll need to convert
|
| + // correctly into seconds-since-epoch when using this in
|
| + // GeolocationDispatcher::OnLocationUpdate().
|
| + // Time of position measurement in seconds since Epoch in UTC time. This is
|
| // taken from the host computer's system clock (i.e. from Time::Now(), not the
|
| // source device's clock).
|
| - base::Time timestamp;
|
| + double timestamp;
|
|
|
| // Error code, see enum above.
|
| ErrorCode error_code;
|
| // Human-readable error message.
|
| - std::string error_message;
|
| + string error_message;
|
| };
|
|
|
| -} // namespace content
|
| -
|
| -#endif // CONTENT_COMMON_GEOPOSITION_H_
|
| +}
|
|
|