Index: chrome/browser/extensions/extension_service.h |
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h |
index 556adb0025afdec9c42b162005a9cf4879179df8..12c686255d65c6ff8661158583be5a23e4eb6375 100644 |
--- a/chrome/browser/extensions/extension_service.h |
+++ b/chrome/browser/extensions/extension_service.h |
@@ -295,6 +295,18 @@ class ExtensionService |
// |was_installed_by_default| flag. |
void DisableUserExtensions(const std::vector<std::string>& except_ids); |
+ // Puts all extensions in a blocked state: Unloading every extension, and |
+ // preventing them from ever loading until UnlockAllExtensions is called. This |
not at google - send to devlin
2014/11/19 20:20:41
Seeing the "lock" word here not "block" (which is
Mike Lerman
2014/11/20 17:18:33
Changed to block.
|
+ // state is stored in preferences, so persists until Chrome restarts. |
+ // |
+ // Component, external component and whitelisted policy installed extensions |
+ // are exempt from beck Blocked (see CanBlockExtension). |
not at google - send to devlin
2014/11/19 20:20:41
beck --> being
Mike Lerman
2014/11/20 17:18:33
Done.
|
+ void BlockAllExtensions(); |
+ |
+ // All blocked extensions are reverted to their previous state, and are |
+ // reloaded. Newly added extensions are no longer automatically blocked. |
+ void UnblockAllExtensions(); |
+ |
// Updates the |extension|'s granted permissions lists to include all |
// permissions in the |extension|'s manifest and re-enables the |
// extension. |
@@ -551,6 +563,9 @@ class ExtensionService |
// (or upgraded) extension. |
bool ShouldEnableOnInstall(const extensions::Extension* extension); |
+ // Helper method to determine if an extension can be blocked. |
+ bool CanBlockExtension(const extensions::Extension* extension) const; |
Mike Lerman
2014/11/19 14:54:34
Made this const so it can be called from IsExtensi
not at google - send to devlin
2014/11/19 20:20:41
Thanks. There are a lot of functions that should b
|
+ |
// Helper to determine if updating an extensions should proceed immediately, |
// or if we should delay the update until further notice. |
bool ShouldDelayExtensionUpdate(const std::string& extension_id, |
@@ -561,10 +576,11 @@ class ExtensionService |
void ManageBlacklist( |
const extensions::Blacklist::BlacklistStateMap& blacklisted_ids); |
- // Add extensions in |blocked| to blacklisted_extensions, remove extensions |
- // that are neither in |blocked|, nor in |unchanged|. |
- void UpdateBlockedExtensions(const extensions::ExtensionIdSet& blocked, |
- const extensions::ExtensionIdSet& unchanged); |
+ // Add extensions in |blacklisted| to blacklisted_extensions, remove |
+ // extensions that are neither in |blacklisted|, nor in |unchanged|. |
+ void UpdateBlacklistedExtensions( |
+ const extensions::ExtensionIdSet& to_blacklist, |
+ const extensions::ExtensionIdSet& unchanged); |
void UpdateGreylistedExtensions( |
const extensions::ExtensionIdSet& greylist, |
@@ -689,6 +705,9 @@ class ExtensionService |
// first time. |
bool is_first_run_; |
+ // Set to true if extensions are all to be blocked. |
+ bool block_extensions_; |
+ |
// Store the ids of reloading extensions. We use this to re-enable extensions |
// which were disabled for a reload. |
std::set<std::string> reloading_extensions_; |