#include "chrome/browser/ui/webui/metrics_internals/field_trials_handler.h"
#include <string_view>
#include "base/functional/bind.h"
#include "base/strings/string_split.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/variations/field_trial_internals_utils.h"
#include "components/variations/hashing.h"
#include "components/variations/service/variations_service.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace {
HashNameAsHexString;
TrialGroup;
base::Value::Dict ToGroupValue(
bool show_names,
const base::flat_map<std::string, std::string>& overrides,
std::string_view study_name,
std::string_view group_name) { … }
base::Value::Dict ToTrialValue(
bool show_names,
const base::flat_map<std::string, std::string>& overrides,
const variations::StudyGroupNames& study) { … }
TrialGroup FindExperimentFromHashes(
const std::vector<variations::StudyGroupNames>& studies,
std::string_view study_hash,
std::string_view experiment_hash) { … }
std::vector<TrialGroup> ParseGroup(std::string_view name) { … }
}
FieldTrialsHandler::FieldTrialsHandler(Profile* profile) : … { … }
FieldTrialsHandler::~FieldTrialsHandler() = default;
void FieldTrialsHandler::RegisterMessages() { … }
void FieldTrialsHandler::InitializeFieldTrials() { … }
base::Value::Dict FieldTrialsHandler::GetFieldTrialStateValue() { … }
void FieldTrialsHandler::HandleFetchState(const base::Value::List& args) { … }
void FieldTrialsHandler::HandleSetEnrollState(const base::Value::List& args) { … }
bool FieldTrialsHandler::SetOverride(const ExperimentOverride& override,
bool enabled) { … }
void FieldTrialsHandler::HandleRestart(const base::Value::List& args) { … }
void FieldTrialsHandler::HandleLookupTrialOrGroupName(
const base::Value::List& args) { … }