#ifndef WEBLAYER_BROWSER_FEATURE_LIST_CREATOR_H_
#define WEBLAYER_BROWSER_FEATURE_LIST_CREATOR_H_
#include <memory>
#include "base/memory/raw_ptr.h"
#include "weblayer/browser/weblayer_field_trials.h"
class PrefService;
namespace variations {
class VariationsService;
}
namespace weblayer {
class SystemNetworkContextManager;
class FeatureListCreator {
public:
explicit FeatureListCreator(PrefService* local_state);
FeatureListCreator(const FeatureListCreator&) = delete;
FeatureListCreator& operator=(const FeatureListCreator&) = delete;
~FeatureListCreator();
static FeatureListCreator* GetInstance();
void SetSystemNetworkContextManager(
SystemNetworkContextManager* system_network_context_manager);
void CreateFeatureListAndFieldTrials();
void PerformPreMainMessageLoopStartup();
void OnBrowserFragmentStarted();
variations::VariationsService* variations_service() const {
return variations_service_.get();
}
private:
void SetUpFieldTrials();
raw_ptr<PrefService> local_state_;
raw_ptr<SystemNetworkContextManager>
system_network_context_manager_;
std::unique_ptr<variations::VariationsService> variations_service_;
WebLayerFieldTrials weblayer_field_trials_;
bool has_browser_fragment_started_ = false;
};
}
#endif