Esempio n. 1
0
void
nsGeolocationService::SetHigherAccuracy(bool aEnable)
{
  bool highRequired = aEnable || HighAccuracyRequested();

  if (XRE_GetProcessType() == GeckoProcessType_Content) {
    ContentChild* cpc = ContentChild::GetSingleton();
    cpc->SendSetGeolocationHigherAccuracy(highRequired);
    return;
  }

  if (!mHigherAccuracy && highRequired) {
    for (int32_t i = 0; i < mProviders.Count(); i++) {
      mProviders[i]->SetHighAccuracy(true);
    }
  }

  if (mHigherAccuracy && !highRequired) {
    for (int32_t i = 0; i < mProviders.Count(); i++) {
      mProviders[i]->SetHighAccuracy(false);
    }
  }

  mHigherAccuracy = highRequired;
}
Esempio n. 2
0
void
nsGeolocationService::SetHigherAccuracy(bool aEnable)
{
    bool highRequired = aEnable || HighAccuracyRequested();

    if (XRE_GetProcessType() == GoannaProcessType_Content) {
        ContentChild* cpc = ContentChild::GetSingleton();
        cpc->SendSetGeolocationHigherAccuracy(highRequired);
        return;
    }

    if (!mHigherAccuracy && highRequired) {
        mProvider->SetHighAccuracy(true);
    }

    if (mHigherAccuracy && !highRequired) {
        mProvider->SetHighAccuracy(false);
    }

    mHigherAccuracy = highRequired;
}