OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <atlbase.h> | 10 #include <atlbase.h> |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 return plugin_path_; | 324 return plugin_path_; |
325 } | 325 } |
326 | 326 |
327 void WebPluginDelegateProxy::InstallMissingPlugin() { | 327 void WebPluginDelegateProxy::InstallMissingPlugin() { |
328 Send(new PluginMsg_InstallMissingPlugin(instance_id_)); | 328 Send(new PluginMsg_InstallMissingPlugin(instance_id_)); |
329 } | 329 } |
330 | 330 |
331 void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { | 331 void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { |
332 IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) | 332 IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) |
333 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) | 333 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) |
| 334 #if defined(OS_LINUX) |
| 335 IPC_MESSAGE_HANDLER(PluginHostMsg_CreatePluginContainer, |
| 336 OnCreatePluginContainer) |
| 337 IPC_MESSAGE_HANDLER(PluginHostMsg_DestroyPluginContainer, |
| 338 OnDestroyPluginContainer) |
| 339 #endif |
334 #if defined(OS_WIN) | 340 #if defined(OS_WIN) |
335 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, | 341 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, |
336 OnSetWindowlessPumpEvent) | 342 OnSetWindowlessPumpEvent) |
337 #endif | 343 #endif |
338 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) | 344 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) |
339 IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) | 345 IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) |
340 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, | 346 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, |
341 OnGetWindowScriptNPObject) | 347 OnGetWindowScriptNPObject) |
342 IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, | 348 IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, |
343 OnGetPluginElement) | 349 OnGetPluginElement) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 instance_id_, &event, &handled, cursor); | 633 instance_id_, &event, &handled, cursor); |
628 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); | 634 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); |
629 Send(message); | 635 Send(message); |
630 return handled; | 636 return handled; |
631 } | 637 } |
632 | 638 |
633 int WebPluginDelegateProxy::GetProcessId() { | 639 int WebPluginDelegateProxy::GetProcessId() { |
634 return channel_host_->peer_pid(); | 640 return channel_host_->peer_pid(); |
635 } | 641 } |
636 | 642 |
637 void WebPluginDelegateProxy::OnSetWindow(gfx::NativeViewId window_id) { | 643 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { |
638 #if defined(OS_WIN) | 644 windowless_ = window == static_cast<gfx::PluginWindowHandle>(0); |
639 gfx::NativeView window = gfx::NativeViewFromId(window_id); | |
640 windowless_ = window == NULL; | |
641 if (plugin_) | 645 if (plugin_) |
642 plugin_->SetWindow(window); | 646 plugin_->SetWindow(window); |
643 #else | 647 } |
644 NOTIMPLEMENTED(); | 648 |
| 649 #if defined(OS_LINUX) |
| 650 void WebPluginDelegateProxy::OnCreatePluginContainer( |
| 651 gfx::PluginWindowHandle* container) { |
| 652 RenderThread::current()->Send(new ViewHostMsg_CreatePluginContainer( |
| 653 render_view_->routing_id(), container)); |
| 654 } |
| 655 |
| 656 void WebPluginDelegateProxy::OnDestroyPluginContainer( |
| 657 gfx::PluginWindowHandle container) { |
| 658 RenderThread::current()->Send(new ViewHostMsg_DestroyPluginContainer( |
| 659 render_view_->routing_id(), container)); |
| 660 } |
645 #endif | 661 #endif |
646 } | |
647 | 662 |
648 #if defined(OS_WIN) | 663 #if defined(OS_WIN) |
649 void WebPluginDelegateProxy::OnSetWindowlessPumpEvent( | 664 void WebPluginDelegateProxy::OnSetWindowlessPumpEvent( |
650 HANDLE modal_loop_pump_messages_event) { | 665 HANDLE modal_loop_pump_messages_event) { |
651 DCHECK(modal_loop_pump_messages_event_ == NULL); | 666 DCHECK(modal_loop_pump_messages_event_ == NULL); |
652 | 667 |
653 modal_loop_pump_messages_event_.reset( | 668 modal_loop_pump_messages_event_.reset( |
654 new base::WaitableEvent(modal_loop_pump_messages_event)); | 669 new base::WaitableEvent(modal_loop_pump_messages_event)); |
655 } | 670 } |
656 #endif | 671 #endif |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 plugin_->CancelDocumentLoad(); | 933 plugin_->CancelDocumentLoad(); |
919 } | 934 } |
920 | 935 |
921 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 936 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
922 const std::string& url, const std::string& range_info, | 937 const std::string& url, const std::string& range_info, |
923 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 938 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
924 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 939 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
925 existing_stream, notify_needed, | 940 existing_stream, notify_needed, |
926 notify_data); | 941 notify_data); |
927 } | 942 } |
OLD | NEW |