#include "chrome/browser/extensions/standard_management_policy_provider.h"
#include <string>
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/grit/generated_resources.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
#include "extensions/strings/grit/extensions_strings.h"
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "components/safe_browsing/core/common/features.h"
#endif
namespace extensions {
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
BASE_FEATURE(kDisableOffstoreForceInstalledExtensionsInLowTrustEnviroment,
"DisableOffstoreForceInstalledExtensionsInLowTrustEnviroment",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
namespace {
bool AdminPolicyIsModifiable(const Extension* source_extension,
const Extension* extension,
std::u16string* error) { … }
}
StandardManagementPolicyProvider::StandardManagementPolicyProvider(
ExtensionManagement* settings,
Profile* profile)
: … { … }
StandardManagementPolicyProvider::~StandardManagementPolicyProvider() { … }
std::string
StandardManagementPolicyProvider::GetDebugPolicyProviderName() const { … }
bool StandardManagementPolicyProvider::UserMayLoad(
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::UserMayInstall(
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::UserMayModifySettings(
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::ExtensionMayModifySettings(
const Extension* source_extension,
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::MustRemainEnabled(
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::MustRemainDisabled(
const Extension* extension,
disable_reason::DisableReason* reason,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::MustRemainInstalled(
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::ShouldForceUninstall(
const Extension* extension,
std::u16string* error) const { … }
bool StandardManagementPolicyProvider::ReturnLoadError(
const extensions::Extension* extension,
std::u16string* error) const { … }
}