#include "chrome/installer/util/initial_preferences.h"
#include <stddef.h>
#include <memory>
#include <optional>
#include "base/environment.h"
#include "base/files/file_util.h"
#include "base/json/json_string_value_serializer.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/pref_names.h"
#include "chrome/installer/util/initial_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
#include "components/variations/pref_names.h"
#include "rlz/buildflags/buildflags.h"
namespace {
const char kFirstRunTabs[] = …;
base::LazyInstance<installer::InitialPreferences>::DestructorAtExit
g_initial_preferences = …;
std::vector<std::string> GetNamedList(const char* name,
const base::Value::Dict& prefs) { … }
std::optional<base::Value::Dict> ParseDistributionPreferences(
const std::string& json_data) { … }
}
namespace installer {
#if !BUILDFLAG(IS_MAC)
base::FilePath InitialPreferences::Path(const base::FilePath& dir,
bool for_read) { … }
#endif
InitialPreferences::InitialPreferences() { … }
InitialPreferences::InitialPreferences(const base::CommandLine& cmd_line) { … }
InitialPreferences::InitialPreferences(const base::FilePath& prefs_path) { … }
InitialPreferences::InitialPreferences(const std::string& prefs) { … }
InitialPreferences::InitialPreferences(base::Value::Dict prefs)
: … { … }
InitialPreferences::~InitialPreferences() = default;
void InitialPreferences::InitializeFromCommandLine(
const base::CommandLine& cmd_line) { … }
void InitialPreferences::InitializeFromFilePath(
const base::FilePath& prefs_path) { … }
bool InitialPreferences::InitializeFromString(const std::string& json_data) { … }
void InitialPreferences::EnforceLegacyPreferences() { … }
bool InitialPreferences::GetBool(const std::string& name, bool* value) const { … }
bool InitialPreferences::GetInt(const std::string& name, int* value) const { … }
bool InitialPreferences::GetString(const std::string& name,
std::string* value) const { … }
bool InitialPreferences::GetPath(const std::string& name,
base::FilePath* value) const { … }
std::vector<std::string> InitialPreferences::GetFirstRunTabs() const { … }
bool InitialPreferences::GetExtensionsBlock(
const base::Value::Dict*& extensions) const { … }
std::string InitialPreferences::GetCompressedVariationsSeed() { … }
std::string InitialPreferences::GetVariationsSeedSignature() { … }
std::string InitialPreferences::ExtractPrefString(const std::string& name) { … }
const InitialPreferences& InitialPreferences::ForCurrentProcess() { … }
}