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

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

Issue 2166513002: Create --disable-extensions-except switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Patch 2 Code Review 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
Index: chrome/browser/extensions/extension_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 556cc4f388d1cf775eb14147623418b4c4d5afd5..aed1cb19083eaf649110025134002b941eef53c7 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -456,6 +456,15 @@ class ExtensionService
external_updates_finished_callback_ = callback;
}
+ void AddExtensionToWhitelist(const std::string& extensionId) {
Devlin 2016/07/27 17:00:59 "Whitelist" here is still pretty vague. But this
catmullings 2016/08/04 22:59:30 Done.
+ enabled_extensions_whitelist_.insert(extensionId);
+ }
+
+ bool IsExtensionWhitelisted(const std::string& extensionId) {
+ return enabled_extensions_whitelist_.find(extensionId) !=
+ enabled_extensions_whitelist_.end();
+ }
+
private:
// Reloads the specified extension, sending the onLaunched() event to it if it
// currently has any window showing. |be_noisy| determines whether noisy
@@ -616,6 +625,10 @@ class ExtensionService
// These extensions should appear in registry_.
extensions::ExtensionSet greylist_;
+ // Set of whitelisted enabled extensions loaded from the
+ // --disable-extensions-except command line flag.
+ std::set<std::string> enabled_extensions_whitelist_;
+
// The list of extension installs delayed for various reasons. The reason
// for delayed install is stored in ExtensionPrefs. These are not part of
// ExtensionRegistry because they are not yet installed.

Powered by Google App Engine
This is Rietveld 408576698