chromium/services/device/geolocation/location_provider_manager.h

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SERVICES_DEVICE_GEOLOCATION_LOCATION_PROVIDER_MANAGER_H_
#define SERVICES_DEVICE_GEOLOCATION_LOCATION_PROVIDER_MANAGER_H_

#include <stdint.h>
#include <memory>
#include <string>
#include <vector>

#include "base/cancelable_callback.h"
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "services/device/geolocation/geolocation_provider_impl.h"
#include "services/device/geolocation/network_location_provider.h"
#include "services/device/geolocation/position_cache.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/device/public/mojom/geolocation_internals.mojom.h"
#include "services/device/public/mojom/geoposition.mojom.h"
#include "url/gurl.h"

namespace network {
class SharedURLLoaderFactory;
}

namespace device {

class GeolocationSystemPermissionManager;

// `LocationProviderManager` manages the selection and lifecycle of location
// providers based on platform capabilities and feature parameters. Supports
// mode-based selection (platform, network, custom, hybrid) and fallback
// mechanism for error position handling.
class LocationProviderManager : public LocationProvider {};

// Factory functions for the various types of location provider to abstract
// over the platform-dependent implementations.
#if BUILDFLAG(IS_APPLE)
std::unique_ptr<LocationProvider> NewSystemLocationProvider(
    SystemGeolocationSource& system_geolocation_source);
#else
std::unique_ptr<LocationProvider> NewSystemLocationProvider();
#endif

}  // namespace device

#endif  // SERVICES_DEVICE_GEOLOCATION_LOCATION_PROVIDER_MANAGER_H_