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

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

Issue 2820333003: Revert of Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: 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 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 <unordered_map> 10 #include <unordered_map>
(...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 hosts exempted by policy from the RuntimeBlockedHosts for 120 // Returns the list of hosts |extension| is limited to by policy.
121 // |extension|.
122 const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const; 121 const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const;
123 122
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
141 // Checks if a URL is on the blocked host permissions list for a specific 123 // Checks if a URL is on the blocked host permissions list for a specific
142 // extension. 124 // extension.
143 bool IsRuntimeBlockedHost(const Extension* extension, const GURL& url) const; 125 bool IsBlockedHost(const Extension* extension, const GURL& url) const;
144 126
145 // Returns blocked permission set for |extension|. 127 // Returns blocked permission set for |extension|.
146 std::unique_ptr<const PermissionSet> GetBlockedPermissions( 128 std::unique_ptr<const PermissionSet> GetBlockedPermissions(
147 const Extension* extension) const; 129 const Extension* extension) const;
148 130
149 // Returns true if every permission in |perms| is allowed for |extension|. 131 // Returns true if every permission in |perms| is allowed for |extension|.
150 bool IsPermissionSetAllowed(const Extension* extension, 132 bool IsPermissionSetAllowed(const Extension* extension,
151 const PermissionSet& perms) const; 133 const PermissionSet& perms) const;
152 134
153 // Returns true if |extension| meets the minimum required version set for it. 135 // Returns true if |extension| meets the minimum required version set for it.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 content::BrowserContext* context) const override; 230 content::BrowserContext* context) const override;
249 void RegisterProfilePrefs( 231 void RegisterProfilePrefs(
250 user_prefs::PrefRegistrySyncable* registry) override; 232 user_prefs::PrefRegistrySyncable* registry) override;
251 233
252 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); 234 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory);
253 }; 235 };
254 236
255 } // namespace extensions 237 } // namespace extensions
256 238
257 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_ 239 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_H_
OLDNEW
« 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