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

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

Issue 10908184: Enforce the 'requirements' field in manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/chrome_tests.gypi ('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 5216471f2a5efda80ea1702b3cddf755c5082f2a..22ca9fb9e72f599c8d42e0856c963e19a6256461 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -112,6 +112,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
DISABLE_USER_ACTION = 1 << 0,
DISABLE_PERMISSIONS_INCREASE = 1 << 1,
DISABLE_RELOAD = 1 << 2,
+ DISABLE_UNSUPPORTED_REQUIREMENT = 1 << 3
};
enum InstallType {
@@ -140,6 +141,16 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
SYNC_TYPE_APP
};
+ // Declared requirements for the extension.
+ struct Requirements {
+ Requirements();
+ ~Requirements();
+
+ bool webgl;
+ bool css3d;
+ bool npapi;
+ };
+
// An NPAPI plugin included in the extension.
struct PluginInfo {
FilePath path; // Path to the plugin.
@@ -592,6 +603,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// Accessors:
+ const Requirements& requirements() const { return requirements_; }
const FilePath& path() const { return path_; }
const GURL& url() const { return extension_url_; }
Location location() const;
@@ -830,6 +842,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
bool LoadNaClModules(string16* error);
bool LoadWebAccessibleResources(string16* error);
bool LoadSandboxedPages(string16* error);
+ // Must be called after LoadPlugins().
+ bool LoadRequirements(string16* error);
bool LoadDefaultLocale(string16* error);
bool LoadOfflineEnabled(string16* error);
bool LoadOptionsPage(string16* error);
@@ -933,7 +947,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
const APIPermissionSet& permissions) const;
bool CheckMinimumChromeVersion(string16* error) const;
- bool CheckRequirements(string16* error) const;
// Check that platform app features are valid. Called after InitFromValue.
bool CheckPlatformAppFeatures(std::string* utf8_error) const;
@@ -963,6 +976,9 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// the case when we know the manifest version actually is 1.
int manifest_version_;
+ // The requirements declared in the manifest.
+ Requirements requirements_;
+
// The absolute path to the directory the extension is stored in.
FilePath path_;
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698