summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins/webplugin_delegate_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 01:48:52 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 01:48:52 +0000
commit829c2841a0e30b9f08453566ffc52d2c386a9045 (patch)
treeb916ff2699e97a13f027d3e2cb60be781c0e18c8 /webkit/glue/plugins/webplugin_delegate_impl.cc
parent5c0b8e45fa1260f311d71073c8a9b89db199d992 (diff)
downloadchromium_src-829c2841a0e30b9f08453566ffc52d2c386a9045.zip
chromium_src-829c2841a0e30b9f08453566ffc52d2c386a9045.tar.gz
chromium_src-829c2841a0e30b9f08453566ffc52d2c386a9045.tar.bz2
Port plugin messages.
Review URL: http://codereview.chromium.org/49050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/webplugin_delegate_impl.cc')
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc
index 3d18525..87d02cb 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl.cc
@@ -253,6 +253,13 @@ bool WebPluginDelegateImpl::Initialize(const GURL& url,
return false;
windowless_ = instance_->windowless();
+ if (!windowless_) {
+ if (!WindowedCreatePlugin())
+ return false;
+ }
+
+ windowed_manage_position_ = plugin->SetWindow(windowed_handle_);
+#if defined(OS_WIN)
if (windowless_) {
// For windowless plugins we should set the containing window handle
// as the instance window handle. This is what Safari does. Not having
@@ -262,13 +269,9 @@ bool WebPluginDelegateImpl::Initialize(const GURL& url,
instance_->set_window_handle(parent_);
CreateDummyWindowForActivation();
handle_event_pump_messages_event_ = CreateEvent(NULL, TRUE, FALSE, NULL);
- } else {
- if (!WindowedCreatePlugin())
- return false;
+ plugin->SetWindowlessPumpEvent(handle_event_pump_messages_event_);
}
-
- windowed_manage_position_ =
- plugin->SetWindow(windowed_handle_, handle_event_pump_messages_event_);
+#endif
plugin_url_ = url.spec();
// The windowless version of the Silverlight plugin calls the
@@ -382,7 +385,7 @@ void WebPluginDelegateImpl::SendJavaScriptStream(const std::string& url,
const std::wstring& result,
bool success,
bool notify_needed,
- int notify_data) {
+ intptr_t notify_data) {
instance()->SendJavaScriptStream(url, result, success, notify_needed,
notify_data);
}
@@ -1090,7 +1093,7 @@ bool WebPluginDelegateImpl::HandleEvent(NPEvent* event,
WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient(
int resource_id, const std::string &url, bool notify_needed,
- void *notify_data, void* existing_stream) {
+ intptr_t notify_data, intptr_t existing_stream) {
// Stream already exists. This typically happens for range requests
// initiated via NPN_RequestRead.
if (existing_stream) {
@@ -1106,17 +1109,15 @@ WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient(
instance()->SetURLLoadData(GURL(url.c_str()), notify_data);
}
std::string mime_type;
- NPAPI::PluginStreamUrl *stream = instance()->CreateStream(resource_id,
- url,
- mime_type,
- notify_needed,
- notify_data);
+ NPAPI::PluginStreamUrl *stream = instance()->CreateStream(
+ resource_id, url, mime_type, notify_needed,
+ reinterpret_cast<void*>(notify_data));
return stream;
}
void WebPluginDelegateImpl::URLRequestRouted(const std::string&url,
bool notify_needed,
- void* notify_data) {
+ intptr_t notify_data) {
if (notify_needed) {
instance()->SetURLLoadData(GURL(url.c_str()), notify_data);
}