#include "chrome/browser/extensions/extension_management_test_util.h"
#include <string>
#include <string_view>
#include <utility>
#include "base/containers/contains.h"
#include "base/run_loop.h"
#include "components/crx_file/id_util.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/policy_constants.h"
namespace extensions {
schema;
namespace {
const char kInstallSourcesPath[] = …;
const char kAllowedTypesPath[] = …;
std::string make_path(const std::string& a, const std::string& b) { … }
void RemoveDictionaryPath(base::Value::Dict& dict, std::string_view path) { … }
}
ExtensionManagementPrefUpdaterBase::ExtensionManagementPrefUpdaterBase() { … }
ExtensionManagementPrefUpdaterBase::~ExtensionManagementPrefUpdaterBase() { … }
void ExtensionManagementPrefUpdaterBase::UnsetPerExtensionSettings(
const ExtensionId& id) { … }
void ExtensionManagementPrefUpdaterBase::ClearPerExtensionSettings(
const ExtensionId& id) { … }
void ExtensionManagementPrefUpdaterBase::SetBlocklistedByDefault(bool value) { … }
void ExtensionManagementPrefUpdaterBase::
ClearInstallationModesForIndividualExtensions() { … }
void
ExtensionManagementPrefUpdaterBase::SetIndividualExtensionInstallationAllowed(
const ExtensionId& id,
bool allowed) { … }
void ExtensionManagementPrefUpdaterBase::SetIndividualExtensionAutoInstalled(
const ExtensionId& id,
const std::string& update_url,
bool forced) { … }
void ExtensionManagementPrefUpdaterBase::UnsetInstallSources() { … }
void ExtensionManagementPrefUpdaterBase::ClearInstallSources() { … }
void ExtensionManagementPrefUpdaterBase::AddInstallSource(
const std::string& install_source) { … }
void ExtensionManagementPrefUpdaterBase::RemoveInstallSource(
const std::string& install_source) { … }
void ExtensionManagementPrefUpdaterBase::UnsetAllowedTypes() { … }
void ExtensionManagementPrefUpdaterBase::ClearAllowedTypes() { … }
void ExtensionManagementPrefUpdaterBase::AddAllowedType(
const std::string& allowed_type) { … }
void ExtensionManagementPrefUpdaterBase::RemoveAllowedType(
const std::string& allowed_type) { … }
void ExtensionManagementPrefUpdaterBase::UnsetBlockedPermissions(
const std::string& prefix) { … }
void ExtensionManagementPrefUpdaterBase::ClearBlockedPermissions(
const std::string& prefix) { … }
void ExtensionManagementPrefUpdaterBase::AddBlockedPermission(
const std::string& prefix,
const std::string& permission) { … }
void ExtensionManagementPrefUpdaterBase::RemoveBlockedPermission(
const std::string& prefix,
const std::string& permission) { … }
void ExtensionManagementPrefUpdaterBase::SetBlockedInstallMessage(
const ExtensionId& id,
const std::string& blocked_install_message) { … }
void ExtensionManagementPrefUpdaterBase::UnsetPolicyBlockedHosts(
const std::string& prefix) { … }
void ExtensionManagementPrefUpdaterBase::ClearPolicyBlockedHosts(
const std::string& prefix) { … }
void ExtensionManagementPrefUpdaterBase::AddPolicyBlockedHost(
const std::string& prefix,
const std::string& host) { … }
void ExtensionManagementPrefUpdaterBase::RemovePolicyBlockedHost(
const std::string& prefix,
const std::string& host) { … }
void ExtensionManagementPrefUpdaterBase::UnsetPolicyAllowedHosts(
const std::string& prefix) { … }
void ExtensionManagementPrefUpdaterBase::ClearPolicyAllowedHosts(
const std::string& prefix) { … }
void ExtensionManagementPrefUpdaterBase::AddPolicyAllowedHost(
const std::string& prefix,
const std::string& host) { … }
void ExtensionManagementPrefUpdaterBase::RemovePolicyAllowedHost(
const std::string& prefix,
const std::string& host) { … }
void ExtensionManagementPrefUpdaterBase::UnsetAllowedPermissions(
const std::string& id) { … }
void ExtensionManagementPrefUpdaterBase::ClearAllowedPermissions(
const std::string& id) { … }
void ExtensionManagementPrefUpdaterBase::AddAllowedPermission(
const std::string& id,
const std::string& permission) { … }
void ExtensionManagementPrefUpdaterBase::RemoveAllowedPermission(
const std::string& id,
const std::string& permission) { … }
void ExtensionManagementPrefUpdaterBase::SetMinimumVersionRequired(
const std::string& id,
const std::string& version) { … }
void ExtensionManagementPrefUpdaterBase::UnsetMinimumVersionRequired(
const std::string& id) { … }
const base::Value::Dict* ExtensionManagementPrefUpdaterBase::GetPref() { … }
void ExtensionManagementPrefUpdaterBase::SetPref(base::Value::Dict pref) { … }
base::Value::Dict ExtensionManagementPrefUpdaterBase::TakePref() { … }
void ExtensionManagementPrefUpdaterBase::ClearList(const std::string& path) { … }
void ExtensionManagementPrefUpdaterBase::AddStringToList(
const std::string& path,
const std::string& str) { … }
void ExtensionManagementPrefUpdaterBase::RemoveStringFromList(
const std::string& path,
const std::string& str) { … }
ExtensionManagementPolicyUpdater::ExtensionManagementPolicyUpdater(
policy::MockConfigurationPolicyProvider* policy_provider)
: … { … }
ExtensionManagementPolicyUpdater::~ExtensionManagementPolicyUpdater() { … }
}