mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00

This implements enough of the Geolocation spec that it is now possible for websites to retrieve the current geo position or try to watch for updates (which currently never happen). As it stands now, it only returns a single emulated position that points to San Francisco.
32 lines
757 B
C++
32 lines
757 B
C++
/*
|
|
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/GeolocationCoordinatesPrototype.h>
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
#include <LibWeb/Geolocation/GeolocationCoordinates.h>
|
|
|
|
namespace Web::Geolocation {
|
|
|
|
GC_DEFINE_ALLOCATOR(GeolocationCoordinates);
|
|
|
|
GeolocationCoordinates::GeolocationCoordinates(JS::Realm& realm)
|
|
: PlatformObject(realm)
|
|
{
|
|
}
|
|
|
|
GeolocationCoordinates::GeolocationCoordinates(JS::Realm& realm, CoordinatesData data)
|
|
: PlatformObject(realm)
|
|
, m_coordinates_data(move(data))
|
|
{
|
|
}
|
|
|
|
void GeolocationCoordinates::initialize(JS::Realm& realm)
|
|
{
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(GeolocationCoordinates);
|
|
Base::initialize(realm);
|
|
}
|
|
|
|
}
|