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