summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 02:15:20 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 02:15:20 +0000
commit6657afa65426f10f5dc51c0ac12d573c4826cb54 (patch)
tree3b24f83dd2f834bde93b7b7e27327701814379ac /chrome/common/extensions/extension.h
parent6c856ae733bf8d1f187ec5b93e07216ace0c4693 (diff)
downloadchromium_src-6657afa65426f10f5dc51c0ac12d573c4826cb54.zip
chromium_src-6657afa65426f10f5dc51c0ac12d573c4826cb54.tar.gz
chromium_src-6657afa65426f10f5dc51c0ac12d573c4826cb54.tar.bz2
Add first class support for user scripts.
Original review: http://codereview.chromium.org/340057 TBR=mpcomplete@chromium.org BUG=22103 TEST=Install a user script (such as from userscripts.org). You should get the extension install UI and the script should show up in the extension management UI. It should also work, though some scripts use Firefox-specific APIs and those won't work in Chromium. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension.h')
-rw-r--r--chrome/common/extensions/extension.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 050515b..d240388 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -195,6 +195,9 @@ class Extension {
const std::string& name() const { return name_; }
const std::string& public_key() const { return public_key_; }
const std::string& description() const { return description_; }
+ bool converted_from_user_script() const {
+ return converted_from_user_script_;
+ }
const UserScriptList& content_scripts() const { return content_scripts_; }
ExtensionAction* page_action() const { return page_action_.get(); }
ExtensionAction* browser_action() const { return browser_action_.get(); }
@@ -290,6 +293,15 @@ class Extension {
std::string* error,
UserScript* result);
+ // Helper method that loads either the include_globs or exclude_globs list
+ // from an entry in the content_script lists of the manifest.
+ bool LoadGlobsHelper(const DictionaryValue* content_script,
+ int content_script_index,
+ const wchar_t* globs_property_name,
+ std::string* error,
+ void (UserScript::*add_method) (const std::string& glob),
+ UserScript *instance);
+
// Helper method to load an ExtensionAction from the page_action or
// browser_action entries in the manifest.
ExtensionAction* LoadExtensionActionHelper(
@@ -325,6 +337,10 @@ class Extension {
// An optional longer description of the extension.
std::string description_;
+ // True if the extension was generated from a user script. (We show slightly
+ // different UI if so).
+ bool converted_from_user_script_;
+
// Paths to the content scripts the extension contains.
UserScriptList content_scripts_;