OLD | NEW |
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 <unordered_map> | 10 #include <unordered_map> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. This should only be used to |
| 132 // initialize a new renderer. |
| 133 const URLPatternSet& GetDefaultRuntimeAllowedHosts() const; |
| 134 |
| 135 // Checks if an |extension| has its own runtime_blocked_hosts or |
| 136 // runtime_allowed_hosts defined in the individual scope of the |
| 137 // ExtensionSettings policy. |
| 138 // Returns false if an individual scoped setting isn't defined. |
| 139 bool UsesDefaultRuntimeHostRestrictions(const Extension* extension) const; |
| 140 |
123 // Checks if a URL is on the blocked host permissions list for a specific | 141 // Checks if a URL is on the blocked host permissions list for a specific |
124 // extension. | 142 // extension. |
125 bool IsBlockedHost(const Extension* extension, const GURL& url) const; | 143 bool IsRuntimeBlockedHost(const Extension* extension, const GURL& url) const; |
126 | 144 |
127 // Returns blocked permission set for |extension|. | 145 // Returns blocked permission set for |extension|. |
128 std::unique_ptr<const PermissionSet> GetBlockedPermissions( | 146 std::unique_ptr<const PermissionSet> GetBlockedPermissions( |
129 const Extension* extension) const; | 147 const Extension* extension) const; |
130 | 148 |
131 // Returns true if every permission in |perms| is allowed for |extension|. | 149 // Returns true if every permission in |perms| is allowed for |extension|. |
132 bool IsPermissionSetAllowed(const Extension* extension, | 150 bool IsPermissionSetAllowed(const Extension* extension, |
133 const PermissionSet& perms) const; | 151 const PermissionSet& perms) const; |
134 | 152 |
135 // Returns true if |extension| meets the minimum required version set for it. | 153 // Returns true if |extension| meets the minimum required version set for it. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 content::BrowserContext* context) const override; | 248 content::BrowserContext* context) const override; |
231 void RegisterProfilePrefs( | 249 void RegisterProfilePrefs( |
232 user_prefs::PrefRegistrySyncable* registry) override; | 250 user_prefs::PrefRegistrySyncable* registry) override; |
233 | 251 |
234 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); | 252 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); |
235 }; | 253 }; |
236 | 254 |
237 } // namespace extensions | 255 } // namespace extensions |
238 | 256 |
239 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ | 257 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ |
OLD | NEW |