Implement chrome.inputMethodPrivate.setAutocorrectRange

This sends the Data to the TextInputClient, which is responsible for handling rendering.

Bug: 1091088
Change-Id: I0c8669ff3d3b632e4fbc9eeeb3691f7929e069a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2230404
Commit-Queue: Keith Lee <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Darren Shen <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/master@{#779733}
diff --git a/components/arc/ime/arc_ime_service.cc b/components/arc/ime/arc_ime_service.cc
index 8ac03cf4..4718428 100644
--- a/components/arc/ime/arc_ime_service.cc
+++ b/components/arc/ime/arc_ime_service.cc
@@ -612,6 +612,13 @@
   return false;
 }
 
+bool ArcImeService::SetAutocorrectRange(const base::string16& autocorrect_text,
+                                        const gfx::Range& range) {
+  // TODO(https:://crbug.com/1091088): Implement this method.
+  NOTIMPLEMENTED_LOG_ONCE();
+  return false;
+}
+
 // static
 void ArcImeService::SetOverrideDefaultDeviceScaleFactorForTesting(
     base::Optional<double> scale_factor) {
diff --git a/components/arc/ime/arc_ime_service.h b/components/arc/ime/arc_ime_service.h
index bbb9b321..4a48b31 100644
--- a/components/arc/ime/arc_ime_service.h
+++ b/components/arc/ime/arc_ime_service.h
@@ -146,6 +146,8 @@
   bool SetCompositionFromExistingText(
       const gfx::Range& range,
       const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
+  bool SetAutocorrectRange(const base::string16& autocorrect_text,
+                           const gfx::Range& range) override;
 
   // Normally, the default device scale factor is used to convert from DPI to
   // physical pixels. This method provides a way to override it for testing.
diff --git a/components/exo/text_input.cc b/components/exo/text_input.cc
index d004a1f..370a77ee9 100644
--- a/components/exo/text_input.cc
+++ b/components/exo/text_input.cc
@@ -324,6 +324,13 @@
   return false;
 }
 
+// TODO(crbug.com/1091088) Implement setAutocorrectRange
+bool TextInput::SetAutocorrectRange(const base::string16& autocorrect_text,
+                                    const gfx::Range& range) {
+  NOTIMPLEMENTED_LOG_ONCE();
+  return false;
+}
+
 void TextInput::OnKeyboardVisibilityChanged(bool is_visible) {
   delegate_->OnVirtualKeyboardVisibilityChanged(is_visible);
 }
diff --git a/components/exo/text_input.h b/components/exo/text_input.h
index e3f89fdd..f463cfd 100644
--- a/components/exo/text_input.h
+++ b/components/exo/text_input.h
@@ -140,6 +140,8 @@
   bool SetCompositionFromExistingText(
       const gfx::Range& range,
       const std::vector<ui::ImeTextSpan>& ui_ime_text_spans) override;
+  bool SetAutocorrectRange(const base::string16& autocorrect_text,
+                           const gfx::Range& range) override;
 
   // ash::KeyboardControllerObserver:
   void OnKeyboardVisibilityChanged(bool is_visible) override;