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

Unified Diff: extensions/browser/extension_registry.cc

Issue 695133005: Temporarily disable extensions and sync while a profile is locked - Profiles Approach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test. Don't lock policy-forced extensions. Created 6 years, 1 month 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: extensions/browser/extension_registry.cc
diff --git a/extensions/browser/extension_registry.cc b/extensions/browser/extension_registry.cc
index 769539e971931a7368dcac90882b5422f25627aa..99b28b8bceafe419cd0156e120fb95fa0a29bfd8 100644
--- a/extensions/browser/extension_registry.cc
+++ b/extensions/browser/extension_registry.cc
@@ -26,6 +26,7 @@ scoped_ptr<ExtensionSet> ExtensionRegistry::GenerateInstalledExtensionsSet()
installed_extensions->InsertAll(disabled_extensions_);
installed_extensions->InsertAll(terminated_extensions_);
installed_extensions->InsertAll(blacklisted_extensions_);
+ installed_extensions->InsertAll(locked_extensions_);
return installed_extensions.Pass();
}
@@ -108,6 +109,11 @@ const Extension* ExtensionRegistry::GetExtensionById(const std::string& id,
if (extension)
return extension;
}
+ if (include_mask & LOCKED) {
+ const Extension* extension = locked_extensions_.GetByID(lowercase_id);
+ if (extension)
+ return extension;
+ }
return NULL;
}
@@ -147,11 +153,21 @@ bool ExtensionRegistry::RemoveBlacklisted(const std::string& id) {
return blacklisted_extensions_.Remove(id);
}
+bool ExtensionRegistry::AddLocked(
+ const scoped_refptr<const Extension>& extension) {
+ return locked_extensions_.Insert(extension);
+}
+
+bool ExtensionRegistry::RemoveLocked(const std::string& id) {
+ return locked_extensions_.Remove(id);
+}
+
void ExtensionRegistry::ClearAll() {
enabled_extensions_.Clear();
disabled_extensions_.Clear();
terminated_extensions_.Clear();
blacklisted_extensions_.Clear();
+ locked_extensions_.Clear();
}
void ExtensionRegistry::SetDisabledModificationCallback(

Powered by Google App Engine
This is Rietveld 408576698