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

Side by Side Diff: chrome/browser/extensions/extension_management.h

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: URLPatternSets use shared memory for IPC. Default scope patterns sent once per renderer. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Returns true if an extension with manifest type |manifest_type| is 110 // Returns true if an extension with manifest type |manifest_type| is
111 // allowed to be installed. 111 // allowed to be installed.
112 bool IsAllowedManifestType(Manifest::Type manifest_type) const; 112 bool IsAllowedManifestType(Manifest::Type manifest_type) const;
113 113
114 // Returns the list of blocked API permissions for |extension|. 114 // Returns the list of blocked API permissions for |extension|.
115 APIPermissionSet GetBlockedAPIPermissions(const Extension* extension) const; 115 APIPermissionSet GetBlockedAPIPermissions(const Extension* extension) const;
116 116
117 // Returns the list of hosts blocked by policy for |extension|. 117 // Returns the list of hosts blocked by policy for |extension|.
118 const URLPatternSet& GetRuntimeBlockedHosts(const Extension* extension) const; 118 const URLPatternSet& GetRuntimeBlockedHosts(const Extension* extension) const;
119 119
120 // Returns the list of hosts |extension| is limited to by policy. 120 // Returns the hosts exempted by policy from the RuntimeBlockedHosts for
121 // |extension|.
121 const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const; 122 const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const;
122 123
124 // Returns the list of hosts blocked by policy for Default scope. This can be
125 // overridden by an invividual scope which is queried via
126 // GetRuntimeBlockedHosts.
127 const URLPatternSet& GetDefaultRuntimeBlockedHosts() const;
128
129 // Returns the hosts exempted by policy from RuntimeBlockedHosts for
130 // the default scope. This can be overridden by an individual scope which is
131 // queries via GetRuntimeAllowedHosts.
132 const URLPatternSet& GetDefaultRuntimeAllowedHosts() const;
133
134 // Checks if an |extension| has its own runtime_blocked_hosts or
135 // runtime_allowed_hosts defined in the individual scope of the
136 // ExtensionSettings policy.
137 // Returns false if an individual scoped setting isn't defined.
138 bool IsDefaultRuntimeBlockedAllowedHosts(const Extension* extension) const;
139
123 // Checks if a URL is on the blocked host permissions list for a specific 140 // Checks if a URL is on the blocked host permissions list for a specific
124 // extension. 141 // extension.
125 bool IsBlockedHost(const Extension* extension, const GURL& url) const; 142 bool IsBlockedHost(const Extension* extension, const GURL& url) const;
126 143
127 // Returns blocked permission set for |extension|. 144 // Returns blocked permission set for |extension|.
128 std::unique_ptr<const PermissionSet> GetBlockedPermissions( 145 std::unique_ptr<const PermissionSet> GetBlockedPermissions(
129 const Extension* extension) const; 146 const Extension* extension) const;
130 147
131 // Returns true if every permission in |perms| is allowed for |extension|. 148 // Returns true if every permission in |perms| is allowed for |extension|.
132 bool IsPermissionSetAllowed(const Extension* extension, 149 bool IsPermissionSetAllowed(const Extension* extension,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 content::BrowserContext* context) const override; 238 content::BrowserContext* context) const override;
222 void RegisterProfilePrefs( 239 void RegisterProfilePrefs(
223 user_prefs::PrefRegistrySyncable* registry) override; 240 user_prefs::PrefRegistrySyncable* registry) override;
224 241
225 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); 242 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory);
226 }; 243 };
227 244
228 } // namespace extensions 245 } // namespace extensions
229 246
230 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ 247 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698