#ifndef SERVICES_NETWORK_HTTP_SERVER_PROPERTIES_PREF_DELEGATE_H_
#define SERVICES_NETWORK_HTTP_SERVER_PROPERTIES_PREF_DELEGATE_H_
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "components/prefs/pref_change_registrar.h"
#include "net/http/http_server_properties.h"
class PrefRegistrySimple;
namespace network {
class HttpServerPropertiesPrefDelegate
: public net::HttpServerProperties::PrefDelegate {
public:
explicit HttpServerPropertiesPrefDelegate(PrefService* pref_service);
HttpServerPropertiesPrefDelegate(const HttpServerPropertiesPrefDelegate&) =
delete;
HttpServerPropertiesPrefDelegate& operator=(
const HttpServerPropertiesPrefDelegate&) = delete;
~HttpServerPropertiesPrefDelegate() override;
static void RegisterPrefs(PrefRegistrySimple* pref_registry);
const base::Value::Dict& GetServerProperties() const override;
void SetServerProperties(base::Value::Dict dict,
base::OnceClosure callback) override;
void WaitForPrefLoad(base::OnceClosure callback) override;
private:
raw_ptr<PrefService> pref_service_;
PrefChangeRegistrar pref_change_registrar_;
};
}
#endif