diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 05:42:36 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 05:42:36 +0000 |
commit | 0157282494c1096cef55f04d7b8936c7db022679 (patch) | |
tree | 33d30478c95e60b4ba629b098db06ae2d1418278 /webkit/support/test_webkit_platform_support.cc | |
parent | 745816be61e207da7cef1f839591bfb35bd15fd3 (diff) | |
download | chromium_src-0157282494c1096cef55f04d7b8936c7db022679.zip chromium_src-0157282494c1096cef55f04d7b8936c7db022679.tar.gz chromium_src-0157282494c1096cef55f04d7b8936c7db022679.tar.bz2 |
Move some webkit_glue embedder functions into WebKitPlatformSupport virtual methods
This moves the functions into a pattern that is component-friendly.
BUG=98755
TEST=chrome test_shell test_shell_tests browser_tests DumpRenderTree
Review URL: http://codereview.chromium.org/8602002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/test_webkit_platform_support.cc')
-rw-r--r-- | webkit/support/test_webkit_platform_support.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc index 5067681..6ba5c7b 100644 --- a/webkit/support/test_webkit_platform_support.cc +++ b/webkit/support/test_webkit_platform_support.cc @@ -43,6 +43,7 @@ #include "webkit/glue/webkitplatformsupport_impl.h" #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" +#include "webkit/plugins/npapi/plugin_list.h" #include "webkit/support/simple_database_system.h" #include "webkit/support/test_webmessageportchannel.h" #include "webkit/support/webkit_support.h" @@ -51,6 +52,7 @@ #include "webkit/tools/test_shell/mock_webclipboard_impl.h" #include "webkit/tools/test_shell/simple_appcache_system.h" #include "webkit/tools/test_shell/simple_file_system.h" +#include "webkit/tools/test_shell/simple_socket_stream_bridge.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/simple_webcookiejar_impl.h" #include "webkit/tools/test_shell/test_shell_request_context.h" @@ -407,3 +409,38 @@ void TestWebKitPlatformSupport::setGamepadData( const WebKit::WebGamepads& data) { gamepad_data_ = data; } + +void TestWebKitPlatformSupport::GetPlugins( + bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { + if (refresh) + webkit::npapi::PluginList::Singleton()->RefreshPlugins(); + webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); + // Don't load the forked npapi_layout_test_plugin in DRT, we only want to + // use the upstream version TestNetscapePlugIn. + const FilePath::StringType kPluginBlackList[] = { + FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), + FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"), + FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), + }; + for (int i = plugins->size() - 1; i >= 0; --i) { + webkit::WebPluginInfo plugin_info = plugins->at(i); + for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { + if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { + plugins->erase(plugins->begin() + i); + } + } + } +} + +webkit_glue::ResourceLoaderBridge* +TestWebKitPlatformSupport::CreateResourceLoader( + const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { + return SimpleResourceLoaderBridge::Create(request_info); +} + +webkit_glue::WebSocketStreamHandleBridge* +TestWebKitPlatformSupport::CreateWebSocketBridge( + WebKit::WebSocketStreamHandle* handle, + webkit_glue::WebSocketStreamHandleDelegate* delegate) { + return SimpleSocketStreamBridge::Create(handle, delegate); +} |