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

Unified Diff: webkit/tools/test_shell/test_webview_delegate_gtk.cc

Issue 19413: Linux plugins WIP. (Closed)
Patch Set: review comments Created 11 years, 11 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/glue/webplugin_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_webview_delegate_gtk.cc
diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
index 831691a77776622b8d97970f13c52aea6fb3f4a4..8482080b8e6dba8cd62006d62bc044adff163de1 100644
--- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
@@ -22,7 +22,9 @@
#include "webkit/glue/weburlrequest.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webview.h"
+#include "webkit/glue/plugins/plugin_list.h"
#include "webkit/glue/window_open_disposition.h"
+#include "webkit/glue/plugins/webplugin_delegate_impl.h"
#include "webkit/tools/test_shell/test_navigation_controller.h"
#include "webkit/tools/test_shell/test_shell.h"
@@ -77,8 +79,19 @@ WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
const std::string& mime_type,
const std::string& clsid,
std::string* actual_mime_type) {
- NOTIMPLEMENTED();
- return NULL;
+ bool allow_wildcard = true;
+ WebPluginInfo info;
+ if (!NPAPI::PluginList::Singleton()->GetPluginInfo(url, mime_type, clsid,
+ allow_wildcard, &info,
+ actual_mime_type))
+ return NULL;
+
+ if (actual_mime_type && !actual_mime_type->empty())
+ return WebPluginDelegateImpl::Create(info.path, *actual_mime_type,
+ shell_->webViewHost()->view_handle());
+ else
+ return WebPluginDelegateImpl::Create(info.path, mime_type,
+ shell_->webViewHost()->view_handle());
}
void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) {
« no previous file with comments | « webkit/glue/webplugin_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698