| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 417 } |
| 418 | 418 |
| 419 void WebPluginDelegateProxy::DidManualLoadFail() { | 419 void WebPluginDelegateProxy::DidManualLoadFail() { |
| 420 Send(new PluginMsg_DidManualLoadFail(instance_id_)); | 420 Send(new PluginMsg_DidManualLoadFail(instance_id_)); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void WebPluginDelegateProxy::InstallMissingPlugin() { | 423 void WebPluginDelegateProxy::InstallMissingPlugin() { |
| 424 Send(new PluginMsg_InstallMissingPlugin(instance_id_)); | 424 Send(new PluginMsg_InstallMissingPlugin(instance_id_)); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { | 427 bool WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { |
| 428 child_process_logging::SetActiveURL(page_url_); | 428 child_process_logging::SetActiveURL(page_url_); |
| 429 | 429 |
| 430 bool handled = true; |
| 430 IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) | 431 IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) |
| 431 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) | 432 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) |
| 432 #if defined(OS_WIN) | 433 #if defined(OS_WIN) |
| 433 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, | 434 IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, |
| 434 OnSetWindowlessPumpEvent) | 435 OnSetWindowlessPumpEvent) |
| 435 #endif | 436 #endif |
| 436 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) | 437 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) |
| 437 IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) | 438 IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) |
| 438 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, | 439 IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, |
| 439 OnGetWindowScriptNPObject) | 440 OnGetWindowScriptNPObject) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 OnAcceleratedSurfaceSetTransportDIB) | 472 OnAcceleratedSurfaceSetTransportDIB) |
| 472 IPC_MESSAGE_HANDLER(PluginHostMsg_AllocTransportDIB, | 473 IPC_MESSAGE_HANDLER(PluginHostMsg_AllocTransportDIB, |
| 473 OnAcceleratedSurfaceAllocTransportDIB) | 474 OnAcceleratedSurfaceAllocTransportDIB) |
| 474 IPC_MESSAGE_HANDLER(PluginHostMsg_FreeTransportDIB, | 475 IPC_MESSAGE_HANDLER(PluginHostMsg_FreeTransportDIB, |
| 475 OnAcceleratedSurfaceFreeTransportDIB) | 476 OnAcceleratedSurfaceFreeTransportDIB) |
| 476 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceBuffersSwapped, | 477 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceBuffersSwapped, |
| 477 OnAcceleratedSurfaceBuffersSwapped) | 478 OnAcceleratedSurfaceBuffersSwapped) |
| 478 #endif | 479 #endif |
| 479 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse, | 480 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse, |
| 480 OnURLRedirectResponse) | 481 OnURLRedirectResponse) |
| 481 | 482 IPC_MESSAGE_UNHANDLED(handled = false) |
| 482 IPC_MESSAGE_UNHANDLED_ERROR() | |
| 483 IPC_END_MESSAGE_MAP() | 483 IPC_END_MESSAGE_MAP() |
| 484 DCHECK(handled); |
| 485 return handled; |
| 484 } | 486 } |
| 485 | 487 |
| 486 void WebPluginDelegateProxy::OnChannelError() { | 488 void WebPluginDelegateProxy::OnChannelError() { |
| 487 if (plugin_) { | 489 if (plugin_) { |
| 488 if (window_) { | 490 if (window_) { |
| 489 // The actual WebPluginDelegate never got a chance to tell the WebPlugin | 491 // The actual WebPluginDelegate never got a chance to tell the WebPlugin |
| 490 // its window was going away. Do it on its behalf. | 492 // its window was going away. Do it on its behalf. |
| 491 WillDestroyWindow(); | 493 WillDestroyWindow(); |
| 492 } | 494 } |
| 493 plugin_->Invalidate(); | 495 plugin_->Invalidate(); |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 #endif | 1561 #endif |
| 1560 | 1562 |
| 1561 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1563 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
| 1562 int resource_id) { | 1564 int resource_id) { |
| 1563 if (!plugin_) | 1565 if (!plugin_) |
| 1564 return; | 1566 return; |
| 1565 | 1567 |
| 1566 plugin_->URLRedirectResponse(allow, resource_id); | 1568 plugin_->URLRedirectResponse(allow, resource_id); |
| 1567 } | 1569 } |
| 1568 | 1570 |
| OLD | NEW |