| Index: Source/web/WebViewImpl.cpp
|
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
|
| index b9914471a160362749da4e8daa39cfddf0c3d4f1..981ad9849c2666c9607cebcd7be2e88526e523e1 100644
|
| --- a/Source/web/WebViewImpl.cpp
|
| +++ b/Source/web/WebViewImpl.cpp
|
| @@ -88,6 +88,7 @@
|
| #include "core/events/WheelEvent.h"
|
| #include "core/html/HTMLInputElement.h"
|
| #include "core/html/HTMLMediaElement.h"
|
| +#include "core/html/HTMLPlugInElement.h"
|
| #include "core/html/HTMLTextAreaElement.h"
|
| #include "core/html/HTMLVideoElement.h"
|
| #include "core/html/ime/InputMethodContext.h"
|
| @@ -2063,6 +2064,9 @@ bool WebViewImpl::setComposition(
|
| if (!focused || !m_imeAcceptEvents)
|
| return false;
|
|
|
| + if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused))
|
| + return plugin->setComposition(text, underlines, selectionStart, selectionEnd);
|
| +
|
| // The input focus has been moved to another WebWidget object.
|
| // We should use this |editor| object only to complete the ongoing
|
| // composition.
|
| @@ -2125,6 +2129,10 @@ bool WebViewImpl::confirmComposition(const WebString& text, ConfirmCompositionBe
|
| Frame* focused = focusedWebCoreFrame();
|
| if (!focused || !m_imeAcceptEvents)
|
| return false;
|
| +
|
| + if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused))
|
| + return plugin->confirmComposition(text, selectionBehavior);
|
| +
|
| return focused->inputMethodController().confirmCompositionOrInsertText(text, selectionBehavior == KeepSelection ? InputMethodController::KeepSelection : InputMethodController::DoNotKeepSelection);
|
| }
|
|
|
| @@ -2333,6 +2341,14 @@ InputMethodContext* WebViewImpl::inputMethodContext()
|
| return 0;
|
| }
|
|
|
| +WebPlugin* WebViewImpl::focusedPluginIfInputMethodSupported(Frame* frame)
|
| +{
|
| + WebPluginContainerImpl* container = WebFrameImpl::pluginContainerFromNode(frame, WebNode(focusedElement()));
|
| + if (container && container->supportsInputMethod())
|
| + return container->plugin();
|
| + return 0;
|
| +}
|
| +
|
| void WebViewImpl::didShowCandidateWindow()
|
| {
|
| if (InputMethodContext* context = inputMethodContext())
|
|
|