Add support for Android SuggestionSpans

Desktop / Chromium - Ryan Landay [chromium.org] - 12 September 2017 14:04 EDT

This is the final CL to (at least ones not marked with FLAG_MISSPELLING; there will be one or more additional CLs to add support for those). This CL includes:

- Changes to ImeAdapter to make it pass SuggestionSpans into InputMethodController

- Changes to InputMethodController to make it create suggestion markers from the passed-in SuggestionSpans

- Additional methods in TextSuggestionController for getting the list of text suggestions under the cursor, and applying a suggestion

- More Mojo code to pass information about text suggestions back-and-forth between browser and renderer code

- Changes to SuggestionsPopupWindow and TextSuggestionHost so we can show either a spell check or a text suggestion menu

Bug: 672259 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I3f30543586901baec4648d265874a303efafbd44 Reviewed-on: https://chromium-review.googlesource.com/627172 Commit-Queue: Ryan Landay

3fc7721 Add support for Android SuggestionSpans
chrome/android/java_sources.gni | 2 +-
...estionMenuTest.java => SpellCheckMenuTest.java} | 23 +-
content/browser/android/ime_adapter_android.cc | 41 ++-
.../android/text_suggestion_host_android.cc | 86 ++++-
.../browser/android/text_suggestion_host_android.h | 33 +-
.../text_suggestion_host_mojo_impl_android.cc | 13 +-
.../text_suggestion_host_mojo_impl_android.h | 7 +-
.../render_widget_host_view_android.cc | 2 +-
content/public/android/BUILD.gn | 5 +
.../public/android/java/res/values-v17/styles.xml | 3 +
.../chromium/content/browser/input/ImeAdapter.java | 51 +++
.../browser/input/SpellCheckPopupWindow.java | 59 ++++
.../content/browser/input/SuggestionInfo.java | 81 +++++
.../browser/input/SuggestionsPopupWindow.java | 79 +++--
.../content/browser/input/TextSuggestionHost.java | 89 ++++--
.../browser/input/TextSuggestionsPopupWindow.java | 94 ++++++
.../browser/input/TextSuggestionMenuTest.java | 223 +++++++++++++
services/ui/public/interfaces/ime/ime.mojom | 11 +-
.../ui/public/interfaces/ime/ime_struct_traits.cc | 37 +++
.../ui/public/interfaces/ime/ime_struct_traits.h | 15 +
third_party/WebKit/Source/core/editing/BUILD.gn | 1 +
.../Source/core/editing/InputMethodController.cpp | 20 +-
.../Source/core/editing/SelectionController.cpp | 2 +-
.../suggestion/TextSuggestionBackendImpl.cpp | 25 +-
.../editing/suggestion/TextSuggestionBackendImpl.h | 7 +-
.../suggestion/TextSuggestionController.cpp | 353 ++++++++++++++++++---
.../editing/suggestion/TextSuggestionController.h | 23 +-
.../suggestion/TextSuggestionControllerTest.cpp | 124 +++++++-
.../core/editing/suggestion/TextSuggestionInfo.h | 26 ++
.../WebKit/public/platform/input_host.mojom | 26 +-
.../WebKit/public/platform/input_messages.mojom | 10 +-
ui/platform_window/mojo/ime_type_converters.h | 1 +
32 files changed, 1395 insertions(+), 177 deletions(-)

Upstream: git.chromium.org


  • Share