2025-01-28 11:24:46 -06:00
|
|
|
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
|
|
|
|
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
2025-02-23 17:24:33 -06:00
|
|
|
@@ -599,17 +599,6 @@ void ExtensionInfoGenerator::CreateExten
|
2025-01-28 11:24:46 -06:00
|
|
|
info->controlled_info.emplace();
|
|
|
|
|
info->controlled_info->text =
|
|
|
|
|
l10n_util::GetStringUTF8(IDS_EXTENSIONS_INSTALL_LOCATION_ENTERPRISE);
|
|
|
|
|
- } else {
|
|
|
|
|
- // Create Safety Hub information for any non-enterprise extension.
|
|
|
|
|
- developer::SafetyCheckWarningReason warning_reason =
|
|
|
|
|
- ExtensionSafetyCheckUtils::GetSafetyCheckWarningReason(extension,
|
|
|
|
|
- profile);
|
|
|
|
|
- if (warning_reason != developer::SafetyCheckWarningReason::kNone) {
|
|
|
|
|
- info->safety_check_warning_reason = warning_reason;
|
|
|
|
|
- info->safety_check_text =
|
|
|
|
|
- ExtensionSafetyCheckUtils::GetSafetyCheckWarningStrings(
|
|
|
|
|
- warning_reason, state);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool is_enabled = state == developer::ExtensionState::kEnabled;
|
2024-06-05 11:57:45 -05:00
|
|
|
--- a/chrome/browser/extensions/extension_management.cc
|
|
|
|
|
+++ b/chrome/browser/extensions/extension_management.cc
|
2025-02-23 17:24:33 -06:00
|
|
|
@@ -318,31 +318,7 @@ bool ExtensionManagement::IsAllowedManif
|
2024-06-05 11:57:45 -05:00
|
|
|
int manifest_version,
|
|
|
|
|
const std::string& extension_id,
|
|
|
|
|
Manifest::Type manifest_type) {
|
|
|
|
|
- bool enabled_by_default =
|
|
|
|
|
- !base::FeatureList::IsEnabled(
|
|
|
|
|
- extensions_features::kExtensionsManifestV3Only) ||
|
|
|
|
|
- manifest_version >= 3;
|
|
|
|
|
-
|
|
|
|
|
- // Manifest version policy only supports normal extensions and Chrome OS login
|
|
|
|
|
- // screen extension.
|
|
|
|
|
- if (manifest_type != Manifest::Type::TYPE_EXTENSION &&
|
|
|
|
|
- manifest_type != Manifest::Type::TYPE_LOGIN_SCREEN_EXTENSION) {
|
|
|
|
|
- return enabled_by_default;
|
|
|
|
|
- }
|
|
|
|
|
- switch (global_settings_->manifest_v2_setting) {
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kDefault:
|
|
|
|
|
- return enabled_by_default;
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kDisabled:
|
|
|
|
|
- return manifest_version >= 3;
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kEnabled:
|
|
|
|
|
return true;
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kEnabledForForceInstalled:
|
|
|
|
|
- auto installation_mode =
|
|
|
|
|
- GetInstallationMode(extension_id, /*update_url=*/std::string());
|
|
|
|
|
- return manifest_version >= 3 ||
|
|
|
|
|
- installation_mode == INSTALLATION_FORCED ||
|
|
|
|
|
- installation_mode == INSTALLATION_RECOMMENDED;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ExtensionManagement::IsAllowedManifestVersion(const Extension* extension) {
|
2025-02-23 17:24:33 -06:00
|
|
|
@@ -363,26 +339,8 @@ bool ExtensionManagement::IsExemptFromMV
|
2024-06-05 11:57:45 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- switch (global_settings_->manifest_v2_setting) {
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kDefault:
|
|
|
|
|
- // Default browser behavior. Not exempt.
|
|
|
|
|
- return false;
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kDisabled:
|
|
|
|
|
- // All MV2 extensions are disallowed. Not exempt.
|
|
|
|
|
- return false;
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kEnabled:
|
|
|
|
|
// All MV2 extensions are allowed. Exempt.
|
|
|
|
|
return true;
|
|
|
|
|
- case internal::GlobalSettings::ManifestV2Setting::kEnabledForForceInstalled:
|
|
|
|
|
- // Force-installed MV2 extensions are allowed. Exempt if it's a force-
|
|
|
|
|
- // installed extension only.
|
|
|
|
|
- auto installation_mode =
|
|
|
|
|
- GetInstallationMode(extension_id, /*update_url=*/std::string());
|
|
|
|
|
- return installation_mode == INSTALLATION_FORCED ||
|
|
|
|
|
- installation_mode == INSTALLATION_RECOMMENDED;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ExtensionManagement::IsAllowedByUnpublishedAvailabilityPolicy(
|
|
|
|
|
--- a/chrome/browser/extensions/manifest_v2_experiment_manager.cc
|
|
|
|
|
+++ b/chrome/browser/extensions/manifest_v2_experiment_manager.cc
|
2025-02-23 17:24:33 -06:00
|
|
|
@@ -145,22 +145,6 @@ bool ManifestV2ExperimentManagerFactory:
|
2024-06-05 11:57:45 -05:00
|
|
|
|
2024-08-15 14:47:11 -05:00
|
|
|
// Determines the current stage of the MV2 deprecation experiments.
|
2024-06-05 11:57:45 -05:00
|
|
|
MV2ExperimentStage CalculateCurrentExperimentStage() {
|
2024-08-15 14:47:11 -05:00
|
|
|
- // Return the "highest" stage that is currently active for the user.
|
|
|
|
|
- if (base::FeatureList::IsEnabled(
|
2024-11-06 10:56:00 -06:00
|
|
|
- extensions_features::kExtensionManifestV2Unsupported)) {
|
|
|
|
|
- return MV2ExperimentStage::kUnsupported;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (base::FeatureList::IsEnabled(
|
2024-08-15 14:47:11 -05:00
|
|
|
- extensions_features::kExtensionManifestV2Disabled)) {
|
|
|
|
|
- return MV2ExperimentStage::kDisableWithReEnable;
|
|
|
|
|
- }
|
|
|
|
|
-
|
2024-06-05 11:57:45 -05:00
|
|
|
- if (base::FeatureList::IsEnabled(
|
|
|
|
|
- extensions_features::kExtensionManifestV2DeprecationWarning)) {
|
|
|
|
|
- return MV2ExperimentStage::kWarning;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return MV2ExperimentStage::kNone;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-23 17:24:33 -06:00
|
|
|
@@ -200,19 +184,7 @@ PrefMap GetGlobalNoticeAcknowledgedPrefF
|
2024-11-06 10:56:00 -06:00
|
|
|
// Returns true if legacy extensions should be disabled, looking at both
|
|
|
|
|
// experiment stage and global state.
|
|
|
|
|
bool ShouldDisableLegacyExtensions(MV2ExperimentStage stage) {
|
|
|
|
|
- if (g_allow_mv2_for_testing) {
|
|
|
|
|
- // We allow legacy MV2 extensions for testing purposes.
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- switch (stage) {
|
|
|
|
|
- case MV2ExperimentStage::kNone:
|
|
|
|
|
- case MV2ExperimentStage::kWarning:
|
2025-01-08 14:03:54 -06:00
|
|
|
return false;
|
2024-11-06 10:56:00 -06:00
|
|
|
- case MV2ExperimentStage::kDisableWithReEnable:
|
|
|
|
|
- case MV2ExperimentStage::kUnsupported:
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-08 14:03:54 -06:00
|
|
|
// Returns true if the given `stage` is one in which extension enablement should
|
2024-08-15 14:47:11 -05:00
|
|
|
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc
|
|
|
|
|
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
|
2025-02-23 17:24:33 -06:00
|
|
|
@@ -467,7 +467,7 @@ content::WebUIDataSource* CreateAndAddEx
|
2024-08-15 14:47:11 -05:00
|
|
|
extensions_features::kExtensionsMenuAccessControlWithPermittedSites));
|
2025-02-23 17:24:33 -06:00
|
|
|
source->AddBoolean(
|
|
|
|
|
"safetyHubThreeDotDetails",
|
|
|
|
|
- base::FeatureList::IsEnabled(features::kSafetyHubThreeDotDetails));
|
|
|
|
|
+ false);
|
2024-08-15 14:47:11 -05:00
|
|
|
|
|
|
|
|
// MV2 deprecation.
|
|
|
|
|
auto* mv2_experiment_manager = ManifestV2ExperimentManager::Get(profile);
|
2024-11-06 10:56:00 -06:00
|
|
|
--- a/extensions/common/extension.cc
|
|
|
|
|
+++ b/extensions/common/extension.cc
|
|
|
|
|
@@ -95,13 +95,6 @@ bool IsManifestSupported(int manifest_ve
|
|
|
|
|
// Supported versions are always safe.
|
|
|
|
|
if (manifest_version >= kMinimumSupportedManifestVersion &&
|
|
|
|
|
manifest_version <= kMaximumSupportedManifestVersion) {
|
|
|
|
|
- // Emit a warning for unpacked extensions on Manifest V2 warning that
|
|
|
|
|
- // MV2 is deprecated.
|
|
|
|
|
- if (type == Manifest::TYPE_EXTENSION && manifest_version == 2 &&
|
|
|
|
|
- Manifest::IsUnpackedLocation(location) &&
|
|
|
|
|
- !g_silence_deprecated_manifest_version_warnings) {
|
|
|
|
|
- *warning = errors::kManifestV2IsDeprecatedWarning;
|
|
|
|
|
- }
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|