Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2457)

Unified Diff: device/geolocation/location_arbitrator_impl.h

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into lai Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/geolocation/location_arbitrator_impl.h
diff --git a/device/geolocation/location_arbitrator_impl.h b/device/geolocation/location_arbitrator_impl.h
index f21fb9990a15d167a39b4531db4436efe4c645dd..9bd5b62e3c98ae99dc28257141386c07e35dc5ca 100644
--- a/device/geolocation/location_arbitrator_impl.h
+++ b/device/geolocation/location_arbitrator_impl.h
@@ -6,6 +6,7 @@
#define DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_
#include <stdint.h>
+#include <memory>
#include <vector>
#include "base/callback_forward.h"
@@ -18,7 +19,6 @@
#include "device/geolocation/geolocation_export.h"
#include "device/geolocation/geolocation_provider.h"
#include "device/geolocation/geoposition.h"
-#include "device/geolocation/location_arbitrator.h"
#include "device/geolocation/location_provider.h"
#include "net/url_request/url_request_context_getter.h"
@@ -35,7 +35,7 @@ class LocationProvider;
// providers and resolving them to a single 'best' location fix at any given
// moment.
class DEVICE_GEOLOCATION_EXPORT LocationArbitratorImpl
- : public LocationArbitrator {
+ : public LocationProvider {
public:
// Number of milliseconds newer a location provider has to be that it's worth
// switching to this location provider on the basis of it being fresher
@@ -49,12 +49,15 @@ class DEVICE_GEOLOCATION_EXPORT LocationArbitratorImpl
~LocationArbitratorImpl() override;
static GURL DefaultNetworkProviderURL();
-
- // LocationArbitrator
- void StartProviders(bool enable_high_accuracy) override;
- void StopProviders() override;
+ bool HasPermissionBeenGrantedForTest() const;
+
+ // LocationProvider implementation.
+ void SetUpdateCallback(
+ const LocationProviderUpdateCallback& callback) override;
+ bool StartProvider(bool enable_high_accuracy) override;
+ void StopProvider() override;
+ const Geoposition& GetPosition() override;
void OnPermissionGranted() override;
- bool HasPermissionBeenGranted() const override;
protected:
// These functions are useful for injection of dependencies in derived
@@ -81,7 +84,7 @@ class DEVICE_GEOLOCATION_EXPORT LocationArbitratorImpl
void OnAccessTokenStoresLoaded(
AccessTokenStore::AccessTokenMap access_token_map,
const scoped_refptr<net::URLRequestContextGetter>& context_getter);
- void DoStartProviders();
+ bool DoStartProviders();
// Gets called when a provider has a new position.
void OnLocationUpdate(const LocationProvider* provider,

Powered by Google App Engine
This is Rietveld 408576698