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

Unified Diff: chrome/common/extensions/extension.h

Issue 164039: Add module-level permissions to extensions. (Closed)
Patch Set: final nits Created 11 years, 4 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
« no previous file with comments | « chrome/common/common_resources.grd ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 550fbba10e6657c4cddca29c7fa29ca68ca3a6e7..7969e964713e21164fe4428d8f88c26f480ce124 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -58,6 +58,10 @@ class Extension {
// Icon sizes used by the extension system.
static const int kIconSizes[];
+ // Each permission is a module that the extension is permitted to use.
+ static const char* kPermissionNames[];
+ static const size_t kNumPermissions;
+
// An NPAPI plugin included in the extension.
struct PluginInfo {
FilePath path; // Path to the plugin.
@@ -172,7 +176,12 @@ class Extension {
const std::vector<PluginInfo>& plugins() const { return plugins_; }
const GURL& background_url() const { return background_url_; }
const std::vector<ToolstripInfo>& toolstrips() const { return toolstrips_; }
- const std::vector<URLPattern>& permissions() const { return permissions_; }
+ const std::vector<URLPattern>& host_permissions() const {
+ return host_permissions_;
+ }
+ const std::vector<std::string>& api_permissions() const {
+ return api_permissions_;
+ }
const GURL& update_url() const { return update_url_; }
const std::map<int, std::string>& icons() { return icons_; }
@@ -293,8 +302,11 @@ class Extension {
// Whether the extension is a theme - if it is, certain things are disabled.
bool is_theme_;
+ // The set of module-level APIs this extension can use.
+ std::vector<std::string> api_permissions_;
+
// The sites this extension has permission to talk to (using XHR, etc).
- std::vector<URLPattern> permissions_;
+ std::vector<URLPattern> host_permissions_;
// The paths to the icons the extension contains mapped by their width.
std::map<int, std::string> icons_;
« no previous file with comments | « chrome/common/common_resources.grd ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698