diff options
Diffstat (limited to 'chrome/common/extensions/extension.h')
-rw-r--r-- | chrome/common/extensions/extension.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 88d093f..78e75a6 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -28,13 +28,18 @@ class Extension { typedef std::map<const std::string, GURL> URLOverrideMap; // What an extension was loaded from. + // NOTE: These values are stored as integers in the preferences, so you + // really don't want to change any existing ones. enum Location { INVALID, INTERNAL, // A crx file from the internal Extensions directory. EXTERNAL_PREF, // A crx file from an external directory (via prefs). EXTERNAL_REGISTRY, // A crx file from an external directory (via eg the // registry on Windows). - LOAD // --load-extension. + LOAD, // --load-extension. + COMPONENT // An integral component of Chrome itself, which happens + // to be implemented as an extension. We don't show + // these in the management UI. }; enum State { @@ -188,9 +193,10 @@ class Extension { scoped_ptr<SkBitmap>* result); // Initialize the extension from a parsed manifest. - // If |require_id| is true, will return an error if the "id" key is missing - // from the value. - bool InitFromValue(const DictionaryValue& value, bool require_id, + // Usually, the id of an extension is generated by the "key" property of + // its manifest, but if |require_key| is |false|, a temporary ID will be + // generated based on the path. + bool InitFromValue(const DictionaryValue& value, bool require_key, std::string* error); const FilePath& path() const { return path_; } @@ -247,10 +253,6 @@ class Extension { const GURL& update_url() const { return update_url_; } const std::map<int, std::string>& icons() const { return icons_; } - // Returns the origin of this extension. This function takes a |registry_path| - // so that the registry location can be overwritten during testing. - Location ExternalExtensionInstallType(std::string registry_path); - // Theme-related. DictionaryValue* GetThemeImages() const { return theme_images_.get(); } DictionaryValue* GetThemeColors() const { return theme_colors_.get(); } @@ -334,6 +336,10 @@ class Extension { // Helper method to verify the app section of the manifest. bool LoadAppHelper(const DictionaryValue* app, std::string* error); + // Returns true if the string is one of the known api permissions (see + // kPermissionNames). + bool IsAPIPermission(const std::string& permission); + // The absolute path to the directory the extension is stored in. FilePath path_; |