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

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

Issue 2131173003: Make sure Shared Modules cannot be disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 4735bb17bbad6c4ca6a422d0e35045121c48d5bd..fd3e8f36f63392ac57c4324e50847fa6abd6a73c 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -869,6 +869,12 @@ void ExtensionService::DisableExtension(const std::string& extension_id,
}
const Extension* extension = GetInstalledExtension(extension_id);
+
+ // Shared modules cannot be disabled, they are just resources used by other
+ // extensions, and are not user controlled.
+ if (extension && SharedModuleInfo::IsSharedModule(extension))
+ return;
+
// |extension| can be nullptr if sync disables an extension that is not
// installed yet.
// EXTERNAL_COMPONENT extensions are not generally modifiable by users, but
@@ -1420,6 +1426,18 @@ void ExtensionService::OnLoadedInstalledExtensions() {
if (updater_)
updater_->Start();
+ // Enable any Shared Modules that incorrectly got disabled previously.
+ // This is temporary code to fix incorrect behavior from previous versions of
+ // Chrome and can be removed after several releases (perhaps M60).
+ extensions::ExtensionList to_enable;
+ for (const auto& extension : registry_->disabled_extensions()) {
+ if (SharedModuleInfo::IsSharedModule(extension.get()))
+ to_enable.push_back(extension);
+ }
+ for (const auto& extension : to_enable) {
+ EnableExtension(extension->id());
+ }
+
OnBlacklistUpdated();
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698