summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 23:31:55 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 23:31:55 +0000
commit935d63deb04754a6c831c5a5edfef35f71c0b805 (patch)
tree9ebbc892c6bd4abb5496bf246d0677a1e7f3c571 /chrome/plugin
parentdf39d8740b4de18d5a57ec3a9fc519d89b26b1cc (diff)
downloadchromium_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/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc7
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h1
-rw-r--r--chrome/plugin/webplugin_proxy.cc8
-rw-r--r--chrome/plugin/webplugin_proxy.h2
4 files changed, 18 insertions, 0 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 39282a1..cb6af0d 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -122,6 +122,8 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginMsg_ContainerHidden, OnContainerHidden)
IPC_MESSAGE_HANDLER(PluginMsg_ContainerShown, OnContainerShown)
IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged)
+ IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionConfirmed,
+ OnImeCompositionConfirmed)
#endif
IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualResponse,
OnDidReceiveManualResponse)
@@ -367,6 +369,11 @@ void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame,
if (delegate_)
delegate_->WindowFrameChanged(window_frame, view_frame);
}
+
+void WebPluginDelegateStub::OnImeCompositionConfirmed(const string16& text) {
+ if (delegate_)
+ delegate_->ImeCompositionConfirmed(text);
+}
#endif // OS_MACOSX
void WebPluginDelegateStub::OnDidReceiveManualResponse(
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index 0c1101e..5bc2887 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -85,6 +85,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
bool has_focus);
void OnWindowFrameChanged(const gfx::Rect& window_frame,
const gfx::Rect& view_frame);
+ void OnImeCompositionConfirmed(const string16& text);
#endif
void OnDidReceiveManualResponse(
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 5ec1b43..9741393 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -648,6 +648,14 @@ void WebPluginProxy::SetDeferResourceLoading(unsigned long resource_id,
}
#if defined(OS_MACOSX)
+void WebPluginProxy::SetImeEnabled(bool enabled) {
+ IPC::Message* msg = new PluginHostMsg_SetImeEnabled(route_id_, enabled);
+ // This message can be sent during event-handling, and needs to be delivered
+ // within that context.
+ msg->set_unblock(true);
+ Send(msg);
+}
+
void WebPluginProxy::BindFakePluginWindowHandle(bool opaque) {
Send(new PluginHostMsg_BindFakePluginWindowHandle(route_id_, opaque));
}
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 2134bf3..bf0b705 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -141,6 +141,8 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
gfx::NativeViewId containing_window() { return containing_window_; }
#if defined(OS_MACOSX)
+ virtual void SetImeEnabled(bool enabled);
+
virtual void BindFakePluginWindowHandle(bool opaque);
virtual webkit_glue::WebPluginAcceleratedSurface* GetAcceleratedSurface();