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

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

Issue 340057: Add first-class support for user scripts (Closed)
Patch Set: newness Created 11 years, 1 month 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
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 050515b9290821f20c670ec14c47c92ec939acd1..d240388cbb23506ae20a234975bd7f94ecabd86b 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_;

Powered by Google App Engine
This is Rietveld 408576698