summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension.cc12
-rw-r--r--chrome/common/extensions/extension_unittest.cc15
2 files changed, 20 insertions, 7 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 10c8d52..9bfad28 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1936,13 +1936,6 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
return false;
}
-#if defined(OS_CHROMEOS)
- if (list_value->GetSize() > 0) {
- *error = errors::kIllegalPlugins;
- return false;
- }
-#endif
-
for (size_t i = 0; i < list_value->GetSize(); ++i) {
DictionaryValue* plugin_value = NULL;
std::string path_str;
@@ -1969,9 +1962,14 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
}
}
+ // We don't allow extension plugins to run on Chrome OS. We still
+ // parse the manifest entry so that error messages are consistently
+ // displayed across platforms.
+#if !defined(OS_CHROMEOS)
plugins_.push_back(PluginInfo());
plugins_.back().path = path().AppendASCII(path_str);
plugins_.back().is_public = is_public;
+#endif
}
}
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index b7a8041..ecae857 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -1215,6 +1215,21 @@ TEST(ExtensionTest, GetHostPermissionMessages_ManyHosts) {
UTF16ToUTF8(warnings[0]));
}
+TEST(ExtensionTest, GetPermissionMessages_Plugins) {
+ scoped_refptr<Extension> extension;
+ extension = LoadManifest("permissions", "plugins.json");
+ std::vector<string16> warnings = extension->GetPermissionMessageStrings();
+ // We don't parse the plugins key on Chrome OS, so it should not ask for any
+ // permissions.
+#if defined(OS_CHROMEOS)
+ ASSERT_EQ(0u, warnings.size());
+#else
+ ASSERT_EQ(1u, warnings.size());
+ EXPECT_EQ("All data on your computer and the websites you visit",
+ UTF16ToUTF8(warnings[0]));
+#endif
+}
+
TEST(ExtensionTest, WantsFileAccess) {
scoped_refptr<Extension> extension;
GURL file_url("file:///etc/passwd");