| Index: third_party/WebKit/Source/web/WebViewImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| index 7c61e20f38e560ef3a9b1c10dd0067fde3d705e1..0a95e506c8ea8d2a86f9d1be62af632be17c056b 100644
|
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| @@ -2300,7 +2300,7 @@ void WebViewImpl::setFocus(bool enable)
|
| if (autofillClient)
|
| autofillClient->setIgnoreTextChanges(true);
|
|
|
| - focusedFrame->inputMethodController().confirmComposition();
|
| + focusedFrame->inputMethodController().replaceComposition();
|
|
|
| if (autofillClient)
|
| autofillClient->setIgnoreTextChanges(false);
|
| @@ -2370,25 +2370,28 @@ bool WebViewImpl::confirmComposition()
|
|
|
| bool WebViewImpl::confirmComposition(ConfirmCompositionBehavior selectionBehavior)
|
| {
|
| - return confirmComposition(WebString(), selectionBehavior);
|
| + return confirmComposition(WebString(), selectionBehavior, 1);
|
| }
|
|
|
| -bool WebViewImpl::confirmComposition(const WebString& text)
|
| +bool WebViewImpl::confirmComposition(const WebString& text, int relativeCursorPosition)
|
| {
|
| UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
|
| - return confirmComposition(text, DoNotKeepSelection);
|
| + return confirmComposition(text, DoNotKeepSelection, relativeCursorPosition);
|
| }
|
|
|
| -bool WebViewImpl::confirmComposition(const WebString& text, ConfirmCompositionBehavior selectionBehavior)
|
| +bool WebViewImpl::confirmComposition(const WebString& text, ConfirmCompositionBehavior selectionBehavior, int relativeCursorPosition)
|
| {
|
| LocalFrame* focused = focusedLocalFrameAvailableForIme();
|
| if (!focused)
|
| return false;
|
|
|
| if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused))
|
| - return plugin->confirmComposition(text, selectionBehavior);
|
| + return plugin->confirmComposition(text, selectionBehavior, relativeCursorPosition);
|
|
|
| - return focused->inputMethodController().confirmCompositionOrInsertText(text, selectionBehavior == KeepSelection ? InputMethodController::KeepSelection : InputMethodController::DoNotKeepSelection);
|
| + if (selectionBehavior == KeepSelection)
|
| + return focused->inputMethodController().confirmComposition(text);
|
| +
|
| + return focused->inputMethodController().confirmCompositionWithCursor(text, relativeCursorPosition);
|
| }
|
|
|
| bool WebViewImpl::compositionRange(size_t* location, size_t* length)
|
|
|