summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 21:15:13 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 21:15:13 +0000
commitb7f75868cb53eb45d3e15263a663327e381d40db (patch)
treebc2faeff6b2f1137e79be528168a26decc646231 /chrome/plugin
parentdb5523bcb7e0419955172709c241a188ab94e8e0 (diff)
downloadchromium_src-b7f75868cb53eb45d3e15263a663327e381d40db.zip
chromium_src-b7f75868cb53eb45d3e15263a663327e381d40db.tar.gz
chromium_src-b7f75868cb53eb45d3e15263a663327e381d40db.tar.bz2
Update Mac plugin IME handling to match updated spec
This changes IME handling per the recent NPAPI spec clarification, and adds the new bool to indicate conformance to the new model. Also: - Fixes an existing bug where the initial key down would be sent to the wrong IME system (since it happens before plugin IME starts) by having the render widget track whether a plugin is focused. - Changes ComplexTextInputPanel to match recent upstream changes. BUG=70427 TEST=None (plugins have not yet implemented Cocoa IME). Review URL: http://codereview.chromium.org/6259013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72190 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc8
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h2
-rw-r--r--chrome/plugin/webplugin_proxy.cc9
-rw-r--r--chrome/plugin/webplugin_proxy.h4
4 files changed, 15 insertions, 8 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 7e8808c..6b0f39a 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -125,8 +125,8 @@ bool 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)
+ IPC_MESSAGE_HANDLER(PluginMsg_ImeCompositionCompleted,
+ OnImeCompositionCompleted)
#endif
IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualResponse,
OnDidReceiveManualResponse)
@@ -378,9 +378,9 @@ void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame,
delegate_->WindowFrameChanged(window_frame, view_frame);
}
-void WebPluginDelegateStub::OnImeCompositionConfirmed(const string16& text) {
+void WebPluginDelegateStub::OnImeCompositionCompleted(const string16& text) {
if (delegate_)
- delegate_->ImeCompositionConfirmed(text);
+ delegate_->ImeCompositionCompleted(text);
}
#endif // OS_MACOSX
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index 0a95587..ce99e77 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -89,7 +89,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);
+ void OnImeCompositionCompleted(const string16& text);
#endif
void OnDidReceiveManualResponse(
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 6448239..de15ce7 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -653,8 +653,13 @@ 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);
+void WebPluginProxy::FocusChanged(bool focused) {
+ IPC::Message* msg = new PluginHostMsg_FocusChanged(route_id_, focused);
+ Send(msg);
+}
+
+void WebPluginProxy::StartIme() {
+ IPC::Message* msg = new PluginHostMsg_StartIme(route_id_);
// This message can be sent during event-handling, and needs to be delivered
// within that context.
msg->set_unblock(true);
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index c5a0a1d..acc89ab 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -147,7 +147,9 @@ class WebPluginProxy : public webkit::npapi::WebPlugin {
gfx::NativeViewId containing_window() { return containing_window_; }
#if defined(OS_MACOSX)
- virtual void SetImeEnabled(bool enabled);
+ virtual void FocusChanged(bool focused);
+
+ virtual void StartIme();
virtual void BindFakePluginWindowHandle(bool opaque);