diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-15 23:31:55 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-15 23:31:55 +0000 |
commit | 935d63deb04754a6c831c5a5edfef35f71c0b805 (patch) | |
tree | 9ebbc892c6bd4abb5496bf246d0677a1e7f3c571 /chrome/renderer/render_view.cc | |
parent | df39d8740b4de18d5a57ec3a9fc519d89b26b1cc (diff) | |
download | chromium_src-935d63deb04754a6c831c5a5edfef35f71c0b805.zip chromium_src-935d63deb04754a6c831c5a5edfef35f71c0b805.tar.gz chromium_src-935d63deb04754a6c831c5a5edfef35f71c0b805.tar.bz2 |
Implement IME for Mac plugins using the Cocoa event model on 10.6
Based on the implementation of Gecko's Cocoa event model IME handling on 64-bit, but modified to fit Chrome's cross-process event handling.
Because NSTextInputContext is 10.6+, 10.5 will need a cempletely different implementation.
BUG=30905
TEST=Plugins implementing the updated NPAPI Cocoa IME spec should handle IME on 10.6.
Review URL: http://codereview.chromium.org/3808001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r-- | chrome/renderer/render_view.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 0ca3650..125e4d5 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -789,6 +789,8 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { #if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) + IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionConfirmed, + OnPluginImeCompositionConfirmed) #endif IPC_MESSAGE_HANDLER(ViewMsg_SetEditCommandsForNextKeyEvent, OnSetEditCommandsForNextKeyEvent) @@ -4872,6 +4874,17 @@ void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame, (*plugin_it)->WindowFrameChanged(window_frame, view_frame); } } + +void RenderView::OnPluginImeCompositionConfirmed(const string16& text, + int plugin_id) { + // WebPluginDelegateProxy is responsible for figuring out if this text + // applies to it or not, so inform all the delegates. + std::set<WebPluginDelegateProxy*>::iterator plugin_it; + for (plugin_it = plugin_delegates_.begin(); + plugin_it != plugin_delegates_.end(); ++plugin_it) { + (*plugin_it)->ImeCompositionConfirmed(text, plugin_id); + } +} #endif // OS_MACOSX void RenderView::SendExtensionRequest( @@ -5794,6 +5807,15 @@ void RenderView::EnsureDocumentTag() { } #if defined(OS_MACOSX) +void RenderView::SetPluginImeEnabled(bool enabled, int plugin_id) { + IPC::Message* msg = new ViewHostMsg_SetPluginImeEnabled(routing_id(), + enabled, plugin_id); + // This message can be sent during event-handling, and needs to be delivered + // within that context. + msg->set_unblock(true); + Send(msg); +} + gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( bool opaque, bool root) { gfx::PluginWindowHandle window = NULL; |