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

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

Issue 10982037: Revert 158217 - Allow extensions which can run without NPAPI to run under Windows 8 Metro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
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;

Powered by Google App Engine
This is Rietveld 408576698