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

Side by Side Diff: device/geolocation/rate_limiting_location_provider_proxy.h

Issue 2249283003: Hooks together Geolocation Feature in the Client and Engine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lai
Patch Set: Addresses Wez's #14 comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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
5 #ifndef DEVICE_GEOLOCATION_RATE_LIMITING_LOCATION_PROVIDER_PROXY_H_
6 #define DEVICE_GEOLOCATION_RATE_LIMITING_LOCATION_PROVIDER_PROXY_H_
7
8 #include <memory>
9
10 #include "device/geolocation/geolocation_delegate.h"
11 #include "device/geolocation/geoposition.h"
12 #include "device/geolocation/location_provider.h"
13
14 namespace device {
15
16 // Location provider that limits the rate of geolocation updates.
17 // TODO(lethalantidote): Schedule aspect still to be implemented. Dummy for now.
18 class DEVICE_GEOLOCATION_EXPORT RateLimitingLocationProviderProxy
19 : public LocationProvider {
20 public:
21 RateLimitingLocationProviderProxy();
22 ~RateLimitingLocationProviderProxy() override;
23
24 // LocationProvider implemenation.
25 void SetUpdateCallback(
26 const LocationProviderUpdateCallback& callback) override;
27 bool StartProvider(bool enable_high_accuracy) override;
28 void StopProvider() override;
29 const Geoposition& GetPosition() override;
30 void OnPermissionGranted() override;
31
32 private:
33 // Limits the rate in which location updates from |location_provider_| will
34 // get passed along through |feature_update_callback_|.
35 void OnLocationUpdate(const LocationProvider* provider,
36 const Geoposition& new_position);
37
38 std::unique_ptr<LocationProvider> location_provider_;
39 LocationProvider::LocationProviderUpdateCallback feature_update_callback_;
40
41 DISALLOW_COPY_AND_ASSIGN(RateLimitingLocationProviderProxy);
42 };
43
44 } // namespace device
45
46 #endif // DEVICE_GEOLOCATION_RATE_LIMITING_LOCATION_PROVIDER_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698