#include "services/device/geolocation/location_provider_manager.h"
#include <map>
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "services/device/geolocation/network_location_provider.h"
#include "services/device/geolocation/wifi_polling_policy.h"
#include "services/device/public/cpp/device_features.h"
#include "services/device/public/cpp/geolocation/geoposition.h"
#include "services/device/public/mojom/geolocation_internals.mojom.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace device {
kCustomOnly;
kHybridFallbackNetwork;
kHybridPlatform;
kNetworkOnly;
kPlatformOnly;
LocationProviderManager::LocationProviderManager(
CustomLocationProviderCallback custom_location_provider_getter,
GeolocationSystemPermissionManager* geolocation_system_permission_manager,
const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory,
const std::string& api_key,
std::unique_ptr<PositionCache> position_cache,
base::RepeatingClosure internals_updated_closure,
NetworkLocationProvider::NetworkRequestCallback network_request_callback,
NetworkLocationProvider::NetworkResponseCallback network_response_callback)
: … { … }
LocationProviderManager::~LocationProviderManager() { … }
bool LocationProviderManager::HasPermissionBeenGrantedForTest() const { … }
void LocationProviderManager::OnPermissionGranted() { … }
void LocationProviderManager::StartProvider(bool enable_high_accuracy) { … }
void LocationProviderManager::StopProvider() { … }
void LocationProviderManager::RegisterProvider(LocationProvider& provider) { … }
bool LocationProviderManager::InitializeProvider() { … }
void LocationProviderManager::OnLocationUpdate(
const LocationProvider* provider,
mojom::GeopositionResultPtr new_result) { … }
const mojom::GeopositionResult* LocationProviderManager::GetPosition() { … }
void LocationProviderManager::FillDiagnostics(
mojom::GeolocationDiagnostics& diagnostics) { … }
void LocationProviderManager::SetUpdateCallback(
const LocationProviderUpdateCallback& callback) { … }
std::unique_ptr<LocationProvider>
LocationProviderManager::NewNetworkLocationProvider(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const std::string& api_key) { … }
std::unique_ptr<LocationProvider>
LocationProviderManager::NewSystemLocationProvider() { … }
}