Index: chrome/browser/extensions/permissions_updater.h |
diff --git a/chrome/browser/extensions/permissions_updater.h b/chrome/browser/extensions/permissions_updater.h |
index 249c7048e6b1a4aeba0787efdaa5f4cadcf87bc2..2b8597e752c23ef519bf6585da5075edb73f484e 100644 |
--- a/chrome/browser/extensions/permissions_updater.h |
+++ b/chrome/browser/extensions/permissions_updater.h |
@@ -19,6 +19,7 @@ namespace extensions { |
class Extension; |
class PermissionSet; |
+class URLPatternSet; |
// Updates an Extension's active and granted permissions in persistent storage |
// and notifies interested parties of the changes. |
@@ -81,6 +82,21 @@ class PermissionsUpdater { |
void RemovePermissionsUnsafe(const Extension* extension, |
const PermissionSet& permissions); |
+ // Sets list of hosts |extension| may not interact with (overrides default). |
+ void SetPolicyHostRestrictions(const Extension* extension, |
+ const URLPatternSet& runtime_blocked_hosts, |
+ const URLPatternSet& runtime_allowed_hosts); |
+ |
+ // Sets extension to use the default list of policy host restrictions. |
+ void SetUsesDefaultHostRestrictions(const Extension* extension); |
+ |
+ // Sets list of hosts extensions may not interact with. Extension specific |
+ // exceptions to this default policy are defined with |
+ // SetPolicyHostRestrictions. |
+ void SetDefaultPolicyHostRestrictions( |
+ const URLPatternSet& default_runtime_blocked_hosts, |
+ const URLPatternSet& default_runtime_allowed_hosts); |
+ |
// Returns the set of revokable permissions. |
std::unique_ptr<const PermissionSet> GetRevokablePermissions( |
const Extension* extension) const; |
@@ -98,6 +114,7 @@ class PermissionsUpdater { |
enum EventType { |
ADDED, |
REMOVED, |
+ POLICY, |
}; |
// Sets the |extension|'s active permissions to |active| and records the |
@@ -123,6 +140,14 @@ class PermissionsUpdater { |
const Extension* extension, |
const PermissionSet& changed); |
+ // Issues the relevant events, messages and notifications when the |
+ // default scope management policy have changed. |
+ // Specifically, this sends the ExtensionMsg_UpdateDefaultHostRestrictions |
+ // IPC message. |
+ void NotifyDefaultPolicyHostRestrictionsUpdated( |
+ const URLPatternSet& default_runtime_blocked_hosts, |
+ const URLPatternSet& default_runtime_allowed_hosts); |
+ |
// The associated BrowserContext. |
content::BrowserContext* browser_context_; |