summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 20:03:30 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 20:03:30 +0000
commit1712232b6e2beffa413af6d97cf63b30a3b6e7c7 (patch)
tree7346e88a8fa9d4c8bfc6aa417de8b30c60763e5f /chrome/browser/extensions/extension.h
parentd938aed98c3e683586d37b6dcbb1b20d95eb771a (diff)
downloadchromium_src-1712232b6e2beffa413af6d97cf63b30a3b6e7c7.zip
chromium_src-1712232b6e2beffa413af6d97cf63b30a3b6e7c7.tar.gz
chromium_src-1712232b6e2beffa413af6d97cf63b30a3b6e7c7.tar.bz2
Revert "Parse more user script info out of the manifest and expose"
This reverts commit fc3fd1062c06f803775c16d11f742d85d540e415. Review URL: http://codereview.chromium.org/18681 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8494 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension.h')
-rw-r--r--chrome/browser/extensions/extension.h72
1 files changed, 22 insertions, 50 deletions
diff --git a/chrome/browser/extensions/extension.h b/chrome/browser/extensions/extension.h
index 7887f87..8a82547 100644
--- a/chrome/browser/extensions/extension.h
+++ b/chrome/browser/extensions/extension.h
@@ -11,13 +11,12 @@
#include "base/file_path.h"
#include "base/string16.h"
#include "base/values.h"
-#include "chrome/browser/extensions/user_script_master.h"
-#include "googleurl/src/gurl.h"
// Represents a Chromium extension.
class Extension {
public:
- Extension(const FilePath& path);
+ Extension(){};
+ Extension(const FilePath& path) : path_(path) {};
// The format for extension manifests that this code understands.
static const int kExpectedFormatVersion = 1;
@@ -26,53 +25,26 @@ class Extension {
static const char kManifestFilename[];
// Keys used in JSON representation of extensions.
- static const wchar_t* kDescriptionKey;
- static const wchar_t* kFilesKey;
- static const wchar_t* kFormatVersionKey;
- static const wchar_t* kIdKey;
- static const wchar_t* kMatchesKey;
- static const wchar_t* kNameKey;
- static const wchar_t* kUserScriptsKey;
- static const wchar_t* kVersionKey;
+ static const wchar_t* kFormatVersionKey;
+ static const wchar_t* kIdKey;
+ static const wchar_t* kNameKey;
+ static const wchar_t* kDescriptionKey;
+ static const wchar_t* kContentScriptsKey;
+ static const wchar_t* kVersionKey;
// Error messages returned from InitFromValue().
- static const char* kInvalidDescriptionError;
- static const char* kInvalidFileCountError;
- static const char* kInvalidFileError;
- static const char* kInvalidFilesError;
- static const char* kInvalidFormatVersionError;
- static const char* kInvalidIdError;
- static const char* kInvalidManifestError;
- static const char* kInvalidMatchCountError;
- static const char* kInvalidMatchError;
- static const char* kInvalidMatchesError;
- static const char* kInvalidNameError;
- static const char* kInvalidUserScriptError;
- static const char* kInvalidUserScriptsListError;
- static const char* kInvalidVersionError;
-
- // Creates an absolute url to a resource inside an extension. The
- // |extension_url| argument should be the url() from an Extension object. The
- // |relative_path| can be untrusted user input. The returned URL will either
- // be invalid() or a child of |extension_url|.
- // NOTE: Static so that it can be used from multiple threads.
- static GURL GetResourceURL(const GURL& extension_url,
- const std::string& relative_path);
-
- // Creates an absolute path to a resource inside an extension. The
- // |extension_path| argument should be the path() from an Extension object.
- // The |relative_path| can be untrusted user input. The returned path will
- // either be empty or a child of extension_path.
- // NOTE: Static so that it can be used from multiple threads.
- static FilePath GetResourcePath(const FilePath& extension_path,
- const std::string& relative_path);
+ static const char* kInvalidFormatVersionError;
+ static const char* kInvalidManifestError;
+ static const char* kInvalidIdError;
+ static const char* kInvalidNameError;
+ static const char* kInvalidDescriptionError;
+ static const char* kInvalidContentScriptsListError;
+ static const char* kInvalidContentScriptError;
+ static const char* kInvalidVersionError;
// The path to the folder the extension is stored in.
const FilePath& path() const { return path_; }
- // The base URL for the extension.
- const GURL& url() const { return extension_url_; }
-
// A human-readable ID for the extension. The convention is to use something
// like 'com.example.myextension', but this is not currently enforced. An
// extension's ID is used in things like directory structures and URLs, and
@@ -91,20 +63,20 @@ class Extension {
const std::string& description() const { return description_; }
// Paths to the content scripts that the extension contains.
- const UserScriptList& user_scripts() const {
- return user_scripts_;
+ const std::vector<std::string>& content_scripts() const {
+ return content_scripts_;
}
// Initialize the extension from a parsed manifest.
bool InitFromValue(const DictionaryValue& value, std::string* error);
+ // Serialize the extension to a DictionaryValue.
+ void CopyToValue(DictionaryValue* value);
+
private:
// The path to the directory the extension is stored in.
FilePath path_;
- // The base extension url for the extension.
- GURL extension_url_;
-
// The extension's ID.
std::string id_;
@@ -118,7 +90,7 @@ class Extension {
std::string description_;
// Paths to the content scripts the extension contains.
- UserScriptList user_scripts_;
+ std::vector<std::string> content_scripts_;
DISALLOW_COPY_AND_ASSIGN(Extension);
};