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

Unified Diff: chrome/browser/plugin_service.cc

Issue 2262002: Add ppapi plugins to about:plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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/plugin_service.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_service.cc
===================================================================
--- chrome/browser/plugin_service.cc (revision 48402)
+++ chrome/browser/plugin_service.cc (working copy)
@@ -28,6 +28,7 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/pepper_plugin_registry.h"
#include "chrome/common/plugin_messages.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
@@ -148,6 +149,8 @@
: main_message_loop_(MessageLoop::current()),
resource_dispatcher_host_(NULL),
ui_locale_(ASCIIToWide(g_browser_process->GetApplicationLocale())) {
+ RegisterPepperPlugins();
+
// Have the NPAPI plugin list search for Chrome plugins as well.
ChromePluginLib::RegisterPluginsWithNPAPI();
// Load the one specified on the command line as well.
@@ -415,3 +418,21 @@
return (url.scheme() == required_url.scheme() &&
url.host() == required_url.host());
}
+
+void PluginService::RegisterPepperPlugins() {
+ std::vector<PepperPluginInfo> plugins;
+ PepperPluginRegistry::GetList(&plugins);
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ NPAPI::PluginVersionInfo info;
+ info.path = plugins[i].path;
+ info.product_name = plugins[i].path.BaseName().ToWStringHack();
jam 2010/05/27 23:36:49 what's the plan for getting a proper name in here?
+ info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|'));
+
+ // These NPAPI entry points will never be called. TODO(darin): Come up
+ // with a cleaner way to register pepper plugins with the NPAPI PluginList,
+ // or perhaps refactor the PluginList to be less specific to NPAPI.
+ memset(&info.entry_points, 0, sizeof(info.entry_points));
+
+ NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info);
+ }
+}
« no previous file with comments | « chrome/browser/plugin_service.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698