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

Unified Diff: chrome/browser/extensions/extension_management.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/extension_management.h
diff --git a/chrome/browser/extensions/extension_management.h b/chrome/browser/extensions/extension_management.h
index 1dca606188910f2e8210eb859db00cab39095454..719c77951b9d9b97ffdd0f944947ee03471495a9 100644
--- a/chrome/browser/extensions/extension_management.h
+++ b/chrome/browser/extensions/extension_management.h
@@ -117,12 +117,30 @@ class ExtensionManagement : public KeyedService {
// Returns the list of hosts blocked by policy for |extension|.
const URLPatternSet& GetRuntimeBlockedHosts(const Extension* extension) const;
- // Returns the list of hosts |extension| is limited to by policy.
+ // Returns the hosts exempted by policy from the RuntimeBlockedHosts for
+ // |extension|.
const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const;
+ // Returns the list of hosts blocked by policy for Default scope. This can be
+ // overridden by an invividual scope which is queried via
+ // GetRuntimeBlockedHosts.
+ const URLPatternSet& GetDefaultRuntimeBlockedHosts() const;
+
+ // Returns the hosts exempted by policy from RuntimeBlockedHosts for
+ // the default scope. This can be overridden by an individual scope which is
+ // queries via GetRuntimeAllowedHosts. This should only be used to
+ // initialize a new renderer.
+ const URLPatternSet& GetDefaultRuntimeAllowedHosts() const;
+
+ // Checks if an |extension| has its own runtime_blocked_hosts or
+ // runtime_allowed_hosts defined in the individual scope of the
+ // ExtensionSettings policy.
+ // Returns false if an individual scoped setting isn't defined.
+ bool UsesDefaultRuntimeHostRestrictions(const Extension* extension) const;
+
// Checks if a URL is on the blocked host permissions list for a specific
// extension.
- bool IsBlockedHost(const Extension* extension, const GURL& url) const;
+ bool IsRuntimeBlockedHost(const Extension* extension, const GURL& url) const;
// Returns blocked permission set for |extension|.
std::unique_ptr<const PermissionSet> GetBlockedPermissions(
« no previous file with comments | « chrome/browser/extensions/content_script_apitest.cc ('k') | chrome/browser/extensions/extension_management.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698