#include "services/device/public/cpp/test/scoped_geolocation_overrider.h"
#include <set>
#include <vector>
#include "base/containers/unique_ptr_adapters.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "services/device/device_service.h"
#include "services/device/public/cpp/geolocation/geoposition.h"
#include "services/device/public/mojom/geolocation.mojom.h"
#include "services/device/public/mojom/geolocation_client_id.mojom.h"
#include "services/device/public/mojom/geolocation_context.mojom.h"
#include "url/origin.h"
namespace device {
class ScopedGeolocationOverrider::FakeGeolocationContext
: public mojom::GeolocationContext { … };
class ScopedGeolocationOverrider::FakeGeolocation : public mojom::Geolocation { … };
ScopedGeolocationOverrider::ScopedGeolocationOverrider(
mojom::GeopositionResultPtr position) { … }
ScopedGeolocationOverrider::ScopedGeolocationOverrider(double latitude,
double longitude) { … }
ScopedGeolocationOverrider::~ScopedGeolocationOverrider() { … }
void ScopedGeolocationOverrider::OverrideGeolocation(
mojom::GeopositionResultPtr result) { … }
void ScopedGeolocationOverrider::UpdateLocation(
mojom::GeopositionResultPtr result) { … }
void ScopedGeolocationOverrider::UpdateLocation(double latitude,
double longitude) { … }
void ScopedGeolocationOverrider::Pause() { … }
void ScopedGeolocationOverrider::Resume() { … }
size_t ScopedGeolocationOverrider::GetGeolocationInstanceCount() const { … }
void ScopedGeolocationOverrider::SetGeolocationCloseCallback(
base::RepeatingClosure closure) { … }
ScopedGeolocationOverrider::FakeGeolocationContext::FakeGeolocationContext(
mojom::GeopositionResultPtr result)
: … { … }
ScopedGeolocationOverrider::FakeGeolocationContext::~FakeGeolocationContext() { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::UpdateLocation(
mojom::GeopositionResultPtr result) { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::OnDisconnect(
FakeGeolocation* impl) { … }
const mojom::GeopositionResult*
ScopedGeolocationOverrider::FakeGeolocationContext::GetGeoposition() const { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::BindForOverrideService(
mojo::PendingReceiver<mojom::GeolocationContext> receiver) { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::BindGeolocation(
mojo::PendingReceiver<mojom::Geolocation> receiver,
const GURL& requesting_origin,
mojom::GeolocationClientId client_id) { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::OnPermissionRevoked(
const url::Origin& origin) { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::SetOverride(
mojom::GeopositionResultPtr result) { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::ClearOverride() { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::Pause() { … }
void ScopedGeolocationOverrider::FakeGeolocationContext::Resume() { … }
size_t ScopedGeolocationOverrider::FakeGeolocationContext::
GetGeolocationInstanceCount() const { … }
ScopedGeolocationOverrider::FakeGeolocation::FakeGeolocation(
mojo::PendingReceiver<mojom::Geolocation> receiver,
const GURL& requesting_url,
FakeGeolocationContext* context)
: … { … }
ScopedGeolocationOverrider::FakeGeolocation::~FakeGeolocation() { … }
void ScopedGeolocationOverrider::FakeGeolocation::OnDisconnect() { … }
void ScopedGeolocationOverrider::FakeGeolocation::OnResume() { … }
void ScopedGeolocationOverrider::FakeGeolocation::
RunPositionCallbackIfNeeded() { … }
void ScopedGeolocationOverrider::FakeGeolocation::UpdateLocation() { … }
void ScopedGeolocationOverrider::FakeGeolocation::OnPermissionRevoked() { … }
void ScopedGeolocationOverrider::FakeGeolocation::QueryNextPosition(
QueryNextPositionCallback callback) { … }
void ScopedGeolocationOverrider::FakeGeolocation::SetHighAccuracy(
bool high_accuracy) { … }
}