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.
4
5module device.mojom;
6
7import "services/device/public/mojom/geoposition.mojom";
8
9// Geolocation provides updates on the device's location. By default, it
10// provides updates with low accuracy, but |SetHighAccuracy()| may be called
11// to change this.
12interface Geolocation {
13  // Select between high and low accuracy, if supported by the implementation.
14  // Ignored if unsupported.
15  SetHighAccuracy(bool high_accuracy);
16
17  // Use this method to get notified of future position updates, by calling
18  // QueryNextPosition once, and then calling it again when/if it returns.
19  //
20  // When first called:
21  //   Returns the latest known Geoposition.
22  // When subsequently called:
23  //   Issues a request for a single position update, which the implementation
24  //   may fulfill at its discretion (e.g. when the next geoposition change is
25  //   detected).
26  //
27  // Overlapping calls to this method are prohibited and will be treated as a
28  // connection error. Position updates may be throttled by the service.
29  QueryNextPosition() => (Geoposition geoposition);
30};
31