Exemplo n.º 1
0
Geoposition* Geolocation::lastPosition()
{
    Page* page = this->page();
    if (!page)
        return nullptr;

    m_lastPosition = createGeoposition(GeolocationController::from(page)->lastPosition());

    return m_lastPosition.get();
}
Exemplo n.º 2
0
Geoposition* Geolocation::lastPosition()
{
    LocalFrame* frame = this->frame();
    if (!frame)
        return 0;

    m_lastPosition = createGeoposition(GeolocationController::from(frame)->lastPosition());

    return m_lastPosition.get();
}
Exemplo n.º 3
0
void Geolocation::onPositionUpdated(
    device::mojom::blink::GeopositionPtr position) {
  m_disconnectedGeolocationService = false;
  if (position->valid) {
    m_lastPosition = createGeoposition(*position);
    positionChanged();
  } else {
    handleError(
        createPositionError(position->error_code, position->error_message));
  }
  if (!m_disconnectedGeolocationService)
    queryNextPosition();
}
Exemplo n.º 4
0
Geoposition* Geolocation::lastPosition()
{
#if ENABLE(CLIENT_BASED_GEOLOCATION)
    Page* page = this->page();
    if (!page)
        return 0;

    m_lastPosition = createGeoposition(page->geolocationController()->lastPosition());
#else
    m_lastPosition = m_service->lastPosition();
#endif

    return m_lastPosition.get();
}
Exemplo n.º 5
0
Geoposition* Geolocation::lastPosition()
{
    ASSERT(isAllowed());

#if ENABLE(CLIENT_BASED_GEOLOCATION)
    if (!m_frame)
        return 0;

    Page* page = m_frame->page();
    if (!page)
        return 0;

    m_lastPosition = createGeoposition(page->geolocationController()->lastPosition());
#else
    m_lastPosition = m_service->lastPosition();
#endif

    return m_lastPosition.get();
}
Exemplo n.º 6
0
void Geolocation::setPosition(GeolocationPosition* position)
{
    positionChanged(createGeoposition(position));
}