#include "chrome/browser/extensions/extension_safety_check_utils.h"
#include "chrome/browser/extensions/api/developer_private/developer_private_api.h"
#include "chrome/browser/extensions/cws_info_service.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/browser/blocklist_state.h"
#include "extensions/browser/extension_prefs.h"
#include "ui/base/l10n/l10n_util.h"
namespace extensions {
developer;
namespace {
void MigrateSafetyCheckAcknowledgePref(
const Extension& extension,
developer::SafetyCheckWarningReason acknowledged_reason,
developer::SafetyCheckWarningReason top_warning_reason,
ExtensionPrefs* extension_prefs) { … }
bool SafetyCheckShouldShowMalware(
BitMapBlocklistState blocklist_state,
const std::optional<CWSInfoService::CWSInfo>& cws_info) { … }
bool SafetyCheckShouldShowPolicyViolation(
BitMapBlocklistState blocklist_state,
const std::optional<CWSInfoService::CWSInfo>& cws_info) { … }
bool SafetyCheckShouldShowPotentiallyUnwanted(
BitMapBlocklistState blocklist_state) { … }
bool SafetyCheckShouldShowNoPrivacyPractice(
const std::optional<CWSInfoService::CWSInfo>& cws_info) { … }
bool SafetyCheckShouldShowOffstoreExtension(
const Extension& extension,
Profile* profile,
const std::optional<CWSInfoService::CWSInfo>& cws_info) { … }
developer::SafetyCheckWarningReason GetPrefAcknowledgeSafetyCheckWarningReason(
const Extension& extension,
ExtensionPrefs* extension_prefs) { … }
int GetSafetyCheckWarningLevel(
developer::SafetyCheckWarningReason safety_check_warning) { … }
bool SafetyCheckHasUserAcknowledgedWarningLevel(
developer::SafetyCheckWarningReason acknowledged_reason,
developer::SafetyCheckWarningReason warning_reason) { … }
}
namespace ExtensionSafetyCheckUtils {
developer::SafetyCheckWarningReason GetSafetyCheckWarningReason(
const Extension& extension,
Profile* profile,
bool unpublished_only) { … }
developer::SafetyCheckWarningReason GetSafetyCheckWarningReasonHelper(
CWSInfoServiceInterface* cws_info_service,
BitMapBlocklistState blocklist_state,
Profile* profile,
const Extension& extension,
bool unpublished_only) { … }
api::developer_private::SafetyCheckStrings GetSafetyCheckWarningStrings(
developer::SafetyCheckWarningReason warning_reason,
developer::ExtensionState state) { … }
}
}