2018-08-23 15:51:46 +00:00
|
|
|
// Copyright (c) 2018 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
|
2018-08-23 15:51:46 +00:00
|
|
|
|
2018-10-02 22:01:24 +00:00
|
|
|
#include "services/device/public/cpp/geolocation/location_provider.h"
|
2018-08-23 15:51:46 +00:00
|
|
|
#include "services/device/public/mojom/geoposition.mojom.h"
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2018-08-23 15:51:46 +00:00
|
|
|
|
|
|
|
class FakeLocationProvider : public device::LocationProvider {
|
|
|
|
public:
|
|
|
|
FakeLocationProvider();
|
|
|
|
~FakeLocationProvider() override;
|
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
FakeLocationProvider(const FakeLocationProvider&) = delete;
|
|
|
|
FakeLocationProvider& operator=(const FakeLocationProvider&) = delete;
|
|
|
|
|
2018-08-23 15:51:46 +00:00
|
|
|
// LocationProvider Implementation:
|
|
|
|
void SetUpdateCallback(
|
|
|
|
const LocationProviderUpdateCallback& callback) override;
|
|
|
|
void StartProvider(bool high_accuracy) override;
|
|
|
|
void StopProvider() override;
|
2023-05-10 14:47:48 +00:00
|
|
|
const device::mojom::GeopositionResult* GetPosition() override;
|
2018-08-23 15:51:46 +00:00
|
|
|
void OnPermissionGranted() override;
|
|
|
|
|
|
|
|
private:
|
2023-05-10 14:47:48 +00:00
|
|
|
device::mojom::GeopositionResultPtr result_;
|
2018-08-23 15:51:46 +00:00
|
|
|
LocationProviderUpdateCallback callback_;
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2018-08-23 15:51:46 +00:00
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
|