| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_ | 5 #ifndef DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_ |
| 6 #define DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_ | 6 #define DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_list.h" | 10 #include "base/callback_list.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual std::unique_ptr<Subscription> AddLocationUpdateCallback( | 43 virtual std::unique_ptr<Subscription> AddLocationUpdateCallback( |
| 44 const LocationUpdateCallback& callback, | 44 const LocationUpdateCallback& callback, |
| 45 bool enable_high_accuracy) = 0; | 45 bool enable_high_accuracy) = 0; |
| 46 | 46 |
| 47 // Calling this method indicates the user has opted into using location | 47 // Calling this method indicates the user has opted into using location |
| 48 // services, including sending network requests to [Google servers to] resolve | 48 // services, including sending network requests to [Google servers to] resolve |
| 49 // the user's location. Use this method carefully, in line with the rules in | 49 // the user's location. Use this method carefully, in line with the rules in |
| 50 // go/chrome-privacy-doc. | 50 // go/chrome-privacy-doc. |
| 51 virtual void UserDidOptIntoLocationServices() = 0; | 51 virtual void UserDidOptIntoLocationServices() = 0; |
| 52 | 52 |
| 53 virtual bool HighAccuracyLocationInUse() = 0; |
| 54 |
| 53 // Overrides the current location for testing. | 55 // Overrides the current location for testing. |
| 54 // | 56 // |
| 55 // Overrides the location for automation/testing. Suppresses any further | 57 // Overrides the location for automation/testing. Suppresses any further |
| 56 // updates from the actual providers and sends an update with the overridden | 58 // updates from the actual providers and sends an update with the overridden |
| 57 // position to all registered clients. | 59 // position to all registered clients. |
| 58 // | 60 // |
| 59 // Do not use this function in unit tests. The function instantiates the | 61 // Do not use this function in unit tests. The function instantiates the |
| 60 // singleton geolocation stack in the background and manipulates it to report | 62 // singleton geolocation stack in the background and manipulates it to report |
| 61 // a fake location. Neither step can be undone, breaking unit test isolation | 63 // a fake location. Neither step can be undone, breaking unit test isolation |
| 62 // (crbug.com/125931). | 64 // (crbug.com/125931). |
| 63 virtual void OverrideLocationForTesting(const Geoposition& position) = 0; | 65 virtual void OverrideLocationForTesting(const Geoposition& position) = 0; |
| 64 | 66 |
| 65 protected: | 67 protected: |
| 66 virtual ~GeolocationProvider() {} | 68 virtual ~GeolocationProvider() {} |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace device | 71 } // namespace device |
| 70 | 72 |
| 71 #endif // DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_ | 73 #endif // DEVICE_GEOLOCATION_GEOLOCATION_PROVIDER_H_ |
| OLD | NEW |