summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authoramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 06:55:53 +0000
committeramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 06:55:53 +0000
commit017882554c41b6030a12d50b4044449e3c2409ac (patch)
tree5cb159fea9feafceb5260e7446cddf380799b182 /webkit/tools
parent3335d879a364867309a93749cc9e4805bd92d114 (diff)
downloadchromium_src-017882554c41b6030a12d50b4044449e3c2409ac.zip
chromium_src-017882554c41b6030a12d50b4044449e3c2409ac.tar.gz
chromium_src-017882554c41b6030a12d50b4044449e3c2409ac.tar.bz2
Checkpoint of plugin support code for Mac. Does not work yet; being checked
in to help stay in sync with linux plugin mods and ensure that it doesn't break Windows plugins. Review URL: http://codereview.chromium.org/21095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj2
-rw-r--r--webkit/tools/test_shell/mac/test_webview_delegate.mm22
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc2
3 files changed, 20 insertions, 6 deletions
diff --git a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
index 048559f..40d450c 100644
--- a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
+++ b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
@@ -2199,7 +2199,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7B8200960E76FDA1008F45CF /* debug.xcconfig */;
buildSettings = {
- FEATURE_DEFINES = "ENABLE_DATABASE=1 ENABLE_DASHBOARD_SUPPORT=0 ENABLE_JAVASCRIPT_DEBUGGER=0 ENABLE_JSC_MULTIPLE_THREADS=0 ENABLE_ICONDATABASE=0 ENABLE_XSLT=1 ENABLE_XPATH=1 ENABLE_SVG=1 ENABLE_SVG_ANIMATION=1 ENABLE_SVG_AS_IMAGE=1 ENABLE_SVG_USE=1 ENABLE_SVG_FOREIGN_OBJECT=1 ENABLE_SVG_FONTS=1 ENABLE_VIDEO=0 WEBCORE_NAVIGATOR_PLATFORM_=\"FixMeAndRemoveTrailingUnderscore\" USE_GOOGLE_URL_LIBRARY USE_SYSTEM_MALLOC=1";
+ FEATURE_DEFINES = "ENABLE_DATABASE=1 ENABLE_DASHBOARD_SUPPORT=0 ENABLE_JAVASCRIPT_DEBUGGER=0 ENABLE_JSC_MULTIPLE_THREADS=0 ENABLE_ICONDATABASE=0 ENABLE_XSLT=1 ENABLE_XPATH=1 ENABLE_SVG=1 ENABLE_SVG_ANIMATION=1 ENABLE_SVG_AS_IMAGE=1 ENABLE_SVG_USE=1 ENABLE_SVG_FOREIGN_OBJECT=1 ENABLE_SVG_FONTS=1 ENABLE_VIDEO=0 WEBCORE_NAVIGATOR_PLATFORM_=\"FixMeAndRemoveTrailingUnderscore\" USE_GOOGLE_URL_LIBRARY USE_SYSTEM_MALLOC=1 XP_MACOSX=1";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
"$(FEATURE_DEFINES)",
diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm
index 6a269ef123..a355ef3 100644
--- a/webkit/tools/test_shell/mac/test_webview_delegate.mm
+++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm
@@ -8,6 +8,8 @@
#include "base/string_util.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webview.h"
+#include "webkit/glue/plugins/plugin_list.h"
+#include "webkit/glue/plugins/webplugin_delegate_impl.h"
#include "webkit/tools/test_shell/test_shell.h"
@@ -22,10 +24,22 @@ WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
const std::string& mime_type,
const std::string& clsid,
std::string* actual_mime_type) {
- // TODO(awalker): once Mac plugins are working, enable this code to
- // connect up the web plugin delegate for a plugin.
- NOTIMPLEMENTED();
- return NULL;
+ WebWidgetHost *host = GetHostForWidget(webview);
+ if (!host)
+ return NULL;
+ gfx::NativeView view = host->view_handle();
+
+ 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, view);
+ else
+ return WebPluginDelegateImpl::Create(info.path, mime_type, view);
}
void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) {
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 5f52911..d7bd9d7 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -24,6 +24,7 @@
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webview.h"
#include "webkit/glue/plugins/plugin_list.h"
+#include "webkit/glue/plugins/webplugin_delegate_impl.h"
#include "webkit/glue/window_open_disposition.h"
#include "webkit/tools/test_shell/test_navigation_controller.h"
#include "webkit/tools/test_shell/test_shell.h"
@@ -31,7 +32,6 @@
#if defined(OS_WIN)
// TODO(port): make these files work everywhere.
#include "base/gfx/gdi_util.h"
-#include "webkit/glue/plugins/webplugin_delegate_impl.h"
#include "webkit/tools/test_shell/drag_delegate.h"
#include "webkit/tools/test_shell/drop_delegate.h"
#endif