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

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: ready to land 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index ad85a5b382aa911525802b4eb4d5b4e70041252a..6c3ed477ea2e249ef098e978c0ff8c4bdb44e707 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -526,7 +526,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 {
@@ -588,6 +593,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
return theme_display_properties_.get();
}
+ GURL GetBackgroundURL() const;
+
private:
friend class base::RefCountedThreadSafe<Extension>;
@@ -664,6 +671,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);
@@ -796,6 +805,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_;
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698