| // Copyright 2017 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module device.mojom; |
| |
| import "services/device/public/mojom/geolocation.mojom"; |
| import "services/device/public/mojom/geoposition.mojom"; |
| import "url/mojom/url.mojom"; |
| |
| // GeolocationContext provides methods to bind Geolocation instance and to |
| // set/clear overrides of geoposition that will apply to all Geolocation |
| // instances created by this context. |
| interface GeolocationContext { |
| // Creates a Geolocation instance that is bound to the |request|. |
| // The |url| is the URL of the top-level frame which the |request| from, |
| // it is only used for |InstalledWebappGeolocationContext| to separate request |
| // from different Trusted Web Activity client apps. |
| BindGeolocation(pending_receiver<Geolocation> receiver, |
| url.mojom.Url url); |
| |
| // Enables geolocation override. This method can be used to trigger possible |
| // location-specific behavior in GeolocationImpl created by this |
| // GeolocationContext. |
| SetOverride(Geoposition geoposition); |
| |
| // Disables geolocation override. |
| ClearOverride(); |
| }; |