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

Unified Diff: webkit/support/webkit_support.cc

Issue 2729004: Move npapi_layout_test_plugin target to webkit_support to use it from... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « webkit/support/test_webplugin_page_delegate.h ('k') | webkit/support/webkit_support.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/webkit_support.cc
===================================================================
--- webkit/support/webkit_support.cc (revision 49234)
+++ webkit/support/webkit_support.cc (working copy)
@@ -24,8 +24,10 @@
#include "webkit/glue/media/media_resource_loader_bridge_factory.h"
#include "webkit/glue/media/simple_data_source.h"
#include "webkit/glue/media/video_renderer_impl.h"
+#include "webkit/glue/plugins/plugin_list.h"
#include "webkit/glue/plugins/webplugin_impl.h"
#include "webkit/glue/plugins/webplugin_page_delegate.h"
+#include "webkit/glue/plugins/webplugininfo.h"
#include "webkit/glue/webkitclient_impl.h"
#include "webkit/glue/webmediaplayer_impl.h"
#include "webkit/support/platform_support.h"
@@ -82,10 +84,12 @@
public webkit_glue::WebPluginImpl {
public:
WebPluginImplWithPageDelegate(WebFrame* frame,
- const WebPluginParams& params)
+ const WebPluginParams& params,
+ const FilePath& path,
+ const std::string& mime_type)
: webkit_support::TestWebPluginPageDelegate(),
webkit_glue::WebPluginImpl(
- frame, params, FilePath(), params.mimeType.utf8(), AsWeakPtr()) {}
+ frame, params, path, mime_type, AsWeakPtr()) {}
virtual ~WebPluginImplWithPageDelegate() {}
private:
DISALLOW_COPY_AND_ASSIGN(WebPluginImplWithPageDelegate);
@@ -144,7 +148,20 @@
WebPlugin* CreateWebPlugin(WebFrame* frame,
const WebPluginParams& params) {
- return new WebPluginImplWithPageDelegate(frame, params);
+ const bool kAllowWildcard = true;
+ WebPluginInfo info;
+ std::string actual_mime_type;
+ if (!NPAPI::PluginList::Singleton()->GetPluginInfo(
+ params.url, params.mimeType.utf8(), kAllowWildcard, &info,
+ &actual_mime_type)) {
+ return NULL;
+ }
+
+ if (actual_mime_type.empty())
+ actual_mime_type = params.mimeType.utf8();
+
+ return new WebPluginImplWithPageDelegate(
+ frame, params, info.path, actual_mime_type);
}
WebKit::WebMediaPlayer* CreateMediaPlayer(WebFrame* frame,
« no previous file with comments | « webkit/support/test_webplugin_page_delegate.h ('k') | webkit/support/webkit_support.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698