diff options
author | tkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 07:19:24 +0000 |
---|---|---|
committer | tkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 07:19:24 +0000 |
commit | 9f7b4d98cb1fb1065cbf8b045e50adcc6d4a2524 (patch) | |
tree | d3b599f89835284321e8196a054b13d96c514f56 /webkit/support/webkit_support.cc | |
parent | bee2335c8e86ab394e5380005d9d481b3f2b8ee3 (diff) | |
download | chromium_src-9f7b4d98cb1fb1065cbf8b045e50adcc6d4a2524.zip chromium_src-9f7b4d98cb1fb1065cbf8b045e50adcc6d4a2524.tar.gz chromium_src-9f7b4d98cb1fb1065cbf8b045e50adcc6d4a2524.tar.bz2 |
Move npapi_layout_test_plugin target to webkit_support to use it from
WebKit DumpRenderTree.
The following code change affects only WebKit DumpRenderTree.
* webkit_support.cc
- WebPluginImplWithPageDelegate passes a plugin path and MIME type to WebPluginImpl.
- CreateWebPlugin checks a MIME type.
This is the same logic as test_shell.
* test_webplugin_page_delegate.h
Creates and returns a WebPluginDelegateImpl instance.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2729004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/webkit_support.cc')
-rw-r--r-- | webkit/support/webkit_support.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index c594fad..523c0469 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -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 @@ class WebPluginImplWithPageDelegate 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 @@ WebKit::WebKitClient* GetWebKitClient() { 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, |