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

Unified Diff: chrome/browser/extensions/extension.cc

Issue 92043: Refactor ExtensionView to support a UI-less extension instance.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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/browser/extensions/extension.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension.cc
===================================================================
--- chrome/browser/extensions/extension.cc (revision 14851)
+++ chrome/browser/extensions/extension.cc (working copy)
@@ -24,6 +24,7 @@
const wchar_t* Extension::kNameKey = L"name";
const wchar_t* Extension::kPermissionsKey = L"permissions";
const wchar_t* Extension::kPluginsDirKey = L"plugins_dir";
+const wchar_t* Extension::kBackgroundKey = L"background";
const wchar_t* Extension::kRunAtKey = L"run_at";
const wchar_t* Extension::kThemeKey = L"theme";
const wchar_t* Extension::kToolstripsKey = L"toolstrips";
@@ -75,6 +76,8 @@
"allowed.";
const char* Extension::kInvalidPluginsDirError =
"Invalid value for 'plugins_dir'.";
+const char* Extension::kInvalidBackgroundError =
+ "Invalid value for 'background'.";
const char* Extension::kInvalidRunAtError =
"Invalid value for 'content_scripts[*].run_at'.";
const char* Extension::kInvalidToolstripError =
@@ -403,6 +406,16 @@
plugins_dir_ = path_.AppendASCII(plugins_dir);
}
+ // Initialize background url (optional).
+ if (source.HasKey(kBackgroundKey)) {
+ std::string background_str;
+ if (!source.GetString(kBackgroundKey, &background_str)) {
+ *error = kInvalidBackgroundError;
+ return false;
+ }
+ background_url_ = GetResourceURL(background_str);
+ }
+
// Initialize toolstrips (optional).
if (source.HasKey(kToolstripsKey)) {
ListValue* list_value;
« no previous file with comments | « chrome/browser/extensions/extension.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698