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

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

Issue 9150008: Introduce background.scripts feature for extension manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 8955544b0fdfe289665dfa17a560f70de3cb51d3..46717b16250faedea802100a9f89ec2524392ae5 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -531,7 +531,12 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
const std::vector<InputComponentInfo>& input_components() const {
return input_components_;
}
- const GURL& background_url() const { return background_url_; }
+ bool has_background_page() const {
+ return background_url_.is_valid() || !background_scripts_.empty();
+ }
+ const std::vector<std::string>& background_scripts() const {
+ return background_scripts_;
+ }
const GURL& options_url() const { return options_url_; }
const GURL& devtools_url() const { return devtools_url_; }
const ExtensionPermissionSet* optional_permission_set() const {
@@ -593,6 +598,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
return theme_display_properties_.get();
}
+ GURL GetBackgroundURL() const;
+
private:
friend class base::RefCountedThreadSafe<Extension>;
@@ -669,6 +676,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
string16* error);
bool LoadWebIntentServices(const extensions::Manifest* manifest,
string16* error);
+ bool LoadBackgroundScripts(const extensions::Manifest* manifest,
+ string16* error);
bool LoadBackgroundPage(const extensions::Manifest* manifest,
const ExtensionAPIPermissionSet& api_permissions,
string16* error);
@@ -809,6 +818,10 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// loaded in the background.
GURL background_url_;
+ // Optional list of scripts to use to generate a background page. If this is
+ // present, background_url_ will be empty and generated by GetBackgroundURL().
+ std::vector<std::string> background_scripts_;
+
// Optional URL to a page for setting options/preferences.
GURL options_url_;

Powered by Google App Engine
This is Rietveld 408576698