Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2529)

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 2299203004: Attempt to repair corrupt enterprise policy force-installed extensions (Closed)
Patch Set: switched to using installsource, addressed review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index cfd8ba1316b94777c6c2c993b93f40956a8acbfb..3222e47c0b71d6fea4a4f3ff7fba23473d8bcf37 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -203,11 +203,14 @@ bool ExtensionService::OnExternalExtensionUpdateUrlFound(
const Extension* extension = GetExtensionById(info.extension_id, true);
if (extension) {
- // Already installed. Skip this install if the current location has
- // higher priority than |info.download_location|.
+ // Already installed. Skip this install if the current location has higher
+ // priority than |info.download_location|, and we aren't doing a
+ // reinstall of a corrupt policy force-installed extension.
Manifest::Location current = extension->location();
- if (current ==
- Manifest::GetHigherPriorityLocation(current, info.download_location)) {
+ if (!pending_extension_manager_.IsPolicyReinstallForCorruptionExpected(
+ info.extension_id) &&
+ current == Manifest::GetHigherPriorityLocation(
+ current, info.download_location)) {
return false;
}
// Otherwise, overwrite the current installation.
@@ -909,6 +912,7 @@ void ExtensionService::DisableExtension(const std::string& extension_id,
// can be uninstalled by the browser if the user sets extension-specific
// preferences.
if (extension && !(disable_reasons & Extension::DISABLE_RELOAD) &&
+ !(disable_reasons & Extension::DISABLE_CORRUPTED) &&
!(disable_reasons & Extension::DISABLE_UPDATE_REQUIRED_BY_POLICY) &&
!system_->management_policy()->UserMayModifySettings(extension,
nullptr) &&
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/pending_extension_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698