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.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
|
|
|
|
#define SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
|
2018-08-23 15:51:46 +00:00
|
|
|
|
|
|
|
#include "base/macros.h"
|
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;
|
|
|
|
|
|
|
|
// LocationProvider Implementation:
|
|
|
|
void SetUpdateCallback(
|
|
|
|
const LocationProviderUpdateCallback& callback) override;
|
|
|
|
void StartProvider(bool high_accuracy) override;
|
|
|
|
void StopProvider() override;
|
|
|
|
const device::mojom::Geoposition& GetPosition() override;
|
|
|
|
void OnPermissionGranted() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
device::mojom::Geoposition position_;
|
|
|
|
LocationProviderUpdateCallback callback_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(FakeLocationProvider);
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2018-08-23 15:51:46 +00:00
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
|