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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) | 455 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) |
456 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCPBrowsingContext, | 456 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCPBrowsingContext, |
457 OnGetCPBrowsingContext) | 457 OnGetCPBrowsingContext) |
458 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) | 458 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) |
459 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, | 459 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, |
460 OnInitiateHTTPRangeRequest) | 460 OnInitiateHTTPRangeRequest) |
461 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, | 461 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, |
462 OnDeferResourceLoading) | 462 OnDeferResourceLoading) |
463 | 463 |
464 #if defined(OS_MACOSX) | 464 #if defined(OS_MACOSX) |
| 465 IPC_MESSAGE_HANDLER(PluginHostMsg_SetImeEnabled, |
| 466 OnSetImeEnabled); |
465 IPC_MESSAGE_HANDLER(PluginHostMsg_BindFakePluginWindowHandle, | 467 IPC_MESSAGE_HANDLER(PluginHostMsg_BindFakePluginWindowHandle, |
466 OnBindFakePluginWindowHandle); | 468 OnBindFakePluginWindowHandle); |
467 IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK, | 469 IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK, |
468 OnUpdateGeometry_ACK) | 470 OnUpdateGeometry_ACK) |
469 // Used only on 10.6 and later. | 471 // Used only on 10.6 and later. |
470 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetIOSurface, | 472 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetIOSurface, |
471 OnAcceleratedSurfaceSetIOSurface) | 473 OnAcceleratedSurfaceSetIOSurface) |
472 // Used on 10.5 and earlier. | 474 // Used on 10.5 and earlier. |
473 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, | 475 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, |
474 OnAcceleratedSurfaceSetTransportDIB) | 476 OnAcceleratedSurfaceSetTransportDIB) |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame, | 1010 void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame, |
1009 gfx::Rect view_frame) { | 1011 gfx::Rect view_frame) { |
1010 IPC::Message* msg = new PluginMsg_WindowFrameChanged(instance_id_, | 1012 IPC::Message* msg = new PluginMsg_WindowFrameChanged(instance_id_, |
1011 window_frame, | 1013 window_frame, |
1012 view_frame); | 1014 view_frame); |
1013 // Make sure frame events are delivered in the right order relative to | 1015 // Make sure frame events are delivered in the right order relative to |
1014 // sync messages they might interact with (e.g., HandleEvent). | 1016 // sync messages they might interact with (e.g., HandleEvent). |
1015 msg->set_unblock(true); | 1017 msg->set_unblock(true); |
1016 Send(msg); | 1018 Send(msg); |
1017 } | 1019 } |
| 1020 void WebPluginDelegateProxy::ImeCompositionConfirmed(const string16& text, |
| 1021 int plugin_id) { |
| 1022 // If the text isn't intended for this plugin, there's nothing to do. |
| 1023 if (instance_id_ != plugin_id) |
| 1024 return; |
| 1025 |
| 1026 IPC::Message* msg = new PluginMsg_ImeCompositionConfirmed(instance_id_, |
| 1027 text); |
| 1028 // Order relative to other key events is important. |
| 1029 msg->set_unblock(true); |
| 1030 Send(msg); |
| 1031 } |
1018 #endif // OS_MACOSX | 1032 #endif // OS_MACOSX |
1019 | 1033 |
1020 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { | 1034 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { |
1021 uses_shared_bitmaps_ = !window; | 1035 uses_shared_bitmaps_ = !window; |
1022 window_ = window; | 1036 window_ = window; |
1023 if (plugin_) | 1037 if (plugin_) |
1024 plugin_->SetWindow(window); | 1038 plugin_->SetWindow(window); |
1025 } | 1039 } |
1026 | 1040 |
1027 void WebPluginDelegateProxy::WillDestroyWindow() { | 1041 void WebPluginDelegateProxy::WillDestroyWindow() { |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 if (!channel_host_) | 1370 if (!channel_host_) |
1357 return NULL; | 1371 return NULL; |
1358 | 1372 |
1359 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, | 1373 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, |
1360 instance_id_); | 1374 instance_id_); |
1361 proxy->InitializeForSeekableStream(resource_id, range_request_id); | 1375 proxy->InitializeForSeekableStream(resource_id, range_request_id); |
1362 return proxy; | 1376 return proxy; |
1363 } | 1377 } |
1364 | 1378 |
1365 #if defined(OS_MACOSX) | 1379 #if defined(OS_MACOSX) |
| 1380 void WebPluginDelegateProxy::OnSetImeEnabled(bool enabled) { |
| 1381 if (render_view_) |
| 1382 render_view_->SetPluginImeEnabled(enabled, instance_id_); |
| 1383 } |
| 1384 |
1366 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { | 1385 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { |
1367 BindFakePluginWindowHandle(opaque); | 1386 BindFakePluginWindowHandle(opaque); |
1368 } | 1387 } |
1369 | 1388 |
1370 // Synthesize a fake window handle for the plug-in to identify the instance | 1389 // Synthesize a fake window handle for the plug-in to identify the instance |
1371 // to the browser, allowing mapping to a surface for hardware acceleration | 1390 // to the browser, allowing mapping to a surface for hardware acceleration |
1372 // of plug-in content. The browser generates the handle which is then set on | 1391 // of plug-in content. The browser generates the handle which is then set on |
1373 // the plug-in. Returns true if it successfully sets the window handle on the | 1392 // the plug-in. Returns true if it successfully sets the window handle on the |
1374 // plug-in. | 1393 // plug-in. |
1375 bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { | 1394 bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 if (index->mime_type == "application/x-vnd.moveplayer.qm" || | 1552 if (index->mime_type == "application/x-vnd.moveplayer.qm" || |
1534 index->mime_type == "application/x-vnd.moveplay2.qm" || | 1553 index->mime_type == "application/x-vnd.moveplay2.qm" || |
1535 index->mime_type == "application/x-vnd.movenetworks.qm" || | 1554 index->mime_type == "application/x-vnd.movenetworks.qm" || |
1536 index->mime_type == "application/x-vnd.mnplayer.qm") { | 1555 index->mime_type == "application/x-vnd.mnplayer.qm") { |
1537 return true; | 1556 return true; |
1538 } | 1557 } |
1539 } | 1558 } |
1540 return false; | 1559 return false; |
1541 } | 1560 } |
1542 #endif | 1561 #endif |
OLD | NEW |