| Index: chrome/common/extensions/extension.cc
|
| ===================================================================
|
| --- chrome/common/extensions/extension.cc (revision 158694)
|
| +++ chrome/common/extensions/extension.cc (working copy)
|
| @@ -1513,7 +1513,6 @@
|
| bool Extension::LoadPlugins(string16* error) {
|
| if (!manifest_->HasKey(keys::kPlugins))
|
| return true;
|
| -
|
| ListValue* list_value = NULL;
|
| if (!manifest_->GetList(keys::kPlugins, &list_value)) {
|
| *error = ASCIIToUTF16(errors::kInvalidPlugins);
|
| @@ -1544,20 +1543,24 @@
|
| }
|
| }
|
|
|
| - // We don't allow extensions to load NPAPI plugins on Chrome OS, or under
|
| - // Windows 8 Metro mode, but still parse the entries to display consistent
|
| - // error messages. If the extension actually requires the plugins then
|
| - // LoadRequirements will prevent it loading.
|
| #if defined(OS_CHROMEOS)
|
| - continue;
|
| -#elif defined(OS_WIN)
|
| + // 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.
|
| +#else
|
| +#if defined(OS_WIN)
|
| + // Like Chrome OS, we don't support NPAPI plugins in Windows 8 metro mode
|
| + // but in this case we want to fail with an error.
|
| if (base::win::IsMetroProcess()) {
|
| - continue;
|
| + *error = l10n_util::GetStringUTF16(
|
| + IDS_EXTENSION_INSTALL_PLUGIN_NOT_SUPPORTED);
|
| + return false;
|
| }
|
| #endif // defined(OS_WIN).
|
| plugins_.push_back(PluginInfo());
|
| plugins_.back().path = path().Append(FilePath::FromUTF8Unsafe(path_str));
|
| plugins_.back().is_public = is_public;
|
| +#endif // defined(OS_CHROMEOS).
|
| }
|
| return true;
|
| }
|
| @@ -1685,11 +1688,9 @@
|
| }
|
|
|
| bool Extension::LoadRequirements(string16* error) {
|
| - // Before parsing requirements from the manifest, automatically default the
|
| - // NPAPI plugin requirement based on whether it includes NPAPI plugins.
|
| - ListValue* list_value = NULL;
|
| - requirements_.npapi =
|
| - manifest_->GetList(keys::kPlugins, &list_value) && !list_value->empty();
|
| + // If the extension has plugins, then |requirements_.npapi| defaults to true.
|
| + if (plugins_.size() > 0)
|
| + requirements_.npapi = true;
|
|
|
| if (!manifest_->HasKey(keys::kRequirements))
|
| return true;
|
|
|