Chromium Code Reviews| 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 <vector> | 10 #include <vector> |
| (...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. This should only be used to initialize a new | |
|
Devlin
2017/04/07 00:40:26
We can probably remove the bit about "this should
nrpeter
2017/04/12 23:35:44
Done.
| |
| 127 // renderer. | |
| 128 const URLPatternSet& GetDefaultRuntimeBlockedHosts() const; | |
| 129 | |
| 130 // Returns the hosts exempted by policy from RuntimeBlockedHosts for | |
| 131 // the default scope. This can be overridden by an individual scope which is | |
| 132 // queries via GetRuntimeAllowedHosts. This should only be used to | |
| 133 // initialize a new renderer. | |
| 134 const URLPatternSet& GetDefaultRuntimeAllowedHosts() const; | |
| 135 | |
| 136 // Checks if an |extension| has its own runtime_blocked_hosts or | |
| 137 // runtime_allowed_hosts defined in the individual scope of the | |
| 138 // ExtensionSettings policy. | |
| 139 // Returns false if an individual scoped setting isn't defined. | |
| 140 bool UsesDefaultRuntimeHostRestrictions(const Extension* extension) const; | |
| 141 | |
| 123 // Checks if a URL is on the blocked host permissions list for a specific | 142 // Checks if a URL is on the blocked host permissions list for a specific |
| 124 // extension. | 143 // extension. |
| 125 bool IsBlockedHost(const Extension* extension, const GURL& url) const; | 144 bool IsRuntimeBlockedHost(const Extension* extension, const GURL& url) const; |
| 126 | 145 |
| 127 // Returns blocked permission set for |extension|. | 146 // Returns blocked permission set for |extension|. |
| 128 std::unique_ptr<const PermissionSet> GetBlockedPermissions( | 147 std::unique_ptr<const PermissionSet> GetBlockedPermissions( |
| 129 const Extension* extension) const; | 148 const Extension* extension) const; |
| 130 | 149 |
| 131 // Returns true if every permission in |perms| is allowed for |extension|. | 150 // Returns true if every permission in |perms| is allowed for |extension|. |
| 132 bool IsPermissionSetAllowed(const Extension* extension, | 151 bool IsPermissionSetAllowed(const Extension* extension, |
| 133 const PermissionSet& perms) const; | 152 const PermissionSet& perms) const; |
| 134 | 153 |
| 135 // Returns true if |extension| meets the minimum required version set for it. | 154 // Returns true if |extension| meets the minimum required version set for it. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 content::BrowserContext* context) const override; | 240 content::BrowserContext* context) const override; |
| 222 void RegisterProfilePrefs( | 241 void RegisterProfilePrefs( |
| 223 user_prefs::PrefRegistrySyncable* registry) override; | 242 user_prefs::PrefRegistrySyncable* registry) override; |
| 224 | 243 |
| 225 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); | 244 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); |
| 226 }; | 245 }; |
| 227 | 246 |
| 228 } // namespace extensions | 247 } // namespace extensions |
| 229 | 248 |
| 230 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ | 249 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ |
| OLD | NEW |