This source file includes following definitions.
- supplementName
- from
- geolocation
- geolocation
- trace
#include "config.h"
#include "modules/geolocation/NavigatorGeolocation.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Navigator.h"
#include "modules/geolocation/Geolocation.h"
namespace WebCore {
NavigatorGeolocation::NavigatorGeolocation(LocalFrame* frame)
: DOMWindowProperty(frame)
{
}
NavigatorGeolocation::~NavigatorGeolocation()
{
}
const char* NavigatorGeolocation::supplementName()
{
return "NavigatorGeolocation";
}
NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator)
{
NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
supplement = new NavigatorGeolocation(navigator.frame());
provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
}
return *supplement;
}
Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator)
{
return NavigatorGeolocation::from(navigator).geolocation();
}
Geolocation* NavigatorGeolocation::geolocation() const
{
if (!m_geolocation && frame())
m_geolocation = Geolocation::create(frame()->document());
return m_geolocation.get();
}
void NavigatorGeolocation::trace(Visitor* visitor)
{
visitor->trace(m_geolocation);
}
}