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 bf81588c350d8e218d6363af97f554643192f438..1a9cbcba57a91ad69f883a89a487c679bd495c61 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) |
// needs to be audited. See http://crbug.com/590369 for more details. |
focusedFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
- focusedFrame->inputMethodController().confirmComposition(); |
+ focusedFrame->inputMethodController().finishComposingText(InputMethodController::KeepSelection); |
if (autofillClient) |
autofillClient->setIgnoreTextChanges(false); |
@@ -2363,36 +2363,34 @@ bool WebViewImpl::setComposition( |
return text.isEmpty() || inputMethodController.hasComposition(); |
} |
-bool WebViewImpl::confirmComposition() |
+bool WebViewImpl::finishComposingText(ConfirmCompositionBehavior selectionBehavior) |
{ |
- return confirmComposition(DoNotKeepSelection); |
-} |
+ LocalFrame* focused = focusedLocalFrameAvailableForIme(); |
+ if (!focused) |
+ return false; |
-bool WebViewImpl::confirmComposition(ConfirmCompositionBehavior selectionBehavior) |
-{ |
- return confirmComposition(WebString(), selectionBehavior); |
+ if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused)) |
+ return plugin->finishComposingText(selectionBehavior); |
+ |
+ return focused->inputMethodController().finishComposingText(selectionBehavior == KeepSelection ? InputMethodController::KeepSelection : InputMethodController::DoNotKeepSelection); |
} |
-bool WebViewImpl::confirmComposition(const WebString& text) |
+bool WebViewImpl::commitText(const WebString& text, int relativeCaretPosition) |
{ |
UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
- return confirmComposition(text, DoNotKeepSelection); |
-} |
-bool WebViewImpl::confirmComposition(const WebString& text, ConfirmCompositionBehavior selectionBehavior) |
-{ |
LocalFrame* focused = focusedLocalFrameAvailableForIme(); |
if (!focused) |
return false; |
if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused)) |
- return plugin->confirmComposition(text, selectionBehavior); |
+ return plugin->commitText(text, relativeCaretPosition); |
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
// needs to be audited. See http://crbug.com/590369 for more details. |
focused->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
- return focused->inputMethodController().confirmCompositionOrInsertText(text, selectionBehavior == KeepSelection ? InputMethodController::KeepSelection : InputMethodController::DoNotKeepSelection); |
+ return focused->inputMethodController().commitText(text, relativeCaretPosition); |
} |
WebRange WebViewImpl::compositionRange() |