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

Side by Side Diff: blimp/engine/feature/geolocation/blimp_location_provider.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: Addresses kmarshall's #41 comments 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 BLIMP_ENGINE_FEATURE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_ 5 #ifndef BLIMP_ENGINE_FEATURE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_
6 #define BLIMP_ENGINE_FEATURE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_ 6 #define BLIMP_ENGINE_FEATURE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "blimp/common/proto/geolocation.pb.h" 9 #include "blimp/common/proto/geolocation.pb.h"
10 #include "device/geolocation/geoposition.h" 10 #include "device/geolocation/geoposition.h"
(...skipping 19 matching lines...) Expand all
30 virtual void SetUpdateCallback( 30 virtual void SetUpdateCallback(
31 const GeopositionReceivedCallback& callback) = 0; 31 const GeopositionReceivedCallback& callback) = 0;
32 }; 32 };
33 33
34 explicit BlimpLocationProvider(base::WeakPtr<Delegate> delegate); 34 explicit BlimpLocationProvider(base::WeakPtr<Delegate> delegate);
35 ~BlimpLocationProvider() override; 35 ~BlimpLocationProvider() override;
36 36
37 // device::LocationProvider implementation. 37 // device::LocationProvider implementation.
38 bool StartProvider(bool high_accuracy) override; 38 bool StartProvider(bool high_accuracy) override;
39 void StopProvider() override; 39 void StopProvider() override;
40 void GetPosition(device::Geoposition* position) override; 40 const device::Geoposition& GetPosition() override;
41 void RequestRefresh() override;
42 void OnPermissionGranted() override; 41 void OnPermissionGranted() override;
43 void SetUpdateCallback( 42 void SetUpdateCallback(
44 const LocationProviderUpdateCallback& callback) override; 43 const LocationProviderUpdateCallback& callback) override;
45 44
46 private: 45 private:
46 // Provides a hint to the provider that new location data is needed as soon
47 // as possible.
48 void RequestRefresh();
49
47 // This delegate handles a subset of the LocationProvider functionality. 50 // This delegate handles a subset of the LocationProvider functionality.
48 base::WeakPtr<Delegate> delegate_; 51 base::WeakPtr<Delegate> delegate_;
49 52
50 device::Geoposition cached_position_; 53 device::Geoposition cached_position_;
51 54
52 // True if a successful StartProvider call has occured. 55 // True if a successful StartProvider call has occured.
53 bool is_started_; 56 bool is_started_;
54 57
55 DISALLOW_COPY_AND_ASSIGN(BlimpLocationProvider); 58 DISALLOW_COPY_AND_ASSIGN(BlimpLocationProvider);
56 }; 59 };
57 60
58 } // namespace engine 61 } // namespace engine
59 } // namespace blimp 62 } // namespace blimp
60 63
61 #endif // BLIMP_ENGINE_FEATURE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_ 64 #endif // BLIMP_ENGINE_FEATURE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698