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

Unified Diff: chrome/browser/ui/webui/plugins_ui.cc

Issue 8362009: Add plugin type (NPAPI, PPAPI, etc.) to chrome://plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed WebPluginInfo::PluginType change Created 9 years, 2 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/resources/plugins.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/plugins_ui.cc
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index 8b6d3d6fc3746734d86d98cda9de23f174a45b78..b7d8044a06637bb80f335fbb02964ce77e1e7277 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -36,6 +36,7 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "webkit/plugins/npapi/plugin_group.h"
@@ -63,6 +64,7 @@ ChromeWebUIDataSource* CreatePluginsUIHTMLSource() {
source->AddLocalizedString("pluginVersion", IDS_PLUGINS_VERSION);
source->AddLocalizedString("pluginDescription", IDS_PLUGINS_DESCRIPTION);
source->AddLocalizedString("pluginPath", IDS_PLUGINS_PATH);
+ source->AddLocalizedString("pluginType", IDS_PLUGINS_TYPE);
source->AddLocalizedString("pluginMimeTypes", IDS_PLUGINS_MIME_TYPES);
source->AddLocalizedString("pluginMimeTypesMimeType",
IDS_PLUGINS_MIME_TYPES_MIME_TYPE);
@@ -80,6 +82,22 @@ ChromeWebUIDataSource* CreatePluginsUIHTMLSource() {
return source;
}
+string16 PluginTypeToString(int type) {
+ // The type is stored as an |int|, but doing the switch on the right
+ // enumeration type gives us better build-time error checking (if someone adds
+ // a new type).
+ switch (static_cast<WebPluginInfo::PluginType>(type)) {
+ case WebPluginInfo::PLUGIN_TYPE_NPAPI:
+ return l10n_util::GetStringUTF16(IDS_PLUGINS_NPAPI);
+ case WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS:
+ return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_IN_PROCESS);
+ case WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS:
+ return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_OUT_OF_PROCESS);
+ }
+ NOTREACHED();
+ return string16();
+}
+
////////////////////////////////////////////////////////////////////////////////
//
// PluginsDOMHandler
@@ -264,6 +282,7 @@ void PluginsDOMHandler::PluginsLoaded(const std::vector<PluginGroup>& groups) {
plugin_file->SetString("description", group_plugin.desc);
plugin_file->SetString("path", group_plugin.path.value());
plugin_file->SetString("version", group_plugin.version);
+ plugin_file->SetString("type", PluginTypeToString(group_plugin.type));
ListValue* mime_types = new ListValue();
const std::vector<webkit::WebPluginMimeType>& plugin_mime_types =
« no previous file with comments | « chrome/browser/resources/plugins.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698