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

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

Issue 2833843004: Reland: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Removed unused URLPatternSet parameters in ExtensionMsg_PermissionSetStruct which was causing MSAN … Created 3 years, 8 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/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_;

Powered by Google App Engine
This is Rietveld 408576698