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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) | 450 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) |
451 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCPBrowsingContext, | 451 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCPBrowsingContext, |
452 OnGetCPBrowsingContext) | 452 OnGetCPBrowsingContext) |
453 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) | 453 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) |
454 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, | 454 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, |
455 OnInitiateHTTPRangeRequest) | 455 OnInitiateHTTPRangeRequest) |
456 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, | 456 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, |
457 OnDeferResourceLoading) | 457 OnDeferResourceLoading) |
458 | 458 |
459 #if defined(OS_MACOSX) | 459 #if defined(OS_MACOSX) |
460 IPC_MESSAGE_HANDLER(PluginHostMsg_SetImeEnabled, | 460 IPC_MESSAGE_HANDLER(PluginHostMsg_FocusChanged, |
461 OnSetImeEnabled); | 461 OnFocusChanged); |
| 462 IPC_MESSAGE_HANDLER(PluginHostMsg_StartIme, |
| 463 OnStartIme); |
462 IPC_MESSAGE_HANDLER(PluginHostMsg_BindFakePluginWindowHandle, | 464 IPC_MESSAGE_HANDLER(PluginHostMsg_BindFakePluginWindowHandle, |
463 OnBindFakePluginWindowHandle); | 465 OnBindFakePluginWindowHandle); |
464 IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK, | 466 IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK, |
465 OnUpdateGeometry_ACK) | 467 OnUpdateGeometry_ACK) |
466 // Used only on 10.6 and later. | 468 // Used only on 10.6 and later. |
467 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetIOSurface, | 469 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetIOSurface, |
468 OnAcceleratedSurfaceSetIOSurface) | 470 OnAcceleratedSurfaceSetIOSurface) |
469 // Used on 10.5 and earlier. | 471 // Used on 10.5 and earlier. |
470 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, | 472 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, |
471 OnAcceleratedSurfaceSetTransportDIB) | 473 OnAcceleratedSurfaceSetTransportDIB) |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame, | 1011 void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame, |
1010 gfx::Rect view_frame) { | 1012 gfx::Rect view_frame) { |
1011 IPC::Message* msg = new PluginMsg_WindowFrameChanged(instance_id_, | 1013 IPC::Message* msg = new PluginMsg_WindowFrameChanged(instance_id_, |
1012 window_frame, | 1014 window_frame, |
1013 view_frame); | 1015 view_frame); |
1014 // Make sure frame events are delivered in the right order relative to | 1016 // Make sure frame events are delivered in the right order relative to |
1015 // sync messages they might interact with (e.g., HandleEvent). | 1017 // sync messages they might interact with (e.g., HandleEvent). |
1016 msg->set_unblock(true); | 1018 msg->set_unblock(true); |
1017 Send(msg); | 1019 Send(msg); |
1018 } | 1020 } |
1019 void WebPluginDelegateProxy::ImeCompositionConfirmed(const string16& text, | 1021 void WebPluginDelegateProxy::ImeCompositionCompleted(const string16& text, |
1020 int plugin_id) { | 1022 int plugin_id) { |
1021 // If the text isn't intended for this plugin, there's nothing to do. | 1023 // If the message isn't intended for this plugin, there's nothing to do. |
1022 if (instance_id_ != plugin_id) | 1024 if (instance_id_ != plugin_id) |
1023 return; | 1025 return; |
1024 | 1026 |
1025 IPC::Message* msg = new PluginMsg_ImeCompositionConfirmed(instance_id_, | 1027 IPC::Message* msg = new PluginMsg_ImeCompositionCompleted(instance_id_, |
1026 text); | 1028 text); |
1027 // Order relative to other key events is important. | 1029 // Order relative to other key events is important. |
1028 msg->set_unblock(true); | 1030 msg->set_unblock(true); |
1029 Send(msg); | 1031 Send(msg); |
1030 } | 1032 } |
1031 #endif // OS_MACOSX | 1033 #endif // OS_MACOSX |
1032 | 1034 |
1033 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { | 1035 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { |
1034 uses_shared_bitmaps_ = !window; | 1036 uses_shared_bitmaps_ = !window; |
1035 window_ = window; | 1037 window_ = window; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 if (!channel_host_) | 1371 if (!channel_host_) |
1370 return NULL; | 1372 return NULL; |
1371 | 1373 |
1372 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, | 1374 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, |
1373 instance_id_); | 1375 instance_id_); |
1374 proxy->InitializeForSeekableStream(resource_id, range_request_id); | 1376 proxy->InitializeForSeekableStream(resource_id, range_request_id); |
1375 return proxy; | 1377 return proxy; |
1376 } | 1378 } |
1377 | 1379 |
1378 #if defined(OS_MACOSX) | 1380 #if defined(OS_MACOSX) |
1379 void WebPluginDelegateProxy::OnSetImeEnabled(bool enabled) { | 1381 void WebPluginDelegateProxy::OnFocusChanged(bool focused) { |
1380 if (render_view_) | 1382 if (render_view_) |
1381 render_view_->SetPluginImeEnabled(enabled, instance_id_); | 1383 render_view_->PluginFocusChanged(focused, instance_id_); |
| 1384 } |
| 1385 |
| 1386 void WebPluginDelegateProxy::OnStartIme() { |
| 1387 if (render_view_) |
| 1388 render_view_->StartPluginIme(); |
1382 } | 1389 } |
1383 | 1390 |
1384 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { | 1391 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { |
1385 BindFakePluginWindowHandle(opaque); | 1392 BindFakePluginWindowHandle(opaque); |
1386 } | 1393 } |
1387 | 1394 |
1388 // Synthesize a fake window handle for the plug-in to identify the instance | 1395 // Synthesize a fake window handle for the plug-in to identify the instance |
1389 // to the browser, allowing mapping to a surface for hardware acceleration | 1396 // to the browser, allowing mapping to a surface for hardware acceleration |
1390 // of plug-in content. The browser generates the handle which is then set on | 1397 // of plug-in content. The browser generates the handle which is then set on |
1391 // the plug-in. Returns true if it successfully sets the window handle on the | 1398 // the plug-in. Returns true if it successfully sets the window handle on the |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 } | 1566 } |
1560 #endif | 1567 #endif |
1561 | 1568 |
1562 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1569 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1563 int resource_id) { | 1570 int resource_id) { |
1564 if (!plugin_) | 1571 if (!plugin_) |
1565 return; | 1572 return; |
1566 | 1573 |
1567 plugin_->URLRedirectResponse(allow, resource_id); | 1574 plugin_->URLRedirectResponse(allow, resource_id); |
1568 } | 1575 } |
OLD | NEW |