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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 19871003: Simplify how we get the plugin list in the webkit platform support by removing the intermediate met… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 5 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 | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | webkit/glue/webkit_glue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
===================================================================
--- content/renderer/renderer_webkitplatformsupport_impl.cc (revision 212672)
+++ content/renderer/renderer_webkitplatformsupport_impl.cc (working copy)
@@ -57,6 +57,7 @@
#include "third_party/WebKit/public/platform/WebHyphenator.h"
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
#include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h"
+#include "third_party/WebKit/public/platform/WebPluginListBuilder.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebFrame.h"
@@ -66,6 +67,7 @@
#include "webkit/glue/simple_webmimeregistry_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/glue/webkit_glue.h"
+#include "webkit/plugins/webplugininfo.h"
#if defined(OS_WIN)
#include "content/common/child_process_messages.h"
@@ -902,6 +904,37 @@
return new RendererWebMIDIAccessorImpl(client);
}
+void RendererWebKitPlatformSupportImpl::getPluginList(
+ bool refresh,
+ WebKit::WebPluginListBuilder* builder) {
+#if defined(ENABLE_PLUGINS)
+ std::vector<webkit::WebPluginInfo> plugins;
+ if (!plugin_refresh_allowed_)
+ refresh = false;
+ RenderThread::Get()->Send(
+ new ViewHostMsg_GetPlugins(refresh, &plugins));
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ const webkit::WebPluginInfo& plugin = plugins[i];
+
+ builder->addPlugin(
+ plugin.name, plugin.desc,
+ plugin.path.BaseName().AsUTF16Unsafe());
+
+ for (size_t j = 0; j < plugin.mime_types.size(); ++j) {
+ const webkit::WebPluginMimeType& mime_type = plugin.mime_types[j];
+
+ builder->addMediaTypeToLastPlugin(
+ WebString::fromUTF8(mime_type.mime_type), mime_type.description);
+
+ for (size_t k = 0; k < mime_type.file_extensions.size(); ++k) {
+ builder->addFileExtensionToLastMediaType(
+ UTF8ToUTF16(mime_type.file_extensions[k]));
jamesr 2013/07/20 00:26:01 WebString::fromUTF8() here is better since it won'
jam 2013/07/20 00:30:39 Done.
+ }
+ }
+ }
+#endif
+}
+
//------------------------------------------------------------------------------
WebKit::WebString
@@ -955,16 +988,6 @@
return WebKitPlatformSupportImpl::userAgent(url);
}
-void RendererWebKitPlatformSupportImpl::GetPlugins(
- bool refresh, std::vector<webkit::WebPluginInfo>* plugins) {
-#if defined(ENABLE_PLUGINS)
- if (!plugin_refresh_allowed_)
- refresh = false;
- RenderThread::Get()->Send(
- new ViewHostMsg_GetPlugins(refresh, plugins));
-#endif
-}
-
//------------------------------------------------------------------------------
WebRTCPeerConnectionHandler*
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | webkit/glue/webkit_glue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698