#include "chrome/browser/ui/safety_hub/extensions_result.h"
#include <memory>
#include <optional>
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_safety_check_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/safety_hub/safety_hub_constants.h"
#include "chrome/browser/ui/safety_hub/safety_hub_service.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_prefs_factory.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_set.h"
#include "ui/base/l10n/l10n_util.h"
developer;
SafetyHubExtensionsResult::SafetyHubExtensionsResult(
std::set<extensions::ExtensionId> triggering_extensions,
bool is_unpublished_extensions_only)
: … { … }
SafetyHubExtensionsResult::SafetyHubExtensionsResult(
const SafetyHubExtensionsResult&) = default;
SafetyHubExtensionsResult& SafetyHubExtensionsResult::operator=(
const SafetyHubExtensionsResult&) = default;
SafetyHubExtensionsResult::~SafetyHubExtensionsResult() = default;
std::optional<std::unique_ptr<SafetyHubService::Result>>
SafetyHubExtensionsResult::GetResult(
Profile* profile,
bool only_unpublished_extensions = false) { … }
std::unique_ptr<SafetyHubService::Result> SafetyHubExtensionsResult::Clone()
const { … }
void SafetyHubExtensionsResult::OnExtensionPrefsUpdated(
const std::string& extension_id,
Profile* profile) { … }
void SafetyHubExtensionsResult::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UninstallReason reason) { … }
base::Value::Dict SafetyHubExtensionsResult::ToDictValue() const { … }
bool SafetyHubExtensionsResult::IsTriggerForMenuNotification() const { … }
unsigned int SafetyHubExtensionsResult::GetNumTriggeringExtensions() const { … }
bool SafetyHubExtensionsResult::WarrantsNewMenuNotification(
const base::Value::Dict& previous_result_dict) const { … }
std::u16string SafetyHubExtensionsResult::GetNotificationString() const { … }
int SafetyHubExtensionsResult::GetNotificationCommandId() const { … }
void SafetyHubExtensionsResult::ClearTriggeringExtensionsForTesting() { … }
void SafetyHubExtensionsResult::SetTriggeringExtensionForTesting(
std::string extension_id) { … }