Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: chrome/renderer/webplugin_delegate_proxy.cc

Issue 3782012: Merge 62820 - Implement IME for Mac plugins using the Cocoa event model on 10... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552/src/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.h ('k') | third_party/mozilla/ComplexTextInputPanel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest) 465 IPC_MESSAGE_HANDLER(PluginHostMsg_URLRequest, OnHandleURLRequest)
466 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCPBrowsingContext, 466 IPC_MESSAGE_HANDLER(PluginHostMsg_GetCPBrowsingContext,
467 OnGetCPBrowsingContext) 467 OnGetCPBrowsingContext)
468 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad) 468 IPC_MESSAGE_HANDLER(PluginHostMsg_CancelDocumentLoad, OnCancelDocumentLoad)
469 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest, 469 IPC_MESSAGE_HANDLER(PluginHostMsg_InitiateHTTPRangeRequest,
470 OnInitiateHTTPRangeRequest) 470 OnInitiateHTTPRangeRequest)
471 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading, 471 IPC_MESSAGE_HANDLER(PluginHostMsg_DeferResourceLoading,
472 OnDeferResourceLoading) 472 OnDeferResourceLoading)
473 473
474 #if defined(OS_MACOSX) 474 #if defined(OS_MACOSX)
475 IPC_MESSAGE_HANDLER(PluginHostMsg_SetImeEnabled,
476 OnSetImeEnabled);
475 IPC_MESSAGE_HANDLER(PluginHostMsg_BindFakePluginWindowHandle, 477 IPC_MESSAGE_HANDLER(PluginHostMsg_BindFakePluginWindowHandle,
476 OnBindFakePluginWindowHandle); 478 OnBindFakePluginWindowHandle);
477 IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK, 479 IPC_MESSAGE_HANDLER(PluginHostMsg_UpdateGeometry_ACK,
478 OnUpdateGeometry_ACK) 480 OnUpdateGeometry_ACK)
479 // Used only on 10.6 and later. 481 // Used only on 10.6 and later.
480 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetIOSurface, 482 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetIOSurface,
481 OnAcceleratedSurfaceSetIOSurface) 483 OnAcceleratedSurfaceSetIOSurface)
482 // Used on 10.5 and earlier. 484 // Used on 10.5 and earlier.
483 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, 485 IPC_MESSAGE_HANDLER(PluginHostMsg_AcceleratedSurfaceSetTransportDIB,
484 OnAcceleratedSurfaceSetTransportDIB) 486 OnAcceleratedSurfaceSetTransportDIB)
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame, 1020 void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame,
1019 gfx::Rect view_frame) { 1021 gfx::Rect view_frame) {
1020 IPC::Message* msg = new PluginMsg_WindowFrameChanged(instance_id_, 1022 IPC::Message* msg = new PluginMsg_WindowFrameChanged(instance_id_,
1021 window_frame, 1023 window_frame,
1022 view_frame); 1024 view_frame);
1023 // Make sure frame events are delivered in the right order relative to 1025 // Make sure frame events are delivered in the right order relative to
1024 // sync messages they might interact with (e.g., HandleEvent). 1026 // sync messages they might interact with (e.g., HandleEvent).
1025 msg->set_unblock(true); 1027 msg->set_unblock(true);
1026 Send(msg); 1028 Send(msg);
1027 } 1029 }
1030 void WebPluginDelegateProxy::ImeCompositionConfirmed(const string16& text,
1031 int plugin_id) {
1032 // If the text isn't intended for this plugin, there's nothing to do.
1033 if (instance_id_ != plugin_id)
1034 return;
1035
1036 IPC::Message* msg = new PluginMsg_ImeCompositionConfirmed(instance_id_,
1037 text);
1038 // Order relative to other key events is important.
1039 msg->set_unblock(true);
1040 Send(msg);
1041 }
1028 #endif // OS_MACOSX 1042 #endif // OS_MACOSX
1029 1043
1030 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { 1044 void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) {
1031 uses_shared_bitmaps_ = !window; 1045 uses_shared_bitmaps_ = !window;
1032 window_ = window; 1046 window_ = window;
1033 if (plugin_) 1047 if (plugin_)
1034 plugin_->SetWindow(window); 1048 plugin_->SetWindow(window);
1035 } 1049 }
1036 1050
1037 void WebPluginDelegateProxy::WillDestroyWindow() { 1051 void WebPluginDelegateProxy::WillDestroyWindow() {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 if (!channel_host_) 1380 if (!channel_host_)
1367 return NULL; 1381 return NULL;
1368 1382
1369 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, 1383 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_,
1370 instance_id_); 1384 instance_id_);
1371 proxy->InitializeForSeekableStream(resource_id, range_request_id); 1385 proxy->InitializeForSeekableStream(resource_id, range_request_id);
1372 return proxy; 1386 return proxy;
1373 } 1387 }
1374 1388
1375 #if defined(OS_MACOSX) 1389 #if defined(OS_MACOSX)
1390 void WebPluginDelegateProxy::OnSetImeEnabled(bool enabled) {
1391 if (render_view_)
1392 render_view_->SetPluginImeEnabled(enabled, instance_id_);
1393 }
1394
1376 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) { 1395 void WebPluginDelegateProxy::OnBindFakePluginWindowHandle(bool opaque) {
1377 BindFakePluginWindowHandle(opaque); 1396 BindFakePluginWindowHandle(opaque);
1378 } 1397 }
1379 1398
1380 // Synthesize a fake window handle for the plug-in to identify the instance 1399 // Synthesize a fake window handle for the plug-in to identify the instance
1381 // to the browser, allowing mapping to a surface for hardware acceleration 1400 // to the browser, allowing mapping to a surface for hardware acceleration
1382 // of plug-in content. The browser generates the handle which is then set on 1401 // of plug-in content. The browser generates the handle which is then set on
1383 // the plug-in. Returns true if it successfully sets the window handle on the 1402 // the plug-in. Returns true if it successfully sets the window handle on the
1384 // plug-in. 1403 // plug-in.
1385 bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { 1404 bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 if (index->mime_type == "application/x-vnd.moveplayer.qm" || 1562 if (index->mime_type == "application/x-vnd.moveplayer.qm" ||
1544 index->mime_type == "application/x-vnd.moveplay2.qm" || 1563 index->mime_type == "application/x-vnd.moveplay2.qm" ||
1545 index->mime_type == "application/x-vnd.movenetworks.qm" || 1564 index->mime_type == "application/x-vnd.movenetworks.qm" ||
1546 index->mime_type == "application/x-vnd.mnplayer.qm") { 1565 index->mime_type == "application/x-vnd.mnplayer.qm") {
1547 return true; 1566 return true;
1548 } 1567 }
1549 } 1568 }
1550 return false; 1569 return false;
1551 } 1570 }
1552 #endif 1571 #endif
OLDNEW
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.h ('k') | third_party/mozilla/ComplexTextInputPanel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698