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

Unified Diff: blimp/client/core/geolocation/blimp_location_provider.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 nyquist's #9 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/geolocation/blimp_location_provider.h
diff --git a/blimp/client/core/geolocation/blimp_location_provider.h b/blimp/client/core/geolocation/blimp_location_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0bf34eb129808c4f872f9fa0cdbad027e33c128
--- /dev/null
+++ b/blimp/client/core/geolocation/blimp_location_provider.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_CLIENT_CORE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_
+#define BLIMP_CLIENT_CORE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_
+
+#include <memory>
+
+#include "device/geolocation/geolocation_delegate.h"
+#include "device/geolocation/geoposition.h"
+#include "device/geolocation/location_provider.h"
+
+namespace blimp {
+namespace client {
+
+// Client-side location provider that handles frequency of geolocation updates.
+class BlimpLocationProvider : public device::LocationProvider {
Kevin M 2016/08/19 17:51:37 Perhaps we could provide it with a more descriptiv
CJ 2016/08/19 20:44:01 Done.
Wez 2016/08/19 23:12:10 This class is a pure LocationProvider proxy - it d
CJ 2016/08/22 20:28:08 I agree with moving it over to device/geolocation.
+ public:
+ BlimpLocationProvider();
+ ~BlimpLocationProvider() override;
+
+ // LocationProvider implemenation.
+ void SetUpdateCallback(
+ const LocationProviderUpdateCallback& callback) override;
+ bool StartProvider(bool enable_high_accuracy) override;
+ void StopProvider() override;
+ const device::Geoposition& GetPosition() override;
+ void OnPermissionGranted() override;
+
+ private:
+ void OnLocationUpdate(const device::Geoposition& new_position);
Kevin M 2016/08/19 17:51:37 Comment this method
CJ 2016/08/19 20:44:01 Done.
+
+ std::unique_ptr<device::LocationProvider> location_provider_;
+ LocationProvider::LocationProviderUpdateCallback feature_update_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpLocationProvider);
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_CORE_GEOLOCATION_BLIMP_LOCATION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698