summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-21 01:44:30 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-21 01:44:30 +0000
commit367230c507ce20ff3b42013d0a3eac4ee01efb88 (patch)
treeb217eb19f3c5f662debd5fb562b028d427c3ae19 /chrome/browser/extensions/extension.cc
parent52fadc8176f4076cc021c15d9ccc022e17fd8e97 (diff)
downloadchromium_src-367230c507ce20ff3b42013d0a3eac4ee01efb88.zip
chromium_src-367230c507ce20ff3b42013d0a3eac4ee01efb88.tar.gz
chromium_src-367230c507ce20ff3b42013d0a3eac4ee01efb88.tar.bz2
Add NPAPI plugins contained in extensions to the PluginList.
Review URL: http://codereview.chromium.org/20521 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension.cc')
-rw-r--r--chrome/browser/extensions/extension.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension.cc b/chrome/browser/extensions/extension.cc
index b886d85..d75ed5e 100644
--- a/chrome/browser/extensions/extension.cc
+++ b/chrome/browser/extensions/extension.cc
@@ -25,6 +25,7 @@ const wchar_t* Extension::kNameKey = L"name";
const wchar_t* Extension::kRunAtKey = L"run_at";
const wchar_t* Extension::kVersionKey = L"version";
const wchar_t* Extension::kZipHashKey = L"zip_hash";
+const wchar_t* Extension::kPluginsDirKey = L"plugins_dir";
const char* Extension::kRunAtDocumentStartValue = "document_start";
const char* Extension::kRunAtDocumentEndValue = "document_end";
@@ -67,6 +68,8 @@ const char* Extension::kInvalidVersionError =
"Required value 'version' is missing or invalid.";
const char* Extension::kInvalidZipHashError =
"Required key 'zip_hash' is missing or invalid.";
+const char* Extension::kInvalidPluginsDirError =
+ "Invalid value for 'plugins_dir'.";
const std::string Extension::VersionString() const {
return version_->GetString();
@@ -230,6 +233,16 @@ bool Extension::InitFromValue(const DictionaryValue& source,
}
}
+ // Initialize plugins dir (optional).
+ if (source.HasKey(kPluginsDirKey)) {
+ std::string plugins_dir;
+ if (!source.GetString(kPluginsDirKey, &plugins_dir)) {
+ *error = kInvalidPluginsDirError;
+ return false;
+ }
+ plugins_dir_ = path_.AppendASCII(plugins_dir);
+ }
+
// Initialize content scripts (optional).
if (source.HasKey(kContentScriptsKey)) {
ListValue* list_value;