WebGeolocationClient.cpp [plain text]
#include "config.h"
#include "WebGeolocationClient.h"
#if ENABLE(GEOLOCATION)
#include "GeolocationPermissionRequestManager.h"
#include "WebGeolocationManager.h"
#include "WebPage.h"
#include "WebProcess.h"
#include <WebCore/Geolocation.h>
#include <WebCore/GeolocationPositionData.h>
namespace WebKit {
using namespace WebCore;
WebGeolocationClient::~WebGeolocationClient()
{
}
void WebGeolocationClient::geolocationDestroyed()
{
WebProcess::singleton().supplement<WebGeolocationManager>()->unregisterWebPage(m_page);
delete this;
}
void WebGeolocationClient::startUpdating(const String& authorizationToken)
{
WebProcess::singleton().supplement<WebGeolocationManager>()->registerWebPage(m_page, authorizationToken);
}
void WebGeolocationClient::stopUpdating()
{
WebProcess::singleton().supplement<WebGeolocationManager>()->unregisterWebPage(m_page);
}
void WebGeolocationClient::setEnableHighAccuracy(bool enabled)
{
WebProcess::singleton().supplement<WebGeolocationManager>()->setEnableHighAccuracyForPage(m_page, enabled);
}
Optional<GeolocationPositionData> WebGeolocationClient::lastPosition()
{
return WTF::nullopt;
}
void WebGeolocationClient::requestPermission(Geolocation& geolocation)
{
m_page.geolocationPermissionRequestManager().startRequestForGeolocation(geolocation);
}
void WebGeolocationClient::revokeAuthorizationToken(const String& authorizationToken)
{
m_page.geolocationPermissionRequestManager().revokeAuthorizationToken(authorizationToken);
}
void WebGeolocationClient::cancelPermissionRequest(Geolocation& geolocation)
{
m_page.geolocationPermissionRequestManager().cancelRequestForGeolocation(geolocation);
}
}
#endif // ENABLE(GEOLOCATION)