OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
6 module mojo; | 6 module mojo; |
7 | 7 |
8 import "location/public/interfaces/location.mojom"; | 8 import "location/interfaces/location.mojom"; |
9 | 9 |
10 // LocationService provides updates on the device's location. | 10 // LocationService provides updates on the device's location. |
11 // NOTE: This is specifically targetted towards use on Android by | 11 // NOTE: This is specifically targetted towards use on Android by |
12 // implementations which are thin wrappers over the Android Location API or the | 12 // implementations which are thin wrappers over the Android Location API or the |
13 // Google Play Services Location API. If we ever want to expand this to multiple | 13 // Google Play Services Location API. If we ever want to expand this to multiple |
14 // platforms or if it starts growing in complexity, we should strongly consider | 14 // platforms or if it starts growing in complexity, we should strongly consider |
15 // use of Chromium's geolocation code. | 15 // use of Chromium's geolocation code. |
16 interface LocationService { | 16 interface LocationService { |
17 enum UpdatePriority { | 17 enum UpdatePriority { |
18 // Use this setting to request location precision to within a city block. | 18 // Use this setting to request location precision to within a city block. |
19 PRIORITY_BALANCED_POWER_ACCURACY, | 19 PRIORITY_BALANCED_POWER_ACCURACY, |
20 // Use this setting to request the most precise location possible. | 20 // Use this setting to request the most precise location possible. |
21 PRIORITY_HIGH_ACCURACY, | 21 PRIORITY_HIGH_ACCURACY, |
22 // Use this setting to request city-level precision. | 22 // Use this setting to request city-level precision. |
23 PRIORITY_LOW_POWER, | 23 PRIORITY_LOW_POWER, |
24 // Use this setting if you need negligible impact on power consumption, | 24 // Use this setting if you need negligible impact on power consumption, |
25 // but want to receive location updates when available. | 25 // but want to receive location updates when available. |
26 PRIORITY_NO_POWER, | 26 PRIORITY_NO_POWER, |
27 }; | 27 }; |
28 | 28 |
29 // Returns a location when it changes, based on |priority|. If this is the | 29 // Returns a location when it changes, based on |priority|. If this is the |
30 // initial call, the last known location is returned immediately, if | 30 // initial call, the last known location is returned immediately, if |
31 // available. | 31 // available. |
32 // Returns NULL if the client requests a new location while a request is | 32 // Returns NULL if the client requests a new location while a request is |
33 // already in flight. | 33 // already in flight. |
34 GetNextLocation(UpdatePriority priority) => (Location? location); | 34 GetNextLocation(UpdatePriority priority) => (Location? location); |
35 }; | 35 }; |
OLD | NEW |