#include "components/search_engines/enterprise/default_search_policy_handler.h"
#include <stddef.h>
#include <utility>
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "components/prefs/pref_value_map.h"
#include "components/search_engines/default_search_manager.h"
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_data.h"
#include "components/strings/grit/components_strings.h"
namespace policy {
namespace {
void SetListInPref(const PolicyMap& policies,
const char* policy_name,
const char* key,
base::Value::Dict& dict) { … }
void SetStringInPref(const PolicyMap& policies,
const char* policy_name,
const char* key,
base::Value::Dict& dict) { … }
void SetBooleanInPref(const PolicyMap& policies,
const char* policy_name,
const char* key,
base::Value::Dict& dict) { … }
}
const PolicyToPreferenceMapEntry kDefaultSearchPolicyDataMap[] = …;
DefaultSearchPolicyHandler::DefaultSearchPolicyHandler() { … }
DefaultSearchPolicyHandler::~DefaultSearchPolicyHandler() { … }
bool DefaultSearchPolicyHandler::CheckPolicySettings(const PolicyMap& policies,
PolicyErrorMap* errors) { … }
void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
PrefValueMap* prefs) { … }
bool DefaultSearchPolicyHandler::CheckIndividualPolicies(
const PolicyMap& policies,
PolicyErrorMap* errors) { … }
bool DefaultSearchPolicyHandler::HasDefaultSearchPolicy(
const PolicyMap& policies,
const char* policy_name) { … }
bool DefaultSearchPolicyHandler::AnyDefaultSearchPoliciesSpecified(
const PolicyMap& policies) { … }
bool DefaultSearchPolicyHandler::DefaultSearchProviderIsDisabled(
const PolicyMap& policies) { … }
bool DefaultSearchPolicyHandler::DefaultSearchProviderPolicyIsSet(
const PolicyMap& policies) { … }
bool DefaultSearchPolicyHandler::DefaultSearchURLIsValid(
const PolicyMap& policies,
const base::Value** url_value,
std::string* url_string) { … }
void DefaultSearchPolicyHandler::EnsureStringPrefExists(
PrefValueMap* prefs,
const std::string& path) { … }
void DefaultSearchPolicyHandler::EnsureListPrefExists(
PrefValueMap* prefs,
const std::string& path) { … }
}