Chromium Code Reviews| Index: chrome/browser/extensions/permissions_updater.h |
| diff --git a/chrome/browser/extensions/permissions_updater.h b/chrome/browser/extensions/permissions_updater.h |
| index 2bb6f8fe2f9d62149afdbffad1b3e4e0f051ed2d..916e883318c5432b9ea506bba264125e03f398c5 100644 |
| --- a/chrome/browser/extensions/permissions_updater.h |
| +++ b/chrome/browser/extensions/permissions_updater.h |
| @@ -24,6 +24,7 @@ namespace extensions { |
| class Extension; |
| class ExtensionPrefs; |
| class PermissionSet; |
| +class URLPatternSet; |
| // Updates an Extension's active and granted permissions in persistent storage |
| // and notifies interested parties of the changes. |
| @@ -69,6 +70,23 @@ 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 whether an extension overrides the default list of policy host |
| + // restrictions. |
| + void SetUsesDefaultHostRestrictions(const Extension* extension, |
| + bool uses_default_restrictions); |
|
dcheng
2017/03/31 23:48:06
Out of curiosity, is this supposed to be mutually
nrpeter
2017/04/01 00:28:28
The default policy applies to all extensions by de
|
| + |
| + // 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; |
| @@ -86,6 +104,7 @@ class PermissionsUpdater { |
| enum EventType { |
| ADDED, |
| REMOVED, |
| + POLICY, |
| }; |
| // Sets the |extension|'s active permissions to |active| and records the |
| @@ -111,6 +130,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_; |