Make InputMethodController::SetComposition() set composition range from UndoStep
TypingCommand::InsertText(const String&, bool, EditingState*) is sort of messed up right now because it calls AdjustSelectionAfterIncrementalInsertion(), which calls FrameSelection::SetSelection(), which we want to hoist out of here (see discussion at https://goo.gl/GFgLF3). This CL removes AdjustSelectionAfterIncrementalInsertion's call to SetSelection() and replaces it with some logic in InputMethodController::SetComposition() to pull the ending selection out of the most recent UndoStep. This sets us up to avoid an unnecessary selectionchange event. Currently, SetComposition() does the following: 1. Selects the composition range. 2. Replaces the selection with the new text (requesting that the new text be left selected). 3. Converts the selection back into a composition range. This CL sets us up to avoid actually selecting the range in step 2; instead, we can make TypingCommand::InsertText() set it as the ending selection, and InputMethodController can retrieve it from the UndoStep. Bug: 790801 Change-Id: I9111af255f61c34f5bdaf27b94a5e8a659750860 Reviewed-on: https://chromium-review.googlesource.com/807151Reviewed-by:Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by:
yosin (OOO Dec 11 to Jan 8) <yosin@chromium.org> Commit-Queue: Ryan Landay <rlanday@chromium.org> Cr-Commit-Position: refs/heads/master@{#521984}
Showing
Please register or sign in to comment